ProAndroidDev

The latest posts from Android Professionals and Google Developer Experts.

Follow publication

How To Create Your Own Sticker Pack for Google Keyboard (Demo)

Have you ever wondered how stickers are added to your Google Keyboard? I joined a meet up event conducted by AndroidlistenerGroup in Chicago last weekend and one of the topics provided answer to the above question.

I hope this article could provide more explanations and basic grounds for anyone who are interested in creating their own sticker packs for Google Keyboard.

What is GBoard?

GBoard is a google keyboard that has everything you love about Google Keyboard — speed and reliability, Glide Typing, voice typing, and more — plus Google Search built in. No more app switching; just search and share, right from your keyboard.

Gboard also has emoji search to help you find emoji faster, plus GIF search, and multilingual typing to let you switch between languages on the fly.

As can be seen from the above, there are more than a million download of the keyboard. These are the market for your sticker packs.

  • Normal Keyboard vs GBoard

What is sticker?

Sticker is a label or motion image that express one’s feeling. Those who use social network medias are much familiar with stickers.

Here are stickers available for GBoard.

Firebase

  • Firebase Indexing

Firebase App Indexing gets your app into Google Search. If users have your app installed, they can launch your app and go directly to the content they’re searching for. App Indexing reengages your app users by helping them find both public and personal content right on their device, even offering query autocompletions to help them more quickly find what they need. If users don’t yet have your app, relevant queries trigger an install card for your app in Search results.

Using the Firebase App Indexing API, you’ll be able index any sticker assets you created.

Now that you understand all the important components, here is how to create your sticker pack for GBoard

Pre-requisites

  • A device running Android 4.0 (Ice Cream Sandwich) or newer, and Google Play services 11.4.0 or higher
  • The Google Play services SDK from the Google Repository, available in the Android SDK Manager
  • The latest version of Android Studio, version 1.5 or higher
  • Firebase index configuration
  • Google-services.json, a configuration from your firebase project
  • Install Google Keyboard application

Get your hands dirty

In the demo code, I used JobIntentService for background service, and execute it when user click on the add sticker button.

Then we can execute the service:

AppIndexingUpdateService.enqueueWork(HomeActivity.this);

AppIndexingUtil.java is an util class that has useful methods for getting indexable builders of sticker packs and stickers.

Note:

  • You should build and index stickers on first run after update or install to minimize the lag between a user installing the app and seeing the stickers in Gboard.
  • Sticker guide for google keyboard: For optimal image quality, use square images sized 320 pixels or 500 pixels.

Demo Run

Source Code:

Encountered issue:

  • Error:org.gradle.api.GradleException: File google-services.json is missing. The Google Services Plugin cannot function without it.

You need to provide your google-service.json generated by your firebase project.

  • Android App Indexing → FirebaseAppIndexingInvalidArgumentException Intent cannot be resolved;

In the activity manifest

<intent-filter>
<action android:name=”android.intent.action.VIEW” />
<category android:name=”android.intent.category.DEFAULT” />
<category android:name=”android.intent.category.BROWSABLE” />
<data android:scheme=”mystickers” /> //name of your schema
<data android:host=”sticker” />
</intent-filter>

Get Featured in the Sticker Collection

Deploy app and submit to google for preview and let it available for all Board user.

For more information, here are the two official resources:

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Published in ProAndroidDev

The latest posts from Android Professionals and Google Developer Experts.

Responses (8)