Digital Goods Transaction of Actions on Google (Build Android App)

Yoichiro Tanaka
10 min readDec 15, 2018

--

In the previous story, I described an overview of the Digital Goods Transaction feature provided by Actions on Google.

The Digital Goods Transaction feature relies on the Google Play and Google Play Console to manage digital goods. This means that you need to build an simple (almost empty) Android app and to upload it to the Google Play Console. I introduce how to set up your Android app with Android Studio and Google Play Console in this story.

Download and Install Android Studio

The first task is downloading and installing Android Studio in your PC. You can download it from the following site:

After downloading, install it according to the instruction described at the site above.

Create your Android app

After launching your Android Studio, you should see the wizard window as like the following:

Click the “Start a new Android Studio project” item, then you see the following next page:

Enter your app’s name into the “Application name” field. Don’t forget that you confirm the “Package name”. If you don’t like the package name, you can change the name by clicking the “Edit” button. Then, click the “Next” button.

Click the “Next” without changing any items.

Again, click the “Next” button.

In the last page of the wizard above, click the “Finish” button. If this is the first creation after installing Android Studio, you need to click the “Next” button to install some dependent libraries.

After generating files, you should see like the following window:

Congratulation! You could get your empty Android app.

Add Billing Permission

To turn on the In-app purchase management feature in the Google Play Console, you need to upload your Android app with a “Billing” permission. Here, add the billing permission to your Android app by the following step:

  1. Open the “build.gradle (Module: app)” in the “Gradle Scripts” on the Android navigation pane.
  2. Add the Play Billing Library as the dependent library in the dependencies section.
dependencies {
...
implementation 'com.android.billingclient:billing:1.2'
}

Then, click the “Sync now” link on the right top of the window:

Actually, the billing permission will be added automatically after adding the Play Billing Library.

Generate Signed APK file

Now, you modified only one file and added only one line. However, it’s all. Your code is ready to upload to the Google Play Console. You can generate an APK file with signature.

Click the “Generate Signed Bundle/APK…” menu item in the “Build” menu.

You see like the following dialog. Select the “APK”, and click the “Next” button.

In the next page, at this time, create a new key store. Click the “Create new…” button.

You need to fill in each field about your key store as like the following:

  • Key store path: The file path with the “jks” extension. You can put the file into any directory.
  • Password and Confirm: The password phrase to access to the key store. There are two set of them, but I recommend that you should use same phrase.
  • Alias: Basically, you should fill in the app name.
  • Validity (years): Default value.
  • Certificate: Fill in your information.

Then, click the “OK” button.

After closing the “New Key Store” dialog, some values are automatically set in each field. Enable the “Remember passwords” checkbox, and click the “Next” button.

Last, check both the “V1 (Jar Signature)” and “V2 (Full APK Signature)”, and click the “Finish” button.

The build process is started, and an APK file will be generated after completing the process.

When clicking the “locate” link on the tip shown on the right bottom of the window, you should see the folder where the generated APK file was put.

If the APK file is generated successfully, you can close the Android Studio.

Start using Google Play Console

If you’re not an Android developer, probably you don’t have any experiances to use the Google Play Console. To start using the Google Play Console, you need to have the following since digital transactions are for selling goods that you own in the Google Play store.

  • Google Play Developer Account
  • Payment Profile

To start selling digital goods in the Google Play store, read the Play console and payments center docs for instructions on the following sites:

Create a new application in Google Play Console

If you don’t have any apps on the Google Play Console, you will see the following page. In this case, click the “PUBLISH AN ANDROID APP ON GOOGLE PLAY” button.

Or, if you already have one or more apps, you will see the app listing page. In this case, click the “CREATE APPLICATION” button.

The “Create application” dialog is opened. Fill in each field as like the following:

  • Default language: English (United States) — en-US
  • Title: Your Android App Name

Click the “CREATE” button.

A new application is created and is shown in the Google Play Console.

You see that there are some gray check icons on the right of some menu items. Basically, you need to change the gray check icons to green check icons by filling in each necessary information. After filling in them, you can publish (aka. roll out) your application.

Fill in Product Details on Storing Listing page

Let’s fill in product detail information on the Storing listing page. If you are now in other page, click the “Storing listing” menu item on the left menu to open the storing listing page.

You need to fill in values to the following fields:

  • Short description
  • Full description
  • Screenshots (at least, two PNG or JPEG images, which their sizes are 320x320 and 512x512)
  • Hi-res icon (PNG image, 512x512)
  • Feature Graphic (PNG or JPEG image, 1024x500)
  • Application type (here, select “Applications”)
  • Category (here, select “Art & Design”)
  • Email (probably, this has been automatically filled in)
  • Privacy Policy (here, fill in some URL)

Of course, if you intend to publish your action officially, you must specify all valid values into each field. But, if your purpose is to test Digital Goods Transaction only, all dummy values are ok as like the following:

Then, click the “SAVE DRAFT” button on the bottom of the page. After saving, you will see the green check icon on the right of the “Storing listing” menu item.

Upload APK file

Most configurations can be changed after uploading the APK file. Therefore, let’s upload the generated APK file at this time.

Click the “App releases” menu item on the left navigation menu.

You can release your Android app for internal test, alpha, beta and production environments. In this story, upload your APK file for Beta. Click the “MANAGE” on the “Beta” section.

Click the “CREATE RELEASE” button on the next page.

Currently, Google Play Console is providing an App Signing feature. Your APK file is automatically signed by Google Play by using the feature instead of you. You can enable the App Signing feature by clicking the “CONTINUE” button on the “App signing by Google Play” section.

To upload your APK file, do either the following way:

  • Click the “BROWSE FILES” button and select your APK file.
  • Drag and drop your APK file to the gray area in the “Android App Bundles and APKs to add” section.

If uploading your APK is successfully, you see a new entry of your APK in the list.

Then, click the “SAVE” button on the bottom of the page. You should see that the check icon color of the right of the “App release” menu item has bee changed to the green.

Set Pricing and Distribution

Next, configure about pricing and distribution. Click the “Pricing & distribution” menu item from the left navigation menu.

Set each configuration as like the following:

  • This application is: Here, select the “FREE”.
  • Countries: Select the “Available” of the “United States”. The number of the “Available countries” will be “1”.
  • Primarily Child-Directed: Select the “No”.
  • Contains ads: Select the “No, it has no ads”.
  • Content guidelines: Turn on the checkbox.
  • US export laws: Turn on the checkbox.

Last, click the “SAVE DRAFT” button on the bottom of the page. The “Pricing & distribution” menu item could have the green icon by the steps above.

Set up Content Rating

The next task is to set up Content Rating. Click the “Content rating” menu item on the left navigation menu, and click the “CONTINUE” button on the right page.

Fill in to each following field:

  • Email address and Confirm email address: Your email address.
  • Select your app category: Select the “UTILITY, PRODUCTIVITY, COMMUNICATION, OR OTHER”.

When you click the “UTILITY, PRODUCTIVITY, COMMUNICATION, OR OTHER” row, the next page is shown immediately. There are many questions on the page. Answer “No” for most questions except the “MISCELLANEOUS: Does the app allow users to purchase digital goods?” question. That is, you answer “Yes” only for the question regarding the digital goods.

Then, click the “SAVE QUESTIONNAIRE” on the bottom of the page. And, the “CALCULATE RATING” should be enabled after clicking. Click the button. In the next page, you see the calculated result. Click the “APPLY RATING” button on the bottom of the page.

Ok, you should see that the color of the check icon next to the “Content rating” menu item has been changed to the green.

As the important point, the status of your application should be “Ready to publish”. You can confirm that at below your application name on the top of the page.

Roll out your Android App

Ok, now all preparations are completed. Let’s roll out your Android app. Click the “App release” menu item on the left navigation menu, then click the “MANAGE” link on the Beta section on the right page.

You set up the testers here. Select the “Open Beta Testing” for the “Choose a testing method”, and click the “SAVE” button.

Then, click the “EDIT RELEASE” button next to the “Manage testers” section. The “REVIEW” button on the bottom of the next page should be enabled. Click the button.

The page is refreshed, and you should see the “START ROLLOUT TO BETA” button on the bottom of the page. Click it.

The confirmation dialog is opened, then click the “CONFIRM” button.

Ok, you should see the status of your application as “Pending publication”.

Congratulation! Visit the Google Play Console after a few minutes. You will see that the status of your Android app has been changed to the “Publish” status.

Next Action

You got your Android app with the Billing permission registered to the Google Play Console. In the next story, I intend to describe how to create your Actions on Google project.

--

--