How to Make Android Apps: A Start to Finish Guide

android tricksBelieve it or not, thousands of people around the world are making a full-time income creating Android apps. You might not think you are capable of joining this elite group of programmers and developers. Fortunately, you can! New technology has made creating Android apps easier than ever – even if you don’t have prior programming experience. That’s not to say you don’t need some programming knowledge, but you definitely don’t need to spend years in school to become the next great Android developer.

In this guide, you will learn how to create the development environment you need to create apps, some basic code and how to bring your creations to market. Although you will learn some code below, it’s helpful to understand some basic concepts about Java (the language of Android). Nothing crazy – but just enough to get a general idea. Check out the Introduction to Java Training Course if you really want to jumpstart your Android app creation skills.

What is Android Anyway?

Even though you are probably really excited about getting started, you should at least understand what Android is and why it is one of the best mobile operating systems available. After all, you can’t truly devote your time to a project unless you are confident in the platform.

A product of the Open Handset Alliance, Android was first introduced to the public in 2007. You may recall that this was the same year Apple unveiled the first iPhone for commercial production. Android, Inc. was a Google-backed company that was ultimately acquired by the search engine giant in 2005.

The Open Handset Alliance is a large group consisting of many mobile service providers and handset manufacturers around the world.

Unlike competitors such as iOS (Apple), Android is a completely open-source mobile operating system based on the Linux kernel and released under the Apache license. The code is freely available and can be modified by wireless handset manufacturers as necessary to create custom mobile solutions.

Some of the largest distributors of Android-powered handsets include Samsung, HTC and LG. There are many other companies also relying on the Android platform to create mobile phone and tablet solutions under a variety of brand names (many created and manufactured in China).

Although Android started as an alternative mobile OS targeting the smartphone market specifically, the lineup has expanded to include a full assortment of tablets and laptop-type devices. Android has certainly grown to show its versatility across various hardware configurations thanks to significant advancements in both the Android framework and mobile processors including the QualComm SnapDragon series and the Samsung Exynos chipset.

The great thing about developing your own Android apps is that Android is not limited to mobile phones. Tablets, laptops and even some desktops are powered by Android and you can create apps for all of them. This diversity can lead to an increased market for your app and potentially higher profits as well.

OK, so now that you are better acquainted with the OS, it’s time to start developing your own apps!

Getting Started

Before you can start creating your own Android apps, you need to set up your computer properly. Don’t worry – it’s free and doesn’t take very long! These instructions are for Windows computers, but the process is very similar for Mac and Linux. If you have any questions, the Android Software Development Kit (SDK) has a Help section that should answer most of your questions.

You can also check out Android Development for Beginners for an overview of what’s required to setup the Android SDK on your computer.

First, you need to install the Java Development Kit (JDK). Your computer probably already has the Java Runtime Environment (JRE), but the JDK is also required to compile your Android apps.

You can download the latest version of the JDK from Oracle’s Java website. Installation is straightforward and should only take you a few minutes. Further information and the download link can be found at http://www.oracle.com/technetwork/java/javase/downloads/index.html.

With the JDK installed, the next step is to install the Android SDK. The SDK is freely available from http://developer.android.com/sdk/index.html. Just make sure to download the correct version for your OS. Once the SDK Manager has been downloaded, you can proceed with installing the various packages required to create your own Android apps.

The developer.android.com site provides countless resources including installation instructions, tutorials and sample projects you can complete as your skill level progresses.

The nice thing about the Android SDK is that it is completely modular. Once you have downloaded the initial package, you can choose which versions of Android you want to develop for. For instance, you if you want to create applications that work with Android 2.3 and up, make sure you download the Android 2.3 package.

Android applications are always forward-compatible, but not always backward compatible. Keep this in mind when you start developing because some new features in Android 4.3 are not compatible with older software versions. This limits your potential customer-base (which is extremely important if you plan to make money from your applications).

At this point, you have a couple of choices for development. To get the most flexibility out of Android development (with a steeper learning curve), you can install an Integrated Development Environment, or IDE. One of the most popular IDEs for Android development is called Eclipse. You can download Eclipse from http://www.eclipse.org. Since Eclipse is written in Java, it does not need to be installed on your computer. Simply double-click on the .JAR file and Eclipse will load automatically.

This IDE is excellent as a standalone Java development tool but the developers of Eclipse have integrated Android development seamlessly using a plugin called the Android Development Tool (ADT).

To install ADT, open Eclipse and go to Help > Install New Software and then click Available Software > Add Remote Site. In the dialog that appears, enter the following URL:

https://dl-ssl.google.com/android/eclipse/

Although this web URL works for most users, if you do experience problems, try removing the “s” in https to complete the download process. For some reason, the SSL path does not always work, but you should definitely use the secure connection if you computer allows it.

Another popular IDE, NetBeans, also has a similar toolset known as the nbandroid plugin. For the purposes of this tutorial, you will be using Eclipse to create new Android projects. You can learn more about using Eclipse in Java Programming with Eclipse.

This next step isn’t required to start making applications, but it will come in handy during the testing phase. The Android SDK Manager makes creating an Android Virtual Device (AVD) very easy. You can create multiple AVDs and see how your applications perform on an Android device without actually having an Android device.

This is a powerful tool that really makes development easy. You can make a simple change and within seconds, see how that change affected your application. Even if you have an Android device, it’s a good idea to create a couple AVDs to test your app’s performance on a variety of Android-powered hardware.

You can set the screen size of your virtual device to practically anything you want but try to keep it reasonably so you can see how your app looks on a wide variety of devices. There are quite a few other settings you can adjust on your AVD including what version of Android is installed and whether or not the AVD has an SD card installed.

Again, this step is not required to start creating Android apps, but since you are already configuring everything anyway, you might as well get it done now because you will need it after you have written an app and want to see it in action.

Android Programming Basics

Android has always attempted to foster a strong development environment. After all, good developers who are confident in the platform are the key to innovation. Becoming a Google developer is simple and requires a one-time setup fee of $25 (good for an unlimited number of app submissions). One of the most attractive aspects of creating Android apps is how quickly they are available for sale after submission.

Typically, apps are available for purchase and download within hours of submission. A submission to the Apple App Store, for instance, can take 4-6 weeks (or longer) for approval before becoming available to consumers. In such a highly-competitive app marketplace, this time-to-market differential is significant.

You will learn more about the app submission process later in this guide, but it’s important to understand why Android is probably the best platform for creating best-selling applications since you have now chosen it as your development platform of choice.

The Android programming language is actually a set of Java APIs. You already have the JRE and JDK installed on your computer so you are all set there. As previously mentioned, a basic understanding of Java principles also helps. Java Fundamentals I & II is a great place to start.

Although Android is Java-based, there are a few differences that even experienced Java developers may not be familiar with. Android programming is broken up into four components that work together to create every functional application. They include:

  • Activities – An Activity represents any single screen with a user interface on an Android device. For instance, an email application would have an activity that displays new emails, another designed to compose new emails and another activity for reading mail. This is an important component of Android because although these activities all work together, they are separate processes. This means that another application can start an activity (with permission). A good example of this idea in action is a camera application that can open the email app to attach a photo to a new email automatically.

  • Services – A Service does not have a user interface and is specifically designed to handle long-running operations. Typical Services include a service that plays music in the background and background data synchronization. This component allows the OS to perform these functions while the user is performing other tasks on the device.

  • Content Provider – A Content Provider manages a shared set of data across applications. Data can be stored directly in the file system of the device, in a separate SQLite database, on the Web or in any other persistent data location. The default Contacts application built into Android has a Content Provider that can share contact information with other applications. This is how social media apps like Facebook can sync with existing contact information (and how contacts are automatically backed up to Google servers).

  • Broadcast Receiver – Broadcast Receivers respond to system-wide announcements. Although many of these announcements are generated by Android (such as screen off or battery low), Broadcast Receivers can also be generated by user-installed applications. Although Broadcast Receivers usually don’t do much work, they are responsible for starting services or activities as needed to provide a smooth user experience. Broadcast Receivers are also commonly used to implement many app widgets placed on the homescreen.

Remember that one of the most powerful parts of Android from a development standpoint is that you can reuse existing code to create functional applications quickly. For instance, if your app needs GPS data, you don’t need to write the code for implementing GPS. Instead, you simply need to call the existing GPS framework inherent to Android for use in your application. Using the camera, SQLite databases and 3D graphics rendering are all just as easy. Even novice developers can start creating useful application without extensive training or experience.

You can learn more about creating your own Android applications in Android App Development Fundamentals I.

Creating Your First App

Once you have your development environment completely setup and ready to go, it’s time to create your first app. Sticking with tradition, your first app is going to be the venerable “Hello World” app. Although this app is very simple to create, it’s important because it familiarizes you with many Eclipse features and tests your development environment to make sure everything has been installed and configured correctly.

Although many of the components discussed in the previous section are not present in the Hello World application, you will have a much better understanding of basic Android principles by completing this exercise.

After you have successfully created and compiled Hello World, you will learn about some other techniques including a way to start creating 2D games without any programming experience. Although it may be tempting to skip to that section, every good Android developer knows how to code at least a basic application from scratch and you are no exception.

Don’t forget to check out Learn by Doing – Android for Beginners for a solid overview of Android basics in an easy-to-follow format.

To create Hello World, start by opening Eclipse and clicking New from the toolbar. In the dialog box that opens, you need to fill out the information for your application. The fields are as follows:

  • Application Name – This is the app name that appears to your end-users. For this project, make the Application Name “Hello World.”

  • Project Name – This is the working name of your project within Eclipse. Type HelloWorld into this field.

  • Package Name – The Package Name is used to differentiate your app from millions of others in the Google Play Store. For this app, you can use com.example.helloworld but for applications you choose to release to the public, Google won’t allow the com.example package name. You can use the inverse of your web domain (com.yourdomain.helloworld) or your last name or business name (com.yourname.helloworld). The idea is that the package name has to be completely unique among all published applications.

  • Minimum Required SDK – You can specify the lowest version of Android supported by your application. To ensure your app is accessible to the highest number of people, keep this set to the default setting (currently Froyo 2.2).

  • Target SDK – This is the highest version of Android your application has been tested with. As new versions of Android are released, you should test your application and update the API whenever possible to keep your app current. You can set this to whatever setting you want, but remember that Android 4.4 (the latest release) is currently only available on a few devices so maybe set it to 4.1 or 4.2 for now.

  • Compile With – This setting tells Eclipse how to compile your application. By default, it should be set to the latest version of Android (if this is not available, download the API using the Android SDK Manager).

  • Theme – This setting specifies the Android UI that will be used by default for your application. You can leave this setting alone for now but feel free to experiment with it as your skill level progresses.

Click Next to confirm these settings. The following screen shows additional settings for your app. You can leave all these settings at their default values and click Next again to continue. Another screen helps you create an Icon for your app. For now, leave this alone but remember that a real app needs an appropriate Icon. You can learn more about creating Icons for your apps in the official Android Iconography guide available at http://developer.android.com/design/style/iconography.html.

The final screen in the setup of your application is the Activity dialog box. For Hello World, you can choose BlankActivity and click Next. Leave all the default settings for this activity alone and click Finish.

OK…so now all that is out of the way and you can actually code your app! Although many of the steps you just went through seemed rather tedious, the dialog boxes are very important when creating Android applications. In fact, many of the files your app needs to run properly were automatically created during the project creation phase of Eclipse.

Now you should find yourself in the Workroom of your Hello World project. Along the left side of the window you will see the Package Explorer. Navigate to the BlankActivity you created which should have been named MainActivity.java by default. Double-click on this file to open it and you are ready to start coding!

Below you will find the code needed to create your first Hello World application. Some of the code should already be in your MainActivity.java file so just add the missing pieces to complete the application.

package com.example.helloworld;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class MainActivity extends Activity {

                       @Override
                       protected void onCreate(Bundle savedInstanceState) {
                                        super.onCreate(savedInstanceState);

       TextView text = new TextView(this);
       text.setText(“Hello Android – Thanks for Using Udemy!”);
       setContentView(text);
              }

}

That’s it! Your app is now ready to be compiled and run on a real device or the AVD you created earlier.

Running Your App on a Real Android Device or Using AVD

Installing your app on an actual Android device isn’t hard, but you do need to make sure you have the appropriate drivers installed for the device. On a Windows machine, these drivers are often installed automatically but make sure they are installed correctly so Eclipse can recognize the device.

If you need additional help installing the proper drivers for your test device, please consult the official Android OEM USB Driver document at http://developer.android.com/tools/extras/oem-usb.html.

Also make sure the device has USB Debugging enabled. On most Android devices, this setting can be found in Settings > Applications > Development. On some of the newer devices equipped with Android 4.2 or above, the Developer options are hidden. To unlock these settings, go to Settings > About Phone and tap on Build Number seven times to unlock the Developer options and make sure USB Debugging is enabled.

With your device plugged into the computer, click Run in Eclipse and select Android Application from the Run As menu. Eclipse will automatically install the app and it should be located in the App Drawer of the test device under “Hello World.”

Click on the app to run the Activity and your screen should display the message you typed early on a white background and the name of your app should appear on the top (right below the status bar).

The process for running your app on an AVD is just as simple. When Eclipse detects a physical device attached, it will automatically install the Android app to the device. If no device is present, it will automatically install to your default AVD. Of course, you need to create at least one AVD (which is why this process was covered earlier) before Eclipse can use this device for testing and debugging.

This is a very simple app but it shares its structure with more complex apps. The Android Manifest, Java source files and other package components are the same in your app and the more complex ones you will go on to create in the future.

Feel free to experiment with the code in this tutorial. Its very easy to create a button that displays the message when pressed. You can learn more about using ActionListeners to create this type of effect in Android Programming Tutorial Videos for Beginners.

Other Ways to Create Android Apps

So writing code from scratch isn’t your thing? Or maybe you want to get your feet wet before you invest in learning all the Java code required to make complex, useful apps. Either way, coding from scratch isn’t the only way to start creating Android apps right now.

One of the most popular methods is a game engine known as GameSalad. This program is designed for both novice programmers and experienced developers. The best part is that you do not need any code to create functional 2D games quickly and easily.

The drawback to using GameSalad is that the program is only designed to create games. Productivity apps can be created using another popular (and free) IDE know as the MIT App Inventor. This tool exposes you to some Android programming while using an intuitive drag-and-drop interface that anyone can use. In fact, App Inventor is often used in classrooms to teach children how to program in a fun and interactive way.

You can download GameSalad from http://gamesalad.com/ and the App Inventor is a cloud-based application available at http://appinventor.mit.edu/.

What’s great about both these options is that you do not need to study programming before creating apps. You learn as you go and create more complex applications as your experience allows. That said, you do lose some of the control you might have when using Eclipse to create applications from scratch. Both methods have benefits and most developers find that a combined approach is usually most effective.

For example, many experienced game developers code their games from scratch (or using various other game engines) but design the initial concept using GameSalad. Don’t think GameSalad is incapable of producing decent games – you can create awesome 2D games using this platform exclusively.

Below, you will find brief descriptions of each platform so you can start using them now to create professional looking games and apps.

Getting Started with GameSalad

Again using a Windows machine, download the GameSalad Creator from the GameSalad website. GameSalad is free to use but they also offer a Pro version for $299. This version provides additional benefits including in-app purchasing models and publication to the Android platform. When you’re first getting started, however, there’s no need to purchase the Pro license. Only consider upgrading to Pro once you have completed an application you actually want to publish.

GameSalad requires that your computer has the Android SDK installed as well as the Google USB drivers. Sound familiar? Since you should already have this done, you can download GameSalad and you are ready to go.

Since GameSalad was originally designed for OS X, it is not able to emulate Android devices for testing. You will actually install your game directly to an Android phone for testing and debugging. Once again, you should be familiar with this concept from the Eclipse portion of this tutorial.

You can learn more about setting up and using GameSalad in the Introduction to Mobile Games Development course.

Creating a Game with GameSalad

GameSalad is unique because it provides multiple templates to create games quickly. Although using templates is not required, it makes development easier when you are inexperienced since most of the work has already been done. Templates are included for basic Shooter games, Pong style games, and a cross-platform controller compatible with both iOS and Android.

If you choose not to use the templates, you can create games from scratch. Most game features can be done within the drag-and-drop interface of GameSalad so having a foundation in Android programming is helpful. Learn Android from Scratch is a comprehensive course about manually programming in Android ‒ a skill that will be useful as you become more adept as an Android game developer using GameSalad, Eclipse or the App Inventor.

GameSalad also provides a Marketplace where game assets can be downloaded (sprites, backgrounds, etc.).  You can even create your own assets using Photoshop.  Learn how to create assets in Foundations of Photoshop.

Another unique aspect of GameSalad is that games can also be exported to other platforms. Your game can easily be compiled for iOS or Flash. This means that you could potentially triple the profit potential of your app by releasing it on multiple platforms. Just keep in mind that the submission procedures for each platform are extremely different and not as easy (or fast) as a Google Play Store submission.

Getting Started with MIT App Inventor

The App Inventor makes it easy for anyone to create useful Android applications. Although not required to start creating apps, you will pick up Java as you use the App Inventor. The program provides you with a “drag-and-drop” interface with GUI (Graphical User Interface) elements that are preconfigured with necessary coding for most functions. As you become more experienced, you can customize this code to create fully functional applications that are 100% unique.

Just because it may seem simple to create apps with App Inventor, there is a lot you can do with this program. App Inventor has tons of advanced features that you can use to create complex, completely functional applications as your experience grows. The App Inventor is open source which means new plug-ins and add-ons are constantly being created. It could very well become one of the primary app development tools of 2014 and beyond.

At this time, the App Inventor requires an Internet connection to function. All projects are stored in the cloud via your Google account. You can create a Google account for free if you don’t have one already.

In fact, Gmail is one of the best email clients available and you can learn to maximize the product by becoming a Gmail Master. An added benefit of using the cloud storage model is that you can access your applications from anywhere assuming you have Web access.

This could be a huge benefit as your app development continues to grow and you are working on multiple projects simultaneously.

App Inventor has a built-in emulator. This allows you to test out features in real time on a simulated Android device without actually having to compile the application and install it on a smartphone or tablet. This is even easier than creating an AVD in Eclipse!

Android Apps in 1 Hour: No Coding Required teaches you how to use the App Inventor quickly and effectively.

Publishing Your Application in Google Play

Whether you chose to use Eclipse to create your application from scratch or one of the other solutions mentioned in this tutorial, the next step is to publish your application in the Google Play Store. After all, isn’t that the whole point of creating an app in the first place?

No matter what platform you created your application on, the first thing you need to do before publishing your work is to create a Google Developer account. This is a one-time cost of $25 and lets you submit as many apps as you want to the Play Store.

Make sure you have a compiled .apk file. You cannot upload your project files to the Play Store so make sure your program is compiled and tested before uploading. Once the .apk is uploaded, it goes through a short approval process before being released to the public. This process usually only takes a couple of hours.

When you upload your application, Google will ask you what release number your application is. You should start with 1.0 or something similar. That way, you can update your application and Google will automatically pinpoint users who do not have the latest version. As a general rule, minor updates would be 1.1, 1.2, etc. while major updates might be 2.0, 3.0, etc. The exact numbering convention you follow is not important but make sure it is coherent to you and your users.

Remember that you also have to set a price for your application. Especially when you are first starting out, consider offering your application for free. You can always add advertisements to your app and generate some income that way or you can offer customers in-app purchasing options. Google has made in-app purchases very simple and GameSalad can integrate it automatically (if you have the Pro version).

You might decide to offer your app for a small fee. $0.99 seems to be the magic number when it comes to apps but it’s not unheard of to find apps that cost $20 or more. The pricing you choose depends on the app you have designed and how much you think customers are willing to pay for it. It is difficult to get people to pay for a new app from a new developer, so offering it for free (at least initially) might be a good business move.

The fallacy of the programming world is that you need a fancy degree in computer programming to create games that actually create profit. Although creating your own apps using Eclipse is not very difficult once you get the basics down, the introduction of GameSalad and App Inventor have made it even easier to create functional, professional looking applications that can be distributed throughout the world courtesy of the Google Play Store and the Android platform.

This tutorial contains a lot of information. You have learned how to use three different platforms to create Android applications quickly and easily. The point of showing all three is because many novice developers do not know multiple options exist. There are many ways to create Android applications successfully. One method is not better than another, but each platform has distinct advantages and disadvantages. As your experience grows, you will probably find yourself using a combination of all three techniques to create the next best-selling application.

No matter what option (or combination) you choose, you can start developing your own applications right now – even if you don’t have any previous experience.