Android

Android + Algolia

Build mobile search experiences with libraries & UI components.

Sign up
What is Algolia

What is Algolia

Algolia empowers modern developers to build world class search and discovery experiences without any DevOps.
Libraries with every major language and framework make it easy to enrich your users' experiences. 

Kotlin client

API-first search and discovery for your Android apps

Utilize the Algolia open-source Kotlin client to index your data, configure your search, add analytics and much more.  

Algolia maintains and supports the Kotlin client and highly recommends you use it in your Android applications.

Features

  • 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

Version

  • Latest release

  • We highly recommend using our Kotlin API client, which is supported and maintained by Algolia. 

Related Integrations

Get started

  • Install (get a free account here.)
    1
    // Gradle
    2
    dependencies {
    3
        // [...]
    4
        implementation 'com.algolia:algoliasearch-android:3.+'
    5
        // This will automatically update to the latest v3 release when you build your project
    6
    }
  • Index
    1
    List<JSONObject> array = new ArrayList<JSONObject>();
    2
    array.add(
    3
      new JSONObject()
    4
        .put("firstname", "Jimmie")
    5
        .put("lastname", "Barninger")
    6
        .put("objectID", "myID")
    7
    );
    8
    array.add(
    9
      new JSONObject()
    10
        .put("firstname", "Warren")
    11
        .put("lastname", "Speach")
    12
        .put("objectID", "myID2")
    13
    );
    14
    15
    index.saveObjectsAsync(new JSONArray(array), null);
  • Search
    1
    Index index = client.getIndex("contacts");
    2
    3
    // Add settings
    4
    Query query = new Query("query string")
    5
      .setAttributesToRetrieve("firstname", "lastname")
    6
      .setHitsPerPage(50);
    7
    8
    // Perform search
    9
    index.searchAsync(query, new CompletionHandler() {
    10
      @Override
    11
      public void requestCompleted(JSONObject content, AlgoliaException error) {
    12
        // [...]
    13
      }
    14
    });
Get started for free
Explore developer docs