Posted by : Unknown Sunday, July 21, 2013



Hi again! Now I am going to make sure everything installed works by building my first Android app. It will be a simple app which will display “Hello Android” in the screen. Let’s get started! I launched Eclipse to start a new Android project. To start a new Android project in Eclipse, you can select File from the menu and then select New -> Other or just click the New icon in the toolbar. I clicked the New icon in the toolbar. The New window will appear to create a new project. The Android Application Project can be found in the Android folder. Select Android Application Project and click Next.  

Eclipse New Project
After clicking Next, the New Android Application window appears.

Eclipse New Android Application


The New Android Application window has the following fields:
  •          Application Name: This is the name of the application that will appear in the Play Store. This name will also appear in the Manage Application list in Settings.
  •          Project Name: This is the name of the Android project that will appear in Eclipse. It can be the same name of the application but it must be unique within the workspace.
  •          Package Name: This is the name of the application package. It follows the same rules as packages in the Java programming language. The name chosen must be a unique identifier across all packages installed on the Android system. It must stay the same for the lifetime of the application and it is typically the reverse domain name of your organization plus one or more application identifiers.
  •          Minimum Required SDK: This field is the lowest version of Android that the application will support. This is indicated by the API level. Lower API levels can support more devices, but fewer features are available. This should be set to the lowest version available that allows your application to provide all of its features, so the application can support as many devices as possible.
  •          Target SDK: This field is the highest version of Android in which your application was tested and known to work with.
  •          Compile With: This field is set by default to the latest version of Android available in your SDK. Setting this field to the latest version will enable new features for the latest devices. It is the target API against which you will compile the application.
  •          Theme: This is the base Android UI theme to use for the application.


For my application, I chose the following and clicked Next:
  •          Application Name: Hello Android
  •          Project Name: HelloAndroid
  •          Package name: com.android.helloandroid
  •          Minimum Required SDK: API 8: Android 2.2 (Froyo)
  •          Target SDK: API 17: Android 4.2 (Jelly Bean)
  •          Compile With: API 17: Android 4.2 (Jelly Bean)
  •          Theme: Holo Light with Dark Action Bar

On the next window, I left the default values and clicked Next. The following window lets you configure the launcher icon. 

Eclipse Configure Launcher Icon

You can browse for an image file, select clipart, or enter text to use as launcher icon. As you are customizing your icon, you can see the icon it generates for all screen densities on the right side of the window. For my application, I chose:
  •          Foreground: default image file
  •          Selected trim surrounding blank space
  •          Additional Padding: 13%
  •          Foreground Scaling: Crop
  •          Shape: Square
  •          Background Color: Black

After I was done configuring launcher icon, I clicked Next. On the following window, select Blank Activity and click Next. 

Eclipse Create Activity


The new window that appears has three fields which will let you enter an activity name, a layout name, and navigation type for the activity. I left the fields on their default value and clicked Finish. 

Eclipse Blank Activity


After Eclipse creates the new Android project, you should have a new directory with the name of the project which you chose. You can see this on the left side of Eclipse on the Package Explorer. The package name which you chose should be seen in the src folder. In the package, you should find the MainActivity class.

Eclipse IDE
We are done creating the new Android application project! If you have any questions feel free to leave a comment. I will do my best to help you. On my next post, I will run the application.




Leave a Reply

      

Followers

Powered by Blogger.

Translate

Google Search

Support Blog

- Copyright © Learning Android Development -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -