Building and Run First Android Apps

When you are thinking that building an android application seems a hard task to do, I would say no. Android provided IDE that really help us to code and create an apps well. Using android studio, we will be guided to follow step. In this writing, I give step by step to create an application from beginning selecting SDK until you can produce APK.

First step, create you project. File -> New -> New Project. You can name customize application name and company domain that finally to re-name you android package application. Then, you will need to set up minimum API for target device. I suggest you to pick the lowest API as you can, because it will affect how your application can be installed. As development of API, currently Oreo is the most updated one, but you still to make sure Android with older API can install the apps, so that the apps can be suitable for more devices and users. Setting the higher minimum API will reduce potential users.

SDK Target Device

Then choose the layout activity you want. If you want to create an apps with login, choose the login. If you want it to have drawer like Grab, choose Navigation Drawer activity. Or if you want an apps that contains bottom layout menu, like Instagram, choose Bottom Navigation Activity. There are many type of activity that can be picked as you wish. Choosing the activity that really fit with your dream design will make coding easier. In this writing, I chose the Basic Activity. You can rename the files before finishing set up, but you can do it later. No worries. Building an apps with IDE make us easier. You don’t need to code, it will create application by itself.

There are at least 3 files you need to understand if you are beginner. Those files with extension MainActivity.java, content_layout.xml, and AndroidManifest.xml. Java files is for logic. You write methods here. You create service, call layout, call API, etc. While, xml file is a place to put design code. In simply, if you want to adjust heigh of your button, you write code here. You can drag and drop components here and see the preview before run apps. AndroidManifest.xml is a place to register your activity that call layout if you don’t want application crash. Android Studio has amazing tools. You will put less effort with auto-generate function.

content main layout

For beginning, just try to change text “Hello World” on your content_layout.xml to “Hello Indonesia”, then run your code. When first time, you will be asked to select deployment target to run application. You can create virtual machine or you just connect your phone to laptop.

When successfully build android application, we will find file .apk. This APK file is used to installed somewhere else.

apk

Happy coding!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s