apk from zero to google play store

21
9/17/2016 Android App Distribution Tutorial: From Zero to Google Play Store https://www.raywenderlich.com/122114/androidappdistributiontutorialzerogoogleplaystore 1/21 Android App Distribution Tutorial: From Zero to Google Play Store If you're new here, you may want to subscribe to my RSS feed or follow me on Twitter . Thanks for visiting! You have finished your Android app, and celebrated its perfection with many flagons of ale (or pitchers of beer). Hooray! Now you’re ready to send your app out into the world. Soon it will reside not only on your own Android device, but on the devices of people around the globe. It’s an exciting step! There are several ways to distribute your Android app. This Android app distribution tutorial will cover two of the most common channels: the Google Play Store , where over 1.8 million Android apps are available, and the Amazon Appstore , which has over 300,000. In this stepbystep tutorial, you’ll see how to take your finished Android app and release it to the Google Play Store and other stores. Let’s get shipping! :] Getting Started To publish an app, you first need … a finished app, of course :] For this tutorial, you’ll use a simple app that allows users to search for books, see book covers, and share books with friends. Download and unzip this archive and open the project in Android Studio. Note: If you have a finished Android app of your own, you can use it instead of the sample app, and work alongside this tutorial to put it in the store. Before going any further, you must set a new package name across the app. The package name needs to be unique and remain unchanged in Google Play. A common format is the reversedomain name, like this: com.your_domain_name.app_name Currently, the best way to refactor an app’s package name in Android Studio is to start in the Project pane of Android Studio, with the Android view chosen. Select the gear icon that looks like this: You will see a dropdown menu with several project viewing options. Uncheck Compact Empty Middle Packages if it is not already unchecked: Matt Luedke on April 5, 2016

Upload: lgsgbhsic-university-of-south-asia

Post on 15-Apr-2017

52 views

Category:

Internet


1 download

TRANSCRIPT

9/17/2016 Android App Distribution Tutorial: From Zero to Google Play Store

https://www.raywenderlich.com/122114/android­app­distribution­tutorial­zero­google­play­store 1/21

Android App Distribution Tutorial: FromZero to Google Play Store

If you're new here, you may want to subscribe to my RSS feed or follow me on Twitter. Thanks for visiting!

You have finished your Android app, and celebrated its perfection with manyflagons of ale (or pitchers of beer). Hooray! Now you’re ready to send yourapp out into the world. Soon it will reside not only on your own Androiddevice, but on the devices of people around the globe. It’s an exciting step!

There are several ways to distribute your Android app. This Android appdistribution tutorial will cover two of the most common channels: the GooglePlay Store, where over 1.8 million Android apps are available, and theAmazon Appstore, which has over 300,000.

In this step­by­step tutorial, you’ll see how to take your finished Android appand release it to the Google Play Store and other stores. Let’s get shipping! :]

Getting StartedTo publish an app, you first need … a finished app, of course :] For thistutorial, you’ll use a simple app that allows users to search for books, seebook covers, and share books with friends.

Download and unzip this archive and open the project in Android Studio.

Note: If you have a finished Android app of your own, you can use it instead of the sample app, and work alongside this

tutorial to put it in the store.

Before going any further, you must set a new package name across the app. The package name needs to be unique and remainunchanged in Google Play. A common format is the reverse­domain name, like this:

com.your_domain_name.app_name

Currently, the best way to refactor an app’s package name in Android Studio is to start in the Project pane of Android Studio,with the Android view chosen. Select the gear icon that looks like this:

You will see a drop­down menu with several project viewing options. Uncheck Compact Empty Middle Packages if it is notalready unchecked:

Matt Luedke on April 5, 2016

9/17/2016 Android App Distribution Tutorial: From Zero to Google Play Store

https://www.raywenderlich.com/122114/android­app­distribution­tutorial­zero­google­play­store 2/21

Now you can refactor the parts of the package name separately. Right­click on the package named example, selectRefactor\Rename, and change it to your name or domain name. Then do the same for the package omgandroid. Your projectshould now look like this (with your own names instead of mine):

Next, open build.gradle (the one labeled Module: OMGAndroid, NOT the one for whole project), and find defaultConfig. Adda applicationId parameter with your new package name:

defaultConfig

applicationId 'com.colemanfrancis.bookmastergeneral'

minSdkVersion 14

targetSdkVersion 23

Finally, open manifest\AndroidManifest.xml, find the manifest tag at the top of the file, and locate the package attribute withinit. Update it with your new package name:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"

package="com.colemanfrancis.bookmastergeneral"

android:versionCode="1"

android:versionName="1.0">

Build and run to verify that your refactoring worked correctly. With your unique package name in hand, you’re now ready topackage your app for distribution.

Creating a Signed APKWhen developing on the Android operating system, you use the Android application package (APK) format to distribute apps.

9/17/2016 Android App Distribution Tutorial: From Zero to Google Play Store

https://www.raywenderlich.com/122114/android­app­distribution­tutorial­zero­google­play­store 3/21

Android requires that APKs are digitally signed with a certificate before they can be installed. The certificate is used to identifythe author of the app. More information about app signing can be found here.

A signed APK can be generated manually from command line or in Android Studio.

In Android Studio, select Build\Generate Signed APK….

Your app only has one module, so select Next.

With your app module chosen, you need to tell Android Studio how to sign the APK. You’ll use a key store, which will stay privateto you. Android Studio will guide you through creating a new key store; start by selecting Create new….

9/17/2016 Android App Distribution Tutorial: From Zero to Google Play Store

https://www.raywenderlich.com/122114/android­app­distribution­tutorial­zero­google­play­store 4/21

Choose a filename and location on your system, set and confirm a secure password, and fill in the rest of the information aboutyourself:

Click OK, and Android Studio will create your key store. You’ll need that file, with its password info, to make any updates to yourapp, so don’t lose it!

With your new key store, Android Studio returns you to the dialog box you saw before. Now the key store information is pre­filled,so just click Next.

9/17/2016 Android App Distribution Tutorial: From Zero to Google Play Store

https://www.raywenderlich.com/122114/android­app­distribution­tutorial­zero­google­play­store 5/21

Choose a destination folder for your signed APK, specify your Build Type as release, and click Finish.

When the packaging process is complete, Android Studio will notify you that your APK is ready, and let you open it in Finder:

With your APK in hand, it’s time to head to the store.

The Google Play Developer ConsoleTo submit an app to Google Play, you first need a Google Account. Create one here (or sign in, if you already have an account)before going further.

When you are signed into your Google Account, navigate to the Google Play Developer Console. You should see a screen likethis:

9/17/2016 Android App Distribution Tutorial: From Zero to Google Play Store

https://www.raywenderlich.com/122114/android­app­distribution­tutorial­zero­google­play­store 6/21

Agree to the Google Play Developer distribution agreement, pay the one­time $25 Google Developer Registration Fee, thencomplete your Developer Profile on this screen:

With your developer account now registered, your developer console has more options. Click Publish an Android App onGoogle Play to continue.

9/17/2016 Android App Distribution Tutorial: From Zero to Google Play Store

https://www.raywenderlich.com/122114/android­app­distribution­tutorial­zero­google­play­store 7/21

Since this is your first application, you’re given a dialog box to specify the app name and a choice on how to begin. Type in yourapp name and choose Upload APK.

This creates a draft store listing for your app, currently containing nothing except the app title. To begin, click Upload your firstAPK to Production.

9/17/2016 Android App Distribution Tutorial: From Zero to Google Play Store

https://www.raywenderlich.com/122114/android­app­distribution­tutorial­zero­google­play­store 8/21

Choose the APK file you created earlier, and upload it. When the upload is complete, you will see the app listing updated likethis:

Notice that the check mark next to APK is green, indicating that your APK is ready!

Time to move on to the remaining check marks…

Completing the Store Listing

9/17/2016 Android App Distribution Tutorial: From Zero to Google Play Store

https://www.raywenderlich.com/122114/android­app­distribution­tutorial­zero­google­play­store 9/21

Bookmaster General is a pretty simple app, so the rest of the process will be easy. Click on the Store Listing check mark in themenu on the left page and fill in the Short Description and Full Description fields with information about the app:

Note: For your own app, you will want to create as engaging a description as possible, so start thinking about this early in

the development process!

Next, upload at least two screenshots of the app. If you have the app on an Android device, you can simply take screenshotsstraight from the device.

If you prefer to use an emulator for the screenshots, you can easily make these in Android Studio. Build and run the app, thennavigate to the part of the app where you’d like the screenshot.

With the Android Monitor tab opened in Android Studio, click the camera icon on the far left:

Android Studio will present you with the captured image from the emulator. Click Save and select the file location on yoursystem.

Drag these images onto your store listing where you see the following prompt:

9/17/2016 Android App Distribution Tutorial: From Zero to Google Play Store

https://www.raywenderlich.com/122114/android­app­distribution­tutorial­zero­google­play­store 10/21

In addition to screenshots, you need to upload a 512×512 high­resolution version of the app icon and a 1024×500 “featuregraphic” to display at the top of the page. For our sample app, use these resources:

Sample App Icon

Sample Feature Graphic

Complete the store listing by specifying an Application Type, Category, Content rating, and Contact Email. Other fields areoptional.

Scroll back to the top of the store listing and click Save draft. Since the listing is now complete, the Store Listing check mark isnow green. We’re making progress!

Click on the Content Rating check mark to see a description of the upcoming content rating questionnaire.

This questionnaire asks a straightforward series of questions about the content of the app. For those using our sample app,Bookmaster General is in the Reference, News, or Educational category; answer No to all the content questions. If you’re usingyour own app, give the appropriate answers.

Once you are finished, click Save questionnaire, then Calculate rating. You will see the ratings for the various locales whereyour app may be on sale:

9/17/2016 Android App Distribution Tutorial: From Zero to Google Play Store

https://www.raywenderlich.com/122114/android­app­distribution­tutorial­zero­google­play­store 11/21

Scroll to the bottom of the list and click Apply rating. The Content Rating check mark is now green.

Select the Pricing & Distribution check mark for the final step: setting the price of your app, and in which countries it will beavailable. For this example, the app will be free and available universally.

The Free pricing option is selected by default, so keep that choice. Check the box next to SELECT ALL COUNTRIES.

9/17/2016 Android App Distribution Tutorial: From Zero to Google Play Store

https://www.raywenderlich.com/122114/android­app­distribution­tutorial­zero­google­play­store 12/21

Scroll down past the list of countries, and you will find several more distribution options. Check the boxes by Content guidelinesand US export laws to indicate your app’s compliance with relevant rules, then scroll to the top of the page and click Save draft.

With that, the final check box is green, and the Publish app button in the top­right of the console is now active! When you’resatisfied with your app and store listing, go ahead and click it.

Your app listing status now updates to Pending Publication, like this:

It generally takes at least a few hours for your app to be available in Google Play, so go grab some pizza. Eventually you’ll see alisting like this one:

9/17/2016 Android App Distribution Tutorial: From Zero to Google Play Store

https://www.raywenderlich.com/122114/android­app­distribution­tutorial­zero­google­play­store 13/21

Congratulations on your first app in Google Play!

Other Distribution Channels (Optional)While Google Play is the main channel for distribution, you are free to distribute your APK through other means. Consider thissection as a reference in case you want to try one of them.

Unknown SourcesThere is a big caveat to using any method other than Google Play for distributing your app: the users must have the Unknownsources setting enabled on their Android device to allow an APK not from Google Play. Some carriers do not allow this setting tobe turned on at all. More information is available here.

This option is usually available in the Settings app under Security:

Note that, on some devices, there is a rather foreboding message to warn the user of malicious APKs when the user turns onUnknown sources:

9/17/2016 Android App Distribution Tutorial: From Zero to Google Play Store

https://www.raywenderlich.com/122114/android­app­distribution­tutorial­zero­google­play­store 14/21

Just be aware that some users are not going to want to live dangerously.

Amazon AppstoreThe Amazon Appstore is powered by Amazon, registration as a developer is free, and the store is non­exclusive, so you cansubmit your app to both Google Play and the Amazon Appstore.

9/17/2016 Android App Distribution Tutorial: From Zero to Google Play Store

https://www.raywenderlich.com/122114/android­app­distribution­tutorial­zero­google­play­store 15/21

To get started here, navigate to the Amazon developer portal. Create a new Amazon account or sign in with an existing one.

When you first join the developer program, you are asked to verify address and company information for use in your app listings.You also have a developer agreement to accept, and Amazon asks you if you plan to charge money for your apps. If you arepublishing your apps for free, mark that choice and complete your registration. If you do plan to monetize your app, Amazon willask for your financial information.

Once registered, you are returned to an empty Developer Console. Scroll down and click Add a New App.

When asked to choose a platform, choose Android and click Next. You then fill out general information on your app, along withsupport contact information. When finished, click Save to move on.

9/17/2016 Android App Distribution Tutorial: From Zero to Google Play Store

https://www.raywenderlich.com/122114/android­app­distribution­tutorial­zero­google­play­store 16/21

Now you have a listing page for your app. Similar to Google Play, there are several steps to accomplish before the Submit appbutton will become active.

9/17/2016 Android App Distribution Tutorial: From Zero to Google Play Store

https://www.raywenderlich.com/122114/android­app­distribution­tutorial­zero­google­play­store 17/21

First, select Availability & Pricing. Choose Standard app, all countries, free app, and note the date the app was availableelsewhere, if applicable. Then click Save.

9/17/2016 Android App Distribution Tutorial: From Zero to Google Play Store

https://www.raywenderlich.com/122114/android­app­distribution­tutorial­zero­google­play­store 18/21

Next, click the Description tab, fill out the required app description info, and click Save.

9/17/2016 Android App Distribution Tutorial: From Zero to Google Play Store

https://www.raywenderlich.com/122114/android­app­distribution­tutorial­zero­google­play­store 19/21

The contents for Images & Multimedia are mostly already prepared from your Google Play listing, except for a smaller version ofyour app icon. The app screenshot dimensions are more specific here, so you may have to do some resizing. You also needthree app screenshots here instead of the two required by Google Play.

Upload those images and click Save.

The Content Rating tab has a questionnaire similar to the one on Google Play. Supply your answers about any potentiallyobjectionable content and click Save.

Upload your signed APK under the Binary File(s). When the upload finishes, you may get a warning that some older Amazondevices aren’t supported by your app. Click Edit device support to the right of Amazon Fire phones and tablets:

De­select the unsupported devices with warning labels and click OK.

Wrap up by checking the box next to Export Compliance, then click Save.

You’re ready to submit, so scroll down your store listing and click Submit App.

9/17/2016 Android App Distribution Tutorial: From Zero to Google Play Store

https://www.raywenderlich.com/122114/android­app­distribution­tutorial­zero­google­play­store 20/21

If your submission is successful, your store listing will look like this:

Several hours later, pending Amazon approval, your app will be live! Here is the Bookmaster General listing:

HockeyApp and CrashlyticsWhile not app stores, HockeyApp (owned by Microsoft) and Crashlytics (owned by Twitter) are two leading platforms for betatesting. You can easily sign up beta testers and other team members, manage versions, and track app crashes. Each supportsiOS apps, which could make beta testing simpler if you are developing for both platforms.

Note that Google Play also has Alpha and Beta channels built in, so you have several good options for pre­release distribution.

Google Play Private ChannelIf you are already maintaining Google Apps for your organization (Gmail, Google Calendar, Drive, etc), you can create a privatechannel of Google Play for your employees. Then when you publish an Android app, you can make it available only on thisprivate channel instead of to the whole public. See Google Support for more info.

Google App Streaming

9/17/2016 Android App Distribution Tutorial: From Zero to Google Play Store

https://www.raywenderlich.com/122114/android­app­distribution­tutorial­zero­google­play­store 21/21

In a new service, Google is beginning to run versions of mobile apps on virtual machines in Google’s cloud. This means thatusers may be able to “stream” your app’s native content without needing to download your app.

This app streaming is only available on a few launch partners at the moment, but be aware that the trend is coming soon.

Hosting on Your Own Website or Via EmailAs long as users have Unknown sources enabled, you are free to send them your APK file however you like. You can evensimply host the file on your website or send it over email! For instance, even a service like HockeyApp or Crashlytics would betoo much for an extremely early demo meant for a few coworkers, so you can simply email them the APK.

Where to Go From Here?The Google Play Developer Console has several other features, such as teammate invitations and Google Apps keys(necessary for apps that use Google Maps and similar services). You can read about these features and more on the AndroidDeveloper page and the Google Play Developer Help Center.

I hope this Android app distribution tutorial helps you get your apps into the hands of real users! If you have any questions orcomments, please join the forum discussion below.

© Razeware LLC. All rights reserved.

Matt LuedkeOriginally from the Chicago area, Matt is currently a Mobile Engineer at Exygy in SanFrancisco doing iOS and Android development. He's always writing something new on hispersonal blog at mattluedke.com.