World Cup in Russia was a scintillating affair; this made me write a simple app about the lesser known facts for the world cup. You can download this app if you soccer-mad like me, however, the main thing is learning the ropes step-by-step on how to deploy an Android app on Google Play Store.
ProGuard is an open source optimizer for Java bytecode.
Did you know that log methods can affect the performance of an app? The developers need to take care of them but not by manually removing log calls. This is where the mighty ProGuard comes into play. ProGuard is a tool that shrinks, optimizes and obfuscates Java code.
Shrinking makes your Java and Android apps up to 90% smaller for faster download and speedy install times so as to reach users on lower-end devices, especially in emerging markets. There are even some situations when you are required to limit your app size, such as the 4MB limit for Instant Apps, for which ProGuard can prove indispensable.
Optimization is the removal of all unused code that you otherwise ship with your APK as part of the classes.dex file. Less code means shorter compilation times and less storage use.
ProGuard also provides protection against reverse engineering by obfuscating the names of classes, fields, and methods. Name obfuscation technique consists in replacing the names of classes, fields, methods, and resources with meaningless unreadable characters that make the code more difficult to read and interpret.
Apps can be reverse-engineered using tools such as Apktool, dex2jar, dexdump, Jadx, JD-GUI, CFR, and Procyon. These tools are used to dump the executable code and, in some cases, reconstruct the source code. Once an attacker has retrieved the source code, he is able to steal parts of it, extract valuable information from it or modify it.
The Android SDK comes with ProGuard included as well as default settings file which are specified as proguard-android.txt. There’s a lot we can do with the ProGuard tool. To do this, we need to change two files: the build.gradle file and Proguard Rules.
Make the following changes for build.gradle(Module:app) on the buildTypes block.
Make the following changes for proguard-rules.pro file.
Remember to sync the changes by pressing the Sync Button on Android Studio.
Generate Signed APK
It is time for signing app digitally and good thing there’s a wizard built into Android Studio that makes digital signing and exporting the app easy.
When we build our App in Android studio, it creates an executable file with .apk extension(Android Application Package). When testing the app in Andriod Studio, this APK file is already digitally signed with something called a debug certificate.
The debug certificate allows us to run the app on an emulator or on a test device. Debug Certificate is not an official certificate and the APK file cannot be uploaded to an app store like Google Play when compiled with the debug certificate. Every Android app needs to be digitally signed to help protect end users from Malicious Software or Malware.
To publish on Play Store, we need a real certificate – the release certificate. Signing app digitally guarantees that the app is from us and prevents the bad guys from impersonating us or publishing apps under our name.
On the studio with your app project open start by clicking Build>Generate Signed APK . The rest of the procedure is summarized on the below slideshow.
Select APK which takes to a dialogue as shown on the above slideshow. If you’re doing this for the first time select Create new to build a keystore, but in future select Choose existing…. .
The key store holds the private digital key that we need to sign all of our apps. We need to use the same key store to sign any updates to the same app.
Now, for different apps we could generate a new key store for each app but the recommended approach is to create one key store for yourself or your organization and then sign all of your apps with that same key store.
Choose a destination for the keystore and give the .jks name. Enter a secure password and the confirm it. Enter an alias or a name for the key we want to create in this key store. You can use the same password or a different one. Be sure to remember the password and the Key Store path.
Next enter the number of years that this key should be valid. We want this certificate to be valid as long as our app is in existence, I went with 25 years but you can add more.
Click next which will take you to another window. The apk Destination Folder is where the APK file will be generated and it is going to be in our app module. For Build Type click the downward arrow and select release to ensure the app will execute when installed from Google Play.
Signature Version is a new signing mechanism introduced in Android 7.0 with additional features designed to make the APK signature more secure. You can check both checkboxes but it is not mandatory, I left V2 unchecked because of problems I ran into previously.Click Finish, and wait for the gradle to run.
A message is displayed at the right bottom corner meaning a successful build, a location for the generated APK location is also is displayed.
On project view there is a new file which is the generated APK. Make a mental note of the location as we are going to upload this file from here.You can also click locate to navigate and copy the path to the APK file
Google Play Console
This is the main page where we add, manage and publish our Google Play apps.
We need to open an account with Google before publishing an app. There is $25.00 one-off setup fee of USD 25 to ensure that guys aren’t just signing up for free for the sake of it and later upload some crappy apps to the Play Store.
Head over to Google Play Site to open an account if you already don’t have one. You will need a gmail email address for this. When signed in scroll down to read and accept developer agreement then proceed to payment. Lastly, make sure our developer information is correct.
From here things can be very confusing but luckly there is video to make it crystal clear courtesy of Nace a top rate mobile developer. Check it out below.
Once you click the Create Application you will be directed to Store listing menu to input the following details:
- Title and language of your app
- Description – short and full description for your app
- Graphic Assets – We need to add at least 2 Screen shots, a 512 X 512 Alpha PNG Icon and 1024 * 500 (no Alpha )Feature Graphic. You can us programs like Gimp or Photoshop to create these images. You can ignore the tablet, Android TV and Android Wear OS if your app doesn’t support them.
- Promo Video – you can supply the URL of your YouTube video. I downloaded and used Screen Record app to record a short video of the screenshot which then I posted on YouTube.
- Categorization – this is app type and where it relates e.g. Business, education
- Contact details – phone number, website, email address is a must have
This is where you upload the generated APK file from the save destination. Click Manage>Create Release>Continue>Browse the APK file location>Upload.The APK file takes a few seconds to upload.
- Confirm your email address
- App Category – Choose where your app falls fall
- Content Rating Questionnaire – answer the questionnaire honestly and accurately then save the questionnaire
- Lastly calculate and apply the rating
Pricing and Distribution
- Decide whether the app will be free or whether it is for sale
- Manage the app availability across the globe
- Ads – click “Yes, it has Ads” if you have AdSense account
- Read and accept the Content Guidelines and US Export Laws
If you plan on selling apps, providing in-app purchases, or providing subscriptions, then you will also need a Google Wallet Merchant Account. If you make any revenue on Google Play, you as the developer gets 70% of the revenue while Google will take 30%. That’s the same split as both Apple and Amazon. Once you set you app to be free you cannot later change this.
Once the pricing is done your app is ready for publishing, you will be prompted to manage the release. Simply click Manage Production> Edit Release>Review>Start Roll Out to Production> Confirm.
Well done, your app will now become available for download in about 2 hours. Don’t forget to let your friends know.