Deploying a PhoneGap app to Google Play

This article is a companion text to Deploying a PhoneGap app to Windows Marketplace and Deploying a PhoneGap application to iTunes (App Store) articles. It provides you with necessary information on how to successfully submit your .apk file (compiled locally or through Phonegap Bulid) to Google Play.

Register Google Play Developer account

Since virtually nothing, what Google says, turns out to be true :) then claim on "Get Started with Publishing" saying "Start publishing on Google Play in minutes" may also be easily taken as fairy tale. But, let's try our best to get to publishing to Google Play as fast and as easy as possible.

Let's go:

  1. Start with Google Play Console Signup Form and pick an account you want to associate with console for publishing purposes. Review (agree on) terms and distribution countries.

  2. Make sure, that the credit card, you're about to use, can be charged the 25 USD one-time registration fee and proceed to payment. You can pay only with Google Wallet, so you'll have to bind your credit card to it, if you haven't been using this service before.

  3. After successful payment and filling up some details about you as developer and app publisher, you'll redirected to Google Play Developer Console's homepage.

From this point you can go to Getting started guide or set up a merchant account (required, if you want to sell paid apps or offer in-apps purchases to end user).

Set up a merchant account

You must click link provided in your Developer Console. Going directly to won't do the trick.

The entire process is as easy as filling up one page form about your business. It includes sensitive data, like address etc., so enter carefully, if you don't want to publish too much. Note, however, that under developers terms (to which you agreed) you are required to provide current, valid postal address where you may be contacted, ff you offer paid apps or in-app items for sale. Failure to do so may result in the suspension of your account and/or sales of your apps. While providing postal address for Google Developer account is optional (you can provide either postal address or email address), providing it for merchant account is obligatory.

After submitting the form, you should be informed, that your merchant account has been created and approved and you can now sell apps on Google Play.

You may now visit your merchant account to check all the information in profiles, provide taxes info etc. You may especially be interested in setting up VAT tax parameters for your country or payment settings, so you can receive your mobile earnings. For many countries, the only method for getting payments is to setup a bank account, for which you need IBAN number of your account and SWIFT code of your bank (no direct to credit card payments allowed). Bank account verification is done the very same way as in case of PayPal. Google sends you a small amount of money through bank transfer with a specific code placed in transfer's title. You should revisit "Payment Settings" section, once you receive this transfer, and enter given code into verification form. You don't need to this money back.

Note, that as a moment of writing this, Google merchant account management was working really, really poor. I was bumped with 404, 505 errors and "An unexpected error has occurred. Please try again later" notices more time than I actually saw a real page. Setting up data was a really pain in the neck. Hope, this was temporal only.

Generate your keystore file and build your signed .apk file

Applications sent to Google Play for publication must be signed by a proper certificate. PhoneGap Build does the job of signing your app (details), but needs you to generate your keystore file. You can generate this file (and optionally sign your application) either in Android Studio or manually, through command line, using Android SDK. Follow this link, if you want to use Android Studio, as this won't be discussed in here.

To manually generate your keystore file, you need a JDK fro, Java SE. Since you're going to use keytool only, you don't need neither Android SDK nor Android Studio. Install the minimal version of JDK, that is, without Sources and JRE redistribution kit.

After installation, open command line and navigate to path, where your JDK has been installed (i.e. c:Program Files (x86)Javajdk1.8.0_45bin), because this path isn't added to PATH environment and you can't use these tools anywhere.

First (the only) step is to use keytool, just as it was explained in "Signing Your App Manually" section:

keytool -genkey -v -keystore mykey.keystore -alias name -keyalg RSA -keysize 2048 -validity 10000

where mykey.keystore is name of your keystore file (that you're going to eventually upload to PhoneGap Build) and alias is alias name used in the same place.

After executing above command, you'll be asked to provide certain information about you and your company required for creating your personal certificate. You'll also have to provide two passwords (may be the same): keystore password and key password. Generated keystore will be placed in the same folder, where you executed above command (i.e. c:\Program Files (x86)\Java\jdk1.8.0_45\bin\mykey.keystore).

There's a four years old article, which claims, that you don't need keytool and JVM to generate a keystore file. You can do this with local installation of OpenSSL. Since most of information provided in this article is outdated (you can't build and iOS app without Mac -- four years in IT is quite a lot), this also may be no longer true. Verify yourself, if you're interested.

Pick Edit account from menu that scrolls down, when you click your avatar next to Adobe logo in top-right corner and go to Signing Keys section. Click add a key ... button below Android. Enter any title (used only to identify this key for you, in case you'd be using more than one) and alias, that exactly matches what you've used when generating your key, i.e. -alias parameter's value in executed command-line. Finally, hit the submit key button to get your keystore file uploaded to PhoneGap Build.

On contrary to documentation, for security reasons, you don't provide keystore password and key password when uploading keystore file any more. Instead, each key is uploaded in locked state and you provide these two passwords each time you want to unlock your key for an hour. To do this, hit the yellow backgrounded lock icon and provide keystore password and key password.

Go to your selected application screen, select your newly uploaded and unlocked key from No key selected dropdown menu. Immediately after that your application will be rebuild. Once this is done, you can download your .apk file. Notice, that it is no longer named Name-debug.apk, but Name-release.apk instead.

Prepare yourself for a app submission

This is a long journey through 6-7 sections filled up with a lot of form fields and placeholders for file uploads. Don't sit down to this task, when you have 15 minutes or you'll most likely fail. Reserve at least 1-2 hours (assuming, you have all required files ready -- see below). Hopefully, you're doing this only once for each application (you don't need to repeat most of these steps when publishing an update) and you can reuse information provided here, when publishing application to other app stores.

As of writing this, you need following "resources" to get your app published to Google Play:

  • title (up to 30 characters),
  • short description (80 characters at most),
  • full description (up to 4000 characters),
  • feature graphics in 1024x500 px dimensions and .jpg or 24-bit (no alpha) .png,
  • hi-res icon in 512x512 px dimensions and 32-bit (with alpha) .png type (transparency looks ugly, so don't use it),
  • at least 2 screenshots overall and up to 8 screenshots per one of four device types (phone, 7 inch tablet, 10 inch tablet and TV) with minimum 320 px length for any side and maximum 3840 px length for any side.

There are some additional images, you can provide for your application. See for yourself.

You also need a valid contact email address and be prepared for answering a lot of strange questions for rating purpose (see below for details).

Publish your first application

After providing information in each of below discussed sections, always remember to click Save draft in top-right corner. When you're done with everything, clicking on Publish app will start its voyage to the wild world. In any moment, when you see that Publish app button is disabled, while you're certain, that you have already met all the requirements, you may make use of Why can't I publish? link to see a summary of missings for your app.

First, we need to deal with the .apk file itself. To handle this:

  1. Go back to Google Play Developer console and click on Publish an Android App on Google Play. Set language, title and click Upload APK. Your first application's details will be saved and you'll be redirected to application page.
  2. Click on Upload your first APK to Production and provide signed .apk file, just generated by PhoneGap Build.

After successful upload and file processing, you should be back to your application screen, in APK section and Production tab. You should see number and list of unsupported and supported devices with option to exclude certain. You should also see application version in form of 27 (2.1.0), where first digit is version code increased automatically with each build and second part is version name declared by you in config.xml. You can click the version string to see details about your application.

Now, you need to fill up Store Listing section. It generates application screen, each user sees before downloading your application. This is an essential point in your app marketing, so prepare yourself enough (make sure, you have all the screenshots and text ready) before you fill it up.

Next is Content Rating section, where you provide (again!) your email address and rate your application. When finished answering all these questions, click on Save draft, Calculate rating and -- after reviewing and confirming -- on Apply rating.

Now, you should set information about app's price and distribution range. I assume, that your first Google Play application is free. Pick Free (acknowledge, that this setting is permanent!) and check Select All Countries. Fill out all other required fields and checkboxes.

If you don't offer in-app purchases or use any specific services or APIs, you should be ready for a publication of your application after you fill out first four sections (APK, Store Listing, Content Rating and Pricing & Distribution). If -- after doing so -- your Publish app button is still disabled, make use of Why can't I publish? link and/or Optimisation Tips section.

Once you're done, hit the Publish app button to send your application for a review before publication. According to Google, this should take no more than just a few hours. In the meantime you can explore all the possibilities, that Google Play Developer Console gives you (including statistic, metrics, tests etc.).

You will not receive any email from Google, confirming, that your application is made public. It is up to you to check its state often or (as in my case) to be surprised finding it, when searching in Google Play.

Conclusion

Once your application gets enough audience (or maybe right after you publish it), you may consider monetizing it and earning a few bucks on displaying ads in it. I'm using (and strongly suggesting) AdMob ads with AdMob Plugin Pro for this purpose. If you have followed above mentioned article and set everything up, then the only thing, that is left is to link your Google Play application (once it is approved and published) to proper ad unit in your AdMob settings panel.

This article is devoted deploying mobile application, built with PhoneGap Build, into Google Play. It assumes, that you'll have your .apk ready out of the PhoneGap Build. If you're interested in building this file locally, then this article can be a good starting point for that.

Leave a Reply