The best way to make sure you configured your development environment correctly is to take an existing Android application and run it. You can do this easily by using one of the sample applications provided as part of the Android SDK in the /samples subdirectory.
Within the Android SDK sample applications, you can find a classic game called Snake. To build and run the Snake application, you must create a new Android project in your Eclipse workspace, create an appropriate Android Virtual Device (AVD) profile, and configure a launch configuration for that project. After you have everything set up correctly, you can build the application and run it on the Android emulator or an Android device.
Adding the Snake Application to a Project in Your Eclipse Workspace
The first thing you need to do is add the Snake project to your Eclipse workspace. To do this, follow these steps:
Creating a new Android project.
Creating an Android Virtual Device (AVD) for Your Snake Project
The next step is to create an AVD that describes what type of device you want to emulate when running the Snake application. This AVD profile describes what type of device you want the emulator to simulate, including which Android platform to support. You can specify different screen sizes and orientations, and you can specify whether the emulator has an SD card and, if it does, what capacity the card is.
The Snake project details.
The Snake project files.
For the purposes of this example, an AVD for the default installation of Android 2.2 suffices. Here are the steps to create a basic AVD:
Your project settings will look like the following figure.
Creating a Launch Configuration for Your Snake Project
Next, you must create a launch configuration in Eclipse to configure under what circumstances the Snake application builds and launches. The launch configuration is where you configure the emulator options to use and the entry point for your application.
Creating a new AVD in Eclipse.
You can create Run Configurations and Debug Configurations separately, each with different options. These configurations are created under the Run menu in Eclipse (Run, Run Configurations and Run, Debug Configurations).
Follow these steps to create a basic Run Configuration for the Snake application:
You can set other options on the Target and Common tabs, but for now we are leaving the defaults as they are.
Running the Snake Application in the Android Emulator
Now you can run the Snake application using the following steps:
The Snake project launch configuration, Target tab with the AVD selected.
You can interact with the Snake application through the emulator and play the game. You can also launch the Snake application from the Application drawer at any time by clicking on its application icon.
Setting Up Your Android Development Environment
Writing Your First Android Application
Understanding The Anatomy Of An Android Application
Defining Your Application Using The Android Manifest File
Managing Application Resources
Exploring User Interface Screen Elements
Designing User Interfaces With Layouts
Drawing And Working With Animation
Using Android Data And Storage Apis
Sharing Data Between Applications With Content Providers
Using Android Networking Apis
Using Android Web Apis
Using Location-based Services (lbs) Apis
Using Android Multimedia Apis
Using Android Telephony Apis
Using Android 3d Graphics With Opengl Es
Using The Android Ndk
Using Android’s Optional Hardware Apis
Working With Notifications
Working With Services
Extending Android Application Reach
Managing User Accounts And Synchronizing User Data
Handling Advanced User Input
Targeting Different Device Configurations And Languages
The Mobile Software Development Process
Designing And Developing Bulletproof Android Applications
Testing Android Applications
Selling Your Android Application
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.