Monday, February 18, 2013
How to Program Androids for Beginners
1. Open a Web browser and download the Android SDK for your computer. The installer sets up the Android development environment, and creates an emulator you use to test your programs.
2. Open a second browser tab and download the Eclipse software from the company's official website. Eclipse does not have an installer. Instead, extract the zip file contents to a directory such as 'C:\Eclipse' to store the files. You use 'eclipse.exe' to run the software.
3. Double-click the 'eclipse.exe' file downloaded in step two to start the programming environment. Click the 'File' menu item in Eclipse and click 'New,' then 'Project.' The 'New Project' wizard opens in which you configure your Android SDK project.
4. Click 'Android Project' in the list of project types, then click 'Next.' In the next screen, choose the Android version you want to target and type a name for your new project. Click 'Finish,' and Eclipse sets up your new Android project setup.
5. Double-click the 'src' folder to open a list of Java source code files. In the beginning of your project, only one Java source code file is listed. Double-click the file to open the source code.
6. Add some code to the main Java source code file. For instance, the following code displays a message to your users:TextView helloView = new TextView(this);
helloView.setText('Hello Android World');
setContentView(helloView);
7. Click the Eclipse 'Save' button to save the code changes. Click the 'Run' button to view the new project in the Eclipse emulator. The emulator looks like an Android cell phone or tablet. Click your project name to see the message displayed in the emulator.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment