Saturday, March 16, 2013

How to Create an Android App in Eclipse



1. Click the Windows 'Start' button and type 'eclipse.exe.' Double-click the Eclipse executable that displays in Windows Explorer to start the application.

2. Click the 'File,' then 'New,' then 'Project' menu item. A window opens with several project types. Click 'Android Project' and click 'Next.' The next window displays a list of configurations you must set up before creating the project template.

3. Type a name for your project and choose the Android version you want to target in the list of version numbers. Type a name in the 'Package Name' text box and click 'Finish.' Eclipse creates the template and opens the default code file.

4. Type the following code in the Java source code file to display the 'Hello World' text:TextView view = new TextView(this);view.setText('Hello, World');setContentView(view);

5. Click the 'Run' button to view the new application in the Android emulator. The emulator looks just like an Android phone or tablet. The application runs, and you can see your code results in the working debug emulator window.

No comments:

Post a Comment