Skip to content

Instantly share code, notes, and snippets.

package com.example.www.pokedex;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.algolia.instantsearch.helpers.InstantSearch;
import com.algolia.instantsearch.helpers.Searcher;
import com.algolia.search.saas.Client;
import com.algolia.search.saas.Index;
helper.search();
@Override
protected void onDestroy() {
searcher.destroy();
super.onDestroy();
}
Searcher searcher = Searcher.create(ALGOLIA_APP_ID, ALGOLIA_SEARCH_API_KEY, ALGOLIA_INDEX_NAME)
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:algolia="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android {
dataBinding.enabled true
//..
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:algolia="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/my_toolbar"
<manifest
...>
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:usesCleartextTraffic="true"
...>
implementation 'com.algolia:instantsearch-android:1.13.0'
[
{
"id":1,
"num":"001",
"name":"Bulbasaur",
"img":"http://www.serebii.net/pokemongo/pokemon/001.png",
"type":[
"Grass",
"Poison"
],