Gives API access to all Algolia functionality, settings, advanced features, and ML/AI products
Compatible with InstantSearch for Android
Works with Android Studio (recommended) or without
Background retry strategy to ensure uptime
Seamless batching via iterators to optimize number of network calls
Zero downtime reindexing feature
Latest release
We highly recommend using our Kotlin API client, which is supported and maintained by Algolia.
INSTALL (GET A FREE ACCOUNT HERE.)
// Gradle
dependencies {
// [...]
implementation 'com.algolia:algoliasearch-android:3.+'
// This will automatically update to the latest v3 release when you build your project
}
INDEX
List<JSONObject> array = new ArrayList<JSONObject>();
array.add(
new JSONObject()
.put("firstname", "Jimmie")
.put("lastname", "Barninger")
.put("objectID", "myID")
);
array.add(
new JSONObject()
.put("firstname", "Warren")
.put("lastname", "Speach")
.put("objectID", "myID2")
);
index.saveObjectsAsync(new JSONArray(array), null);
SEARCH
Index index = client.getIndex("contacts");
// Add settings
Query query = new Query("query string")
.setAttributesToRetrieve("firstname", "lastname")
.setHitsPerPage(50);
// Perform search
index.searchAsync(query, new CompletionHandler() {
@Override
public void requestCompleted(JSONObject content, AlgoliaException error) {
// [...]
}
});