Eclipse is the recommended IDE (Integrated Development Environment) for Android applications. In Eclipse, you can create your first Android app in a few straightforward steps. The IDE automates certain aspects of the development process. Eclipse also provides developers with the means to export and test apps on virtual devices. To create an Android app in Eclipse, you will need to use both Java and XML coding. Anyone with basic familiarity with both of these languages should be able to create an Android app using Eclipse.
- Skill level:
Other People Are Reading
Create a new project. Open Eclipse. Create a new project in your Eclipse workspace by selecting "File," "New," "Project." In the New Project wizard, open the "Android" folder in the list. You can choose a normal project, a sample project, a test project or a project using existing code. For a project you plan on exporting as a final Android app, choose "Android Application Project" and click "Next."
Select your project details. The "New Android Application" window will guide you through the process of choosing properties for your Android app. In the first screen you can choose application, project and package names, as well as target and minimum SDK (Software Development Kit) versions required on devices to run your app. In the second screen, you can choose to create a custom launcher icon for your app and to create an Activity for it. Select the check-boxes to let Eclipse create an Activity for you and to create your project in the Workspace. When selecting an Activity type for your app, choose "New Blank Activity" for a basic app screen. Finally, choose file names for your Activity class and layout then click "Finish" to create your Android project.
Browse and edit your project files. When you create a new Android project in Eclipse, it adds your project to the Package Explorer view. In the Package Explorer, which displays to the left of your Eclipse window, scroll down to your new project and expand the folders within it. The Java code for your app's main Activity class, which represents the screen that will display on running the app, can be found in the "src" folder, under the package name you chose when creating the project. The Activity "onCreate" method includes processing to display the app screen. The layout file lies in the "res/layout" folder, using XML code to define the Activity appearance. You can carry out edits to these files as necessary or can leave them the way the are to begin with.
Start the emulator. Your Android app will run with the default content created by Eclipse, so you can execute it on an Android emulator straight away. In Eclipse, select "Window" then "Android Virtual Device Manager" to start running a virtual device with the Android platform on it. If there are no virtual devices listed yet, choose "New" to create one. To run a virtual device, select it in the list and choose "Start."
Run your app. Once you have a virtual device running, or an actual device connected to your computer via USB, you can run your app. In Eclipse, select "Run" then "Run Configurations." After you run the app once, it will appear in the list. To run it for the first time, select "Android Application" and click the "New Launch Configuration" button at the top left. Click the "Browse" button and choose your new app. To run your app, select "Run." You can set your run configurations to automatically select an Android device to run the app on or to let you choose one from a list.
Tips and warnings
- In Eclipse, you can export your Android apps for release in Google Play.
- Before you launch an Android app to users, thorough testing is vital, as the Android platform runs on many different types of device running many different versions of the operating system.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for