Thinc. First Code Android (Part I: Setting up & First glimpse of Android Studio)

Samuraiwarm
Thinc.
Published in
4 min readSep 29, 2018

Hi everyone! If you’re reading this, welcome to Android! I will be guiding you to the process of being an Android developer. It might take a while to set up Android Studio, and a few GB of disk space.

I will be going pretty slowly in every steps for everyone. If you think that you can try to do something on your own, it’s fine! If you have any questions or getting stuck on anything, feel free to ask in the comment section! (^▽^)/

First up

⚠️ Note: As of September 2018, Android Studio has finally released version 3.2, so please re-download and re-install if you still have version 3.1.4 or lower.

⏬ Download Android Studio here. You may want to check the system requirements at the bottom of that page.

If you don’t have any Android devices, you may want to install Android Virtual Devices plugin (which I will discuss in the later part I.5). You can also run your app in Bluestacks or other emulators, but additional setup is needed.

📓 Extra note: Bluestacks have Android version 7 (Nougat) Most emulators have Android version 4.4 (KitKat), so it may be hard to test your app in different products.

After this page, you can change your directory as you wish. Wait for it to install for a while, and you’re done! (Actually, nope 🍭)

Startup page (wow such doge much terminal https://pypi.org/project/doge/)

Creating your very first project

Developing Android mainly uses Java, but I really recommend you to use Kotlin instead. Kotlin can make your code shorter, easier to read, and potentially safer when dealing with Threads (which I won’t cover for now).

📔 See more here for differences between Java and Kotlin.

more doge

Android has a different API level depending on different devices. The only major improvements and library updates are 15 -> 16 and 19 -> 21. For simple apps, you can choose API 16 (Jelly Bean 4.1).

Here you can choose your very first page in the app, but for a very fresh start, I will choose Empty Activity.

Here you don’t need to change anything else. You should check the Backwards Compatibility for supporting older versions (if possible).

After that, wait for a few seconds to minutes to create a fresh new app. 🎉

Program interface

Interface of Android Studio. Background image by this.

After creating your app, it will take a while to index all the files. The program may ask you to install the Gradle plugins and/or SDK (Software Development Kit) as a popup/tab in the bottom right panel. Please install that as well.

Project tab. The most common file directories are shown.

Let’s go to the layout file in activity_main.xml.

Layout file
If you don’t have this bug, you can skip this.

🐛 If you can’t see the Hello World screen like this and has an error here saying Render Problem, try changing the App Theme to anything that works (trial and error). Above here it is set to AppTheme by default and it works just fine. If nothing else works, go to the second build.gradle file, then change the dependencies in the file as follows:

dependencies {
...
/*from this
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
(or 28.0.0)
*/
//to this
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
...
}

If you can see the file just fine, you can see the Palette box containing objects you can try. You can explore them for now, and there will be a walkthrough on the very first app in the next part. Good luck!

🔗 Extra links

--

--