- Advertisement -

So, after quite some time since the Android workshop I attended, only now, after Raya my very busy student life filled with assignments and exams has cleared (barely, there are some left), I will be showing you the very first and basic steps to start building your very own android app and how to successfully execute in on your Android device. Before beginning, please understand that this tutorial will only teach you how to get started, compile and test your app. Right now, a modern solution is way more advanced than conventional app development, there are android builder applications that speed up the entire development workflow.

First thing first, you will need the following softwares installed:

Oracle Java SDK 6
Android SDK/ADT bundle

Assuming you have successfully installed the both softwares listed above, I will just show you which applications you will have to run inside the SDK bundle you’ve just downloaded. First of all, for this tutorial, I will refer this folder(adt-bundle-windows-x86_64-20130522) as “root”. This is your SDK bundle.

2013-08-08 18_13_03-Program Manager

Now, in root, open up “SDK Manager.exe” and make sure you install of the following sub-packages.

Now, you will have to establish a connection to your Android device in order to download, run and test the application. I prefer to test on the actual device since the emulator is pretty laggy for me. Make sure all of the correct drivers are installed first. These drivers are model/brand specific so, contact or search for it on Google. For example if you are using Samsung, download the KIES suite. If you are using Asus, download ASUS Sync, and the the list goes on.

After installing the drivers, open up a command prompt pointing to root/sdk/platform-tools. For the sake of this tutorial, here is how you do it, navigate that path, hold shift while right clicking and select “Open command window here”.

After opening the command prompt, type this: “adb devices”. A list of attached and detected Android devices should show up. If your device was not detected then try rechecking the drivers again.

If you want to use the Emulator instead, we will get to that later since we have to launch the emulator inside the programming software itself.

Once you have all of the following packages installed and got your Android device connected, now we can start the programming software itself. We will be using Eclipse that was included inside the SDK bundle. It is located at root/eclipse/eclipse.exe

A window will pop up, now select or rename the folder or directory of your choice. This is where all the resources and everything related to the project will be stored. Later on, when you are resuming the project, you will just have to open up this directory.

First of all, we have to specify everything about your new app from the name to the icons. Head over to File>New>Android Application Project

Here you can see all of the specs for your new Android application. You have to fill in the application name, project name and package name. For the package name, you have to fill in something like a web domain but in reverse. If you have your own domain then just fill in like so: com.[domain].[appname]. For me, I use NLT’s domain. You can choose any theme you want. For the minimum target, depends on how and what features you will use. This will become clear later on when you get to the programming part of the application.

Note that you can actually change these during or after the development of your Android app. If you’ve published it on the app store, any changes done to the application can be rolled out as an update.

Next, just follow the settings in the picture below for this tutorial.

Now you are going to choose the icons for your new application. There are various sizes in which corresponds to various pixel density  across Android devices. The icon is going to be represented in the same size but due to higher ends devices such as the Nexus which have a high pixel density, it requires a higher resolution icon to make it look sharper and nicer.
The icon is not necessarily a picture. It can be a text or you can also use the provided clip art.

The last part of the initialization process is to create an activity. For this tutorial, we will be using the ‘blank activity’. You should definitely experiment with the other options later on.

Now your design interface should appear. This is where all of your design(obviously) comes to place. The mechanics is quite simple, you can just choose whatever you want on the left side and execute the drag and drop maneuver. The programming part will take place later when you would like to give that object a function and connect it with other things such as a memory or a database.

If you are ever lost or in doubt such as the toolbar is missing, you could always go to Window>Reset Perspective

If you click on an object, there will be a ‘Properties’ box on the right side of the screen. This is where you will give the object it’s name and other characteristics. For this tutorial, I’ve altered a “Text Box”‘s Hint. Hint is the faded text that appears on the textbox before you click it.

Remember that this layout of yours have a code counterpart. If you’ve noticed, there is a tab on the middle 3/4 down that says “Graphical Layout” and “Activity_Main.xml”. This is the place where you can manipulate your designs directly using codes with high level of flexibility. If you are familiar with Visual Studio, the codes will make sense but if you are a beginner then you could try and experimenting with the code and see what changes and start to move on from there but mostly it is in plain English so I guess it is not that hard to understand.

The programming part is in Java so you will have to learn the basics of Java first before you can start programming on your first app. To access the Java code, just navigate to the Page Explorer on the left hand side of the screen and go to MainActivity.java as shown in the picture below.

This is a small piece of a functioning Java code. What it does it that if the button is pressed, it will compare the string entered inside the text box. If the string matches, it will direct me into a second activity. Which to give you the idea, the first activity acts like some kind of a login screen.
Main activity is the main screen. Second activity is the second screen. You get the idea.

Now, the last part is to see if your app works as intended. There are two ways to do this. One is to compile and upload directly onto your connected Android device and the other is to run the app on the official emulator. Since we’ve covered on how to do it on your physical device in the beginning, here is how you do it on an emulator. However, for those who are using a physical device, you may skip the emulator setup part and jump over to the part where we select the device and send the compiled app to be tested as the testing process is identical as  if you are using a physical or emulated device.

Click the icon beside the “JAVA” button on the top right corner of the interface. A window should pop up called “Open Perspective”. Now choose “DDMS” and click OK. Click on the “Virtual Device Manager” icon on the top bar as shown.

Click on “NEW” button to create a new android virtual device and choose any device you would like to simulate.  Choose the android version along with any other setting you prefer.

Press Start… to start your emulator.

For the last part, here is where you test the app. 

Click on the Play icon and select the “Android Application” option to run the app as an Android Application on your device and select the appropriate device. If you are using an emulator, your device will appear on the selection list as well.

That is the bare basic on how to use the Android SDK. I hope this tutorial will give you an initial push on developing your own application for Android devices. Maybe if you have mastered the Java language, you could also write application for other devices as well.


Like our Facebook Page here at NasiLemakTech.com for more news and in-depth reviews! Also, join our Facebook Group for insightful information and memes!

Subscribe to our YouTube channel too!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.