Más contenido relacionado
La actualidad más candente (20)
Similar a App indexingのススメ(補足版) (7)
App indexingのススメ(補足版)
- 12. public class SearchActivity extends Activity {
private GoogleApiClient mGoogleApiClient;
private static final Uri APP_URI = Uri.parse("android-app://jp.pxv.android/pixiv/illusts/tag/C87");
@Override
public void onCreate(Bundle savedInstanceState) {
...
mGoogleApiClient = new GoogleApiClient.Builder(this).addApi(AppIndex.APP_INDEX_API).build();
...
}
@Override
protected void onStart() {
super.onStart();
mGoogleApiClient.connect();
String title = "App Indexing API Title";
Uri webUri = Uri.parse("http://www.pixiv.net/search.php?s_mode=s_tag&word=C87");
Uri touchUri = Uri.parse("http://touch.pixiv.net/search.php?s_mode=s_tag_full&word=C87");
AppIndex.AppIndexApi.view(mGoogleApiClient, this, APP_URI, title, webUri, null);
AppIndex.AppIndexApi.view(mGoogleApiClient, this, APP_URI, title, touchUri, null);
}
@Override
protected void onStop() {
super.onStop();
AppIndex.AppIndexApi.viewEnd(mGoogleApiClient, this, APP_URI);
mGoogleApiClient.disconnect();
}
}
- 16. App Indexing API 注意点
• コンテンツがない場合はAPIをコールしない
• 無駄に複数回APIをコールしない
• オートコンプリートは設定が必要