I found this article: A new way to search for content in your apps and I'm really excited for this opportunity. I want to show my application content in google search results, like this:
But this article doesn't have any information about how to implement this features in your app.
I use App Indexing API in my application, as described in articles:
This is my code:
...
private GoogleApiClient mClient;
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.ac_main);
mClient = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();
}
public Action getAction() {
Thing object = new Thing.Builder()
.setName("Test Content")
.setDescription("Test Description")
.setUrl(Uri.parse("myapp://com.example/"))
.build();
return new Action.Builder(Action.TYPE_VIEW).setObject(object)
.setActionStatus(Action.STATUS_TYPE_COMPLETED)
.build();
}
@Override
public void onStart() {
super.onStart();
mClient.connect();
AppIndex.AppIndexApi.start(mClient, getAction());
}
@Override
public void onStop() {
AppIndex.AppIndexApi.end(mClient, getAction());
mClient.disconnect();
super.onStop();
}
...
And this is result:
Google show my application's Test Content but without description and preview image. Is there any ways to add description and preview image in Google Search Results? (like Youtube or Twitter)