This website uses cookies to ensure you get the best experience on our website. OK

How to create your first Android app

Authored by: Deactivated Account — Nov 22, 2013

This article will be the beginning of an AndroidPIT Android Development series.Knowing a programming language already will be very helpful to follow up with the tutorial but it’s not required.

Android development is mainly done in Java, which is the usual language used to teach programming in computer science courses. If you don't know Java but already know another language, you can easily pick up Java along the way.The development environment we're going to use is the new Android Studio which was announced during the latest Google Developer’s Conference (I/O 2013).

Our goal for this week's mini project is to create an app that displays "Hello AndroidPIT" on the screen of your Android device.

© AndroidPIT

First steps

The first thing you need to do is to download Android Studio.

I’ll be using Ubuntu Linux for this tutorial, but you can also use Windows or Mac. You just need to adapt the instructions to your particular situation. Since I don’t use Windows or Mac, unfortunately, I can’t provide you with instructions.

Android Studio is written in Java and you are also going to write in Java for this tutorial so you need to install the Java Development Kit (JDK) also. Follow this link and download the version for your system:

We will deploy your “Hello” app directly into your phone. For that reason, you need to enable USB debugging on your device, which is only available if you have your device in developer mode.

To enable “Developer mode” you need to go to Settings > About phone and tap “Build number” until a toast displays that you're a developer. Then, in the previous screen you'll see a new entry called "Developer options" and there you should enable "USB debugging".

Creating your first Android project

So, assuming that you have already installed Android Studio, let’s create a new project. I’ll use screenshots to make it easier for you to follow up with the steps.

© AndroidPIT

We’re going to name our project HelloAndroidPIT. Module name, Package name and Project Location get filled in automatically and you don’t need to change them.

What we’re going to change is the minimum required SDK to API 15 (Android 4.0.3 IceCreamSandwich). Yes, we’re going to ignore Android 2.3 (API 8) which will hopefully die by mid-2014. I know that currently Android 2.3 still has 26.3% of market share, but I’m confident that it will start dropping very quickly after Christmas. If you want to know more about the percentage of users each Android version has, please consult this page.

Our target SDK will be KitKat and you can choose either Java 6 or 7. Support for Java 7 is very recent and some features are only available if your minimum required SDK is 19. Which won’t happen soon probably.

Since we’re not going to create a custom icon, please uncheck that checkbox.

After pressing next, you’ll see this screen:

© AndroidPIT

Just press Next again and you’ll see another screen…

Ignore all those fields and just press Finish.

After completing these steps, connect your device to your computer, press the green Play button and the auto-generated code should compile, get deployed to your device and run.

Now that the app is running it should display “Hello world”. Saying hello to the world is nice, but we'll say hello to AndroidPIT also.

© AndroidPIT

Hello AndroidPIT

Now, to say hello to AndroidPIT you just need to open the strings.xml file inside your values folder which is found inside your res folder. You should see the string there which says “Hello World!”. Simply change it to Hello AndroidPIT and press Play again.

© AndroidPIT

Localization (L10n)

Localization (usually abbreviated to L10n) is very important nowadays. We're not in the age where software was only available in English anymore, so it's important to know how Android deals with L10n.

Since I'm from Lisbon, Portugal, living in Berlin, Germany but speaking English everyday at the office (yes, German is not easy to learn), we will learn how to say “hello” in all those three languages.

If you look to your values folder in your project you see that there is a strings.xml file there.

To add other languages you just need to add a values folder followed by a dash and the codename of the country to your res folder inside your project, for example: values-pt and values-de. Copy the strings.xml file from the default values folder to each of those two folders and then edit each of those files and replace “Hello AndroidPIT” with “Hallo AndroidPIT” and “Olá AndroidPIT” for German (values-de) and Portuguese (values-pt) respectively.

If you change the language on your device and run the app again, you should see the app translated.

I hope that this tutorial has made you excited to learn about Android development. The next article that I might possibly write will be about displaying how to display AndroidPIT news articles. What do you think about that?

Please let me know if you liked the article in the comments below.

Lead Android Developer


Write new comment:
  • Essa John 3 months ago Link to comment

    This is also a tutorial you can also look into to build your first android app.

    mobilesiri. com /develop-your-first-android-app-using-android-stuido-tutorial/

  • Zest 3 months ago Link to comment

    Brilliant... Thank you for the info

  • Hi,
    nice article and tutorial. This is what I was looking for.
    But I have one issue with Android Studio. Since this guide is little bit older i have Android Studio in and JDK v8.
    When i successfully connect my device to my PC and when i want to run it it ends with 1 error and does nothing.
    Error is :
    Error:Execution failed for task ':app:compileDebugAidl'.
    > aidl is missing

    I couldn't find any solution at stuck or anywhere, reinstallation didn't help either. So if anybody have any solution for my problem i would really appreciate it.

    Thanks for any answer

  • Great tutorial! Since this article was written 7 months ago I wanted to add a few updates that I found while following it however. There is now a JDK version 8 available from oracle at

    The second thing is that the Android Studio download is out of date upon download. This disables access to the SDK Manager initially so if you are following the tutorial in the link you will get stuck there. Go to Configure->Settings and select Updates near the bottom of the left window. Once the update is complete it will ask you to restart Android Studio and once it is up the SDK Manager will be available again.

    Again great tutorial! Can't wait to check out part 2!

  • I keep receiving the same error message, but I can't figure it out what is wrong. Could you help me?
    I have a Windows 8.1 system, 64-bit system type, if it helps.

    Error message bellow:
    Error:Gradle: A problem occurred configuring root project 'HelloAndroidPIT'.
    > Could not resolve all dependencies for configuration ':classpath'.
    > Could not resolve
    Required by:
    > Failed to list versions for
    > Could not list versions using M2 pattern '[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]'.
    > Could not GET ''.
    > Connection reset

  • how to i go to ur second tut now?

  • I agree that tutorials are the best way to learn app creation.
    Website Owner

  • to make app with more feature which program i have to learn???

  • Do Xa Mar 14, 2014 Link to comment

    For the localization part, I advise developers to use an online tool to simplify the translation process. is a good choice in this sense if you ask me.

  • @Ayush Katoch: To connect devices to the Android Development environment see "Using Hardware Devices" at ... Note: Your device may also require special drivers. Check that out too.

  • after clicking on the finish and connecting my phone to the computer nothing happens please help

  • @ifrah A/rahman: The Android Studio link in the article has the information you need to know to install Android Studio.

  • i want to install my laptop android studio is there any things i need before it , but i have already installed my laptop (jdk1.7.0_07) and eclipse java EE IDE and the OS of my laptop is windwos7 so please help me how to install android studio

    • Hi @ifrah, there's nothing else you need to install Android Studio. You simply need to follow the link and hit the "Download Android Studio for Windows" button. There is the following known issue though:

      On some Windows systems, the launcher script does not find where Java is installed. If you encounter this problem, you need to set an environment variable indicating the correct location.
      Select Start menu > Computer > System Properties > Advanced System Properties. Then open Advanced tab > Environment Variables and add a new system variable JAVA_HOME that points to your JDK folder, for example C:\Program Files\Java\jdk1.7.0_21.

  • Is this article missing the screen shot after the "New Project" screen.

    A sentence under that screen says:

    [ Just press Next again and you’ll see this screen… ] {but nothing is here}

    The next sentence I see is:

    [ Ignore all those fields and just press Finish. ]

    After this, you go on to describe the transfer of the app to the android device:

    [ After completing these steps, connect your device to your computer, press the green Play button and the auto-generated code should compile, get deployed to your device and run. ]

    But, nowhere do I see where any code is entered that would have the app say "Hello World!". It seems something is missing from this article. How else does the "Hello World" text get entered into the HelloAndroidPIT app?

    • Hi @Daniel, I've changed the text so the (unnecessary) screenshot isn't referred to. You don't need to worry about those fields so after the first screen just hit next and then Finish.

      As for the ''Hello world'' text, I believe it is a default value in the strings.xml folder. It's there if you click on the strings folder. And you can of course change it to whatever you like.

      • @Kris: Thank you! Very good. Yes, I noticed the "Hello World!" text is part of the sample project source code. All seems well on the Android Studio and PC based VM, but I have not been able to get the APP to go to my devices (One, a Huawei U8800-51 but it is running Android Version 2.2.2, so perhaps it cannot accept the APP. The other device is an HP Slate 7 with Android Version 4.1.1. It does not support OTG cable connections either, so maybe it does not allow transfer of the APP when connected via USB either. Does anyone here at the AndroidPIT know if these could be the reasons for the lack of transfer to the device?

        UPDATE: 03/08/2014 - The connection to my devices now works. I needed to install special drivers for the tablet I am connecting (a Nook Color, but it is usings N2A (Nook to Android) and emulates a Nexus 7). The phone was also now recognized. I actually moved my development environment to a desktop running Ubuntu 13.10. I did some Google searching to find the right drivers for my hardware. Seek, and you shall find!

        After being successful on Ubuntu, I went back to a laptop running Windows 8.1 and was also able to locate drivers that allowed both devices to be connected. The HP Slate 7 Tablet still is not recognized, and that problem is the lack of OTG support in the HP USB interface.

  • 16

    Don't forget to check out the second article in this series:

  • that so much easy from programig with androidapp inventor

Show all comments

This website uses cookies to ensure you get the best experience on our website. More info

Got it!