Je veux afficher le contenu de mon application dans l'application mobile de Google Search chaque fois que l'utilisateur recherche dans google app.so que mon application peut montrer dans la liste avec le contenu de mon application .. en d'autres termes je cherche enable personal content firebase indexing ..android app contenu firebase indexation
je suis passé par beaucoup de guides et documents, je suis capable de faire l'indexation des applications pour urls web ..
mais je veux aussi montrer le contenu de mon application dans google recherche J'ai essayé de faire cela en utilisant le code ci-dessous ..
J'ai créé le service d'intention
public class AppIndexingService extends IntentService {
DatabaseAccess databaseAccess;
public AppIndexingService() {
super("AppIndexingService");
}
@Override
protected void onHandleIntent(Intent intent) {
databaseAccess = DatabaseAccess.getInstance(getApplicationContext(), getResources().getString(R.string.shamukey));
databaseAccess.open();
ArrayList<Indexable> indexableNotes = new ArrayList<>();
ArrayList<RaviMessages>indexableMessagesArrayList=databaseAccess.readArticles("bagale");
for (RaviMessages recipe :indexableMessagesArrayList) {
Indexable noteToIndex = Indexables.noteDigitalDocumentBuilder()
.setName(recipe.getName())
.setDescription(recipe.getStatus())
.setUrl("android-app://com.itsvibrant.FeelMyLoveMarathi/")
.put("image","http://www.logospike.com/wp-content/uploads/2015/10/Android_Logo_04.png")
.build();
indexableNotes.add(object);
}
if (indexableNotes.size() > 0) {
Indexable[] notesArr = new Indexable[indexableNotes.size()];
notesArr = indexableNotes.toArray(notesArr);
// batch insert indexable notes into index
FirebaseAppIndex.getInstance().update(notesArr);
}
}
}
Fichier manifeste Android.
<application
android:name=".ApplicationContext"
android:allowBackup="true"
android:icon="@mipmap/fml_mar"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<meta-data
android:name="android.app.default_searchable"
android:value="com.itsvibrant.FeelMyLoveMarathi.MainActivity" />
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable" />
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="android-app"
android:host="com.itsvibrant.FeelMyLoveMarathi" />
<data
android:host="ravindrabagale.com"
android:pathPrefix="/"
android:scheme="http" />
<data
android:host="shayari"
android:scheme="ravindrabagale" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<service android:name="AppIndexingService"
android:exported="true"
android:permission="com.google.android.gms.permission.APPINDEXING">
<intent-filter>
<action android:name="com.google.firebase.appindexing.UPDATE_INDEX" />
</intent-filter>
</service>
</application>
Mais je ne suis toujours pas en mesure d'afficher le contenu de mon application dans la recherche google .. quoi de mal que je fais ??? ou suis en train d'oublier quelque chose ??