Click here to Skip to main content
12,448,219 members (46,485 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

10.1K views
9 bookmarked
Posted

Creating a Simple Hello World Android Project

, 5 Aug 2014 CPOL
Rate this:
Please Sign up or sign in to vote.
In this tutorial I will explain about the basic components of an Android application and show you step by step how to create, fix, and test your first android application.

Introduction

This step by step guild is packed full of screen shots to guide you in the journey of creating a simple Hello World application. Ready to code?

Background

This tutorial was made using Windows 8, Eclipse Platform 4.2.2 and the Android ADK 23.0.2.1259578.

Lets learn...

Step 1: Definitions and Basic Components

Minimum SDK = This is how far back you wish to go in regards to the Android OS.

  • You want the minimum SDK to go as far back as possible. Keep in mind if your application uses something introduced into the Android OS version 4.0 or higher, then your minimum needs to be 4.0.

Target SDK = Is the Android OS you have in mind for developing this application

Compile With SDK = Is recommended to be set to the most recent stable SDK in the market.

  • For this you will want to set the compile with SDK to the highest stable Android OS. This is so that your target audience can still use your application if the receive an Android OS update.

The Basic Components are...

Resources...

Step 2: Launch Eclipse

Step 3: Create Project

You can use this public domain image for the next step.

Step 3: Review and Update your application

Lets find out why...

Lets fix it....

You could also change the theme to something compatible or create a custom theme using styles, if you prefer.

The Graphical Layout tab gives you an idea of what the user will see. There are widget tools you can use to create your layout and GUI interface by dragging the items onto the screen.

If you go back to the Graphical Layout tab you will see the string we added string now shows in the GUI layout.

Step 4: prepare the first test

Now enter two more like these to represent Android 4.2.2. Then enter one to represents Android 4.4.2 and an extra large screen.

Step 5: Test on Virtual Android Devices

API 14 Looks good..

Repeat the above steps for AVD Android 4.2.2

API 17 Looks good.

Repeat the above steps for AVD Android 4.4.2

API 19 Looks good...

Step 6: Test on actual Android Devices

Make sure your device has USB Debugging checked in Developer Options, located in Settings. Then plug your android device into your PC or Laptop using its USB cable.

View HelloWorld in both Portrait and Landscape.

Portrait looks good...

Landscape looks good...

Run HelloWorld for one hour to see how the application effects the battery level of your device.

Before for instance, record the starting level. Mine is at 100%.

Run HelloWorld and leave it running.

One hour later, close HelloWorld. Record the level, mine is 97%.

Looks good... No significant loss of battery.

The End!

Points of Interest

While creating this tutorial, I actually started with API 8 and was not aware at the time that my theme selection was incompatible. I had to decide whether to keep the error and fix it in the tutorial, or start over. I decided that I would rather use it as an opportunity to teach the user how to look for and fix this type of issue.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Julie Bartolf
United States United States
No Biography provided

You may also be interested in...

Pro
Pro

Comments and Discussions

 
GeneralThanks for the entry! Pin
Kevin Priddle12-Aug-14 8:52
staffKevin Priddle12-Aug-14 8:52 
GeneralRe: Thanks for the entry! Pin
Julie Bartolf24-Aug-14 8:53
memberJulie Bartolf24-Aug-14 8:53 
Questionhello,I am not clear with this... Pin
cjzsm7-Aug-14 21:23
membercjzsm7-Aug-14 21:23 
AnswerRe: hello,I am not clear with this... Pin
Julie Bartolf24-Aug-14 8:59
memberJulie Bartolf24-Aug-14 8:59 
SuggestionSuggestion Pin
Ranjan.D3-Aug-14 5:28
mvpRanjan.D3-Aug-14 5:28 
GeneralRe: Suggestion Pin
Julie Bartolf5-Aug-14 6:58
memberJulie Bartolf5-Aug-14 6:58 
GeneralRe: Suggestion Pin
Ranjan.D5-Aug-14 7:06
mvpRanjan.D5-Aug-14 7:06 
GeneralRe: Suggestion Pin
Julie Bartolf5-Aug-14 7:28
memberJulie Bartolf5-Aug-14 7:28 
GeneralRe: Suggestion Pin
Julie Bartolf5-Aug-14 7:43
memberJulie Bartolf5-Aug-14 7:43 
GeneralRe: Suggestion Pin
Ranjan.D5-Aug-14 8:17
mvpRanjan.D5-Aug-14 8:17 
GeneralRe: Suggestion Pin
Julie Bartolf5-Aug-14 9:26
memberJulie Bartolf5-Aug-14 9:26 
GeneralRe: Suggestion Pin
Ranjan.D5-Aug-14 9:35
mvpRanjan.D5-Aug-14 9:35 
GeneralRe: Suggestion Pin
Julie Bartolf5-Aug-14 9:43
memberJulie Bartolf5-Aug-14 9:43 
GeneralRe: Suggestion Pin
Ranjan.D5-Aug-14 10:12
mvpRanjan.D5-Aug-14 10:12 
GeneralRe: Suggestion Pin
Julie Bartolf5-Aug-14 10:18
memberJulie Bartolf5-Aug-14 10:18 
GeneralRe: Suggestion Pin
Ranjan.D5-Aug-14 10:28
mvpRanjan.D5-Aug-14 10:28 
GeneralRe: Suggestion Pin
Julie Bartolf5-Aug-14 8:01
memberJulie Bartolf5-Aug-14 8:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160811.3 | Last Updated 5 Aug 2014
Article Copyright 2014 by Julie Bartolf
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid