Essential Android Firebase App Indexing edit forum

Add AppIndexing API

For Adding this to project you can find official doc easily but in this example I’m going to highlight some of the key areas to be taken care of.

Step 1 :- Add google service

dependencies {
      compile ''

Step 2 :- Import classes


Step 3 :- Add App Indexing API calls

private GoogleApiClient mClient;
private Uri mUrl;
private String mTitle;
private String mDescription;

//If you know the values that to be indexed then you can initialize these variables in onCreate() 
protected void onCreate(Bundle savedInstanceState) {
mClient = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();
mUrl = "";
mTitle = "Standard Poodle";
mDescription = "The Standard Poodle stands at least 18 inches at the withers";

//If your data is coming from a network request, then initialize these value in onResponse() and make checks for NPE so that your code won’t fall apart.

//setting title and description for App Indexing
mUrl = Uri.parse(“android-app://com.famelive/https/” +model.getId());
mTitle =   model.getTitle();
mDescription = model.getDescription();

AppIndex.AppIndexApi.start(mClient, getAction());

protected void onStop() {
if (mTitle != null && mDescription != null && mUrl != null) //if your response fails then check whether these are initialized or not
   if (getAction() != null) {
       AppIndex.AppIndexApi.end(mClient, getAction());

 public Action getAction() {
   Thing object = new Thing.Builder()

 return new Action.Builder(Action.TYPE_WATCH)

To test this just follow the step 4 in Remarks given below.

Table Of Contents
64 Menu
112 Loader
119 Xposed
132 Colors
135 Fresco
140 AdMob
147 Button
153 Firebase App Indexing
156 Vk SDK
170 XMPP
176 OpenCV
200 FileIO
203 Moshi
217 Paint
231 AIDL
241 JCodec
243 Okio
255 Looper
  ↑ ↓ to navigate     ↵ to select     Esc to close