Chapter 8
In This Chapter
Building an Android package file
Creating a developer profile in the Google Play Store
Picking a price for your app
Illustrating your app with a screen shot
Uploading and publishing your application
Monitoring downloads
The Google Play Store is the official application distribution mechanism for Android. Publishing your application to the store enables your application to be downloaded, installed, and used by millions of users across the world. Users can also rate your application and leave comments about it, which helps you identify possible use trends and problematic areas that users might be encountering.
The Google Play Store also provides a set of valuable statistics that you can use to track the success of your application.
In this chapter, you publish your application to the Google Play Store. You find out how to provide a couple of screen shots, a promotional screen shot, and a short description of your application.
So you have a great idea, and it has led you to develop the next hit application or game for the Android platform. Now you’re ready to put the application into the hands of users. The first thing you need to do is package your application so that it can be placed on their devices. To do so, you create an Android package file, or APK file, which you will do in the following sections.
You can build an Android APK file in numerous ways:
Really, these are just three different ways to kick off your gradle build.
In this book you will use Android Studio to create a signed APK file. Android Studio provides an array of tools that compile, digitally sign, and package your Android application into an APK file.
The Android system requires all installed applications to be digitally signed with a certificate that contains a public/private key pair. The private key is held by the developer. The certificate that’s used to digitally sign the application identifies developer and establishes the trust relationships between applications.
You need to know some key information about signing Android applications:
The certificate process is outlined in detail in the Android documentation at
.http://d.android.com/tools/publishing/app‐signing.html
A keystore in Android (and in Java) is a container in which your private certificates reside. You can use a couple of tools in Android to create a keystore file:
The keystore file contains your private certificate, which Android uses to identify your application in the Google Play Store. Back up your keystore in a safe location because if you happen to lose it, you cannot sign the application with the same private key. Neither can you upgrade your application because the Google Play Store platform recognizes that the application isn’t signed by the same key and restricts you from upgrading it — the store sees the file as a new Android application. This also happens if you change the package name of the app; Android doesn’t recognize it as a valid update because the package and/or certificate are not the same.
To create your first APK file, follow these steps:
Select the Silent Mode Toggle module and click Next.
The Generate Signed APK Wizard, shown in Figure 8-1, opens with the current project name filled in.
Press the Create New button (as shown in Figure 8-2).
Or, if you already have a keystore, press the Choose Existing button instead.
Choose the location of your keystore.
Find your project directory (the directory above SilentModeToggle) and create a keystore there named release.jks, as in Figure 8-3. For example: /Users/mike/Projects/android‐for‐dummies‐v3/release.jks.
Enter a password that you’ll remember, and reenter it in the Confirm field.
If using an existing keystore, you won’t need to confirm your password.
Your keystore file has been created, but now you need to create a key.
Click OK.
You’ll return to the Generate Signed APK Wizard dialog box, but this time the fields should be filled as in Figure 8-4.
Optionally check the Remember password check box so that you don’t have to retype it every time, and click Next.
If you don’t have a Master Password configured for Android Studio, you may be prompted to set one so that Android Studio can remember your password securely.
Choose the APK destination folder and the Build Type as in Figure 8-5.
The location should be set to the SilentModeToggle directory, and the Build Type should be release.
Click Finish.
The .apk file is created in your chosen location as well as a keystore in the location you chose in Step 4. Open these locations, and you can see a .jks file as well as an .apk file.
You have created a distributable APK file and a reusable keystore for future updates.
After you have created an APK file, you can release the application on the Google Play Store. To do so, you create a Google Play developer profile. To create this profile, you first need a Google account. Any Google‐based account, such as a Gmail account, works. If you have no Google account, you can open a free one by navigating to
.www.google.com/accounts
To create the Google Play developer profile, follow these steps:
http://play.google.com/apps/publish
.
Sign in to your Google account.
If you’re already signed in to your account, you go straight to Step 3 to fill in your developer profile.
Check “I agree” to accept the terms of the developer agreement (Figure 8-6), and then click Continue to Payment.
If you don’t pay the developer fee, you cannot publish applications.
On the Secure Checkout page, fill in your credit card details and billing information, then click the Accept and Continue button.
If you already have a credit card on file with Google, you may not see the page in Figure 8-7. If you already have a card set up, select one and continue.
Scroll down and click the Complete Registration button.
Congratulations, you are now a registered Android developer! The Android developer home page opens, as shown in Figure 8-9, where you can upload your application or set up a merchant account (which you need, if you’ll be charging a fee for your apps). See the nearby “Google Wallet merchant accounts” sidebar.
So you have created an APK file and you’re a registered Android developer. Now you’re ready to put your app into users’ hands. (Finally!) But you must answer one last question — is your app a free app or a paid app?
Make this decision before you release your app, because its price has psychological consequences for potential customers or users and monetary consequences for you. If yours is a paid application, you have to determine your price point. Only you can make this decision, so check out similar applications in the Play Store, and their price points, to determine your pricing strategy. The majority of apps are priced between $0.99 and $9.99. Keeping the pricing of your app competitive with your market is a game of economics that you have to play to determine what works for your application.
The paid‐versus‐free discussion is an evergreen debate, and both sides can be profitable. You only have to figure out what works best for your application, given your situation.
If you choose the paid model for your app, you generally start seeing money in your pocket within 24 hours of the first sale (barring holidays and weekends). However, your paid application probably won’t receive many active installs.
Users who download your app from the Google Play Store get a free, 2‐hour trial period to try out your paid application. During the trial period, users can experiment with the fully functional application, and if they don’t like it, simply uninstall it for a full refund. The trial period is extremely useful because users aren’t penalized for taking your app for a brief test‐drive.
If you choose to take the free route, users can install the application for free. Between 50 and 80 percent of the users who install your free app will keep the application on the device; the others will uninstall it. The elephant in the room now is the question of how to make money by creating free apps.
As the age‐old saying goes, nothing in life is free, and the saying applies to making money on free apps. You have two basic options:
The top mobile advertising company is Google (
). Google offers useful SDKs and walks you through the steps to run ads on your native Android applications. Google pays on a net‐60‐day cycle, so you may have to wait a few months to receive your first check.https://developer.android.com/google/play‐services/ads.html
Screen shots are a vital part of the Google Play Store ecosystem because they allow users to preview an application before installing it. Allowing users to view a couple of screen shots of your application can be the determining factor in installing your application. If you’ve spent weeks (or months) creating detailed graphics for a game that you want users to play, you want potential users and buyers to see them so that they can see the overall look of your app.
To grab real‐time shots of your application, you use an emulator or a physical Android device. To grab screen shots with an emulator, follow these steps:
Click the Screenshot button to take a screen shot.
After the screen shot is taken, save the file somewhere on your computer.
You’ve finally reached the apex of Android application development: You’re ready to publish the application. To publish your app, you’ll need to collect the following information:
Publishing an application is easy — follow these steps:
On the Android developer’s home page (refer to Figure 8-9), click the Publish an Android App on Google Play button.
The Add New Application page opens, as shown in Figure 8-10.
Click Upload APK, and choose the .apk file that you created earlier in this chapter.
No two applications can have the same package name in the Google Play Store. Therefore, if you try to upload the Silent Mode Toggle application at this point, you see this error message:
The package name of your apk (com.dummies.silentmodetoggle) is the same as
the package name of another developer’s application. Choose a
new package name.
When you upload an application that you’ve created, you don’t see this message.
Click Store Listing, and set the description for your application (see Figure 8-11).
Users see this description when they inspect your application to determine whether to install it. All this text is indexed for the Google Play Store search engine.
Scroll down to the Screenshots section and add two screen shots from your application.
Apps with screen shots have higher install rates than apps without them. These screen shots allow users to preview your application in a running state without having to install your application.
Add a promotional shot.
The promo shot is not a screen shot but rather an advertisement used for random promotions that Android chooses to showcase.
Upload a high‐resolution app icon image.
Refer to Chapter 6 for instructions on how to create a 512‐x‐512‐high resolution app icon.
Set the promotional text of your application.
Promotional text is used when your application is featured or promoted in the Google Play Store. Getting your application featured is likely based on the popularity of your application. If it’s chosen to be featured in the promotional area of the Google Play Store (usually in the upper area of the screen of each category), the promo text shows up as the promotional component for it.
Set the application type, category, and content rating.
This app falls into the Applications type; if you have a game app, choose the Games type.
The Category is based on your application type.
The Content Rating helps to prevent kids from seeing things that are too mature for them.
Fill out the Web Site and E‐Mail fields (and Phone, if you want).
These fields are used to contact you for various reasons, including app feature requests and bug reports. If you fill in the Phone field, remember that users can call to speak with you. If you’re writing an app for one company and publishing it under your developer account, you can change the Web Site, E‐Mail, and Phone fields so that users can’t contact you.
Select the list of countries where the application should be visible.
For example, if your application is meant for an Italian audience, deselect All Locations and select Italy as the destination location, to ensure that only devices in the Italy region can see it in the store. If you leave All Locations enabled, all locations can (you guessed it) see your app in the store.
Click Save, then click Publish.
Your application is published to the Google Play Store.
Figure 8-13 shows an application in the Google Play Store.
You’ve probably noticed a certain highlight in this process: It has no app‐approval process (like a certain other platform does). You can create an app now and publish it, and users can install it within a few minutes or hours. You can then complete a quick release cycle and get new features out the door as quickly as you finish them — very cool.
You’ve finally published your first application. Now it’s time to watch those millions start rolling in, right? Kind of. You might be an independent developer who’s releasing the next standout first‐person shooter game, or you might be a corporate developer who’s pushing out your company’s Android application. Regardless, to be aware of the user experience on various devices, you can identify how your application is doing in various ways using the Google Play developer console:
Staying in touch with your user base is a large task in itself, but doing so can reap the reward of dedicated, happy customers who refer their friends and family to your application.
34.231.180.210