⚠️ This repository is deprecated⚠️ We are no longer maintaining an Android library for Site Search. However, you can still build excellent native and mobile web experiences with Site Search APIs and clients. Thank you! - Elastic
Swiftype Android Example App for Swiftype Site Search
This example app shows how easy it is to get started with SwiftypeAndroid to add Swiftype-powered Site Search to your Android application.
Note: This client has been developed for the Swiftype Site Search API endpoints only. You may refer to the Swiftype Site Search API Documentation for additional context.
To run the sample application:
-
Check out the code.
-
Check out the SwiftypeAndroid git submodule.
git submodule init git submodule update
-
Start the Android Studio and open the SwiftypeAndroidExample/SwiftypeAndroidExample project.
-
Add
SwiftypeAndroidExample/SwiftypeAndroid
as a module. -
Go to File -> Project Structure. Click SwiftypeAndroid -> Dependencies. Select "Export" on all Android Support libraries and apply the new settings. You should now be able to compile the project.
-
Edit the
SwiftypeAndroidExample/res/values/swiftype_config.xml
file:- Set your Engine Key in the
engine_key
parameter - Update the
search_content_provider_authority
to be unique for your application. - Set the document_types parameter value to @array/crawler_based if using a crawler-based engine or @array/wordpress if using a WordPress plugin-based engine.
NOTE: If you make changes to the
swiftype_config.xml
file after the first run, make sure to increment thedatabase_version
. - Set your Engine Key in the
-
Click the Run button to launch the emulator.
Don't have a crawler-based or WordPress-based search engine yet? Go to swiftype.com, sign up if you haven't yet, and create a new engine.
License
This code is MIT licensed. See LICENSE.txt for details.