Android Studio

From NoskeWiki
Jump to navigation Jump to search


NOTE: This page is a daughter page of: Android

Android Studio is the official IDE for Google's Android development. I first started using it properly in 2020. It's pretty bloated software, but here's what I've learnt so far in the context of making and releasing an actual Android App. My plan is to write down and tips and tricks... anything that isn't intuitive.

Create Accounts

  • Download Andrew Studio.
  • You need to create an account with Google Play Console - which is $25 a year, but that's a bargain versus Apple.
  • If you wish to collect payment, also create a Google Payments Center account and customer money can't get to you until you provide a tax file number etc.

Testing on an Emulator

  • Go through any tutorial for Android Studio.
  • Click "Tools > AVD Manager" > add a Pixel 3 or any other emulator.
  • Restart and there should be a play button with an option for your emulator... and it will just open!

AVD Manager

Testing on your Real Phone

Hopefully all that is required is that you enable your Android phone into "USB debugging" mode, then connect to your computer with a USB cable. To get USB debugging.... Go Settings > About > and click the build number ~10 times to unlock Developer Mode... then Search for "Developer options" and scroll down and tick "USB debugging". Now plug your phone to your computer and hopefully the play button will list your real life device. Fingers crossed! :)

Run button up top. Hope it works for you!

Creating a Signed Bundle or APK

To actually release your app you need a "signed bundle". Honestly, I am very flakey, because Pavel (mentioned below) helped me with this, but I'll try to link in some good instructions. The process involves you creating a "Key store path" which saves passwords and so on that you enter. Write them down somewhere... I still don't know if you need a new one for each app.

Run button up top. Hope it works for you!

Language Choice

People usually think of Android in Java, but you can also use Kotlin.... see Kotlin vs Java and "Kotlin is now Google’s preferred language for Android app development (may 2019)".

Clear Cache

Certain database changes might cause your emulator to crash. Ouchie! Best bet is to clear the cache:

  1. Go "Tools > AVD Manager".
  2. Select the dropdown for you emulator and click "Wipe Data"
  3. When you log in you'll have to config it all again, but your app should work again.

NOTE: change JSON in the app - you need to change content your original.json file (eg: android_app\app\src\main\res\raw) - remove previous version, or increase database version in the AppDatabase.kt file.

Update an App

See: How to Update an App in the Google Play Developer Console.

  1. Log into the Google Play Developer Console.
  2. Locate your app in the app choices.
  3. Click on 'Release Management' > then 'App Releases'.
  4. To upload a new .APK file, click on 'Manage Production', then 'Create Release'.
  5. Drag and drop the new .APK file into the 'APKs to add' section. You'll notice that the previous APK version will become deactivated. This is normal.
  6. The release name will automatically update to the next appropriate version. For "What's new in the release?" you can put "Bug Fixes and Feature Enhancements".
  7. Click 'Save', then 'Review' to proceed.
  8. Finally, review the release information on the next screen. Then scroll down to the bottom and click 'Start Rollout to Production'.

Acknowledgements: The amazing Pavel Tkachov who has been helping me to release my first app. Almost always I've learned new systems myself, but in the case my friend Matt convinced me to reach out to Pavel to help me make it right... and save my many hours of time. Pavel is an amazing developer and gets the job done!