Wednesday, February 26, 2014

How to Use Android SDK



1. Click the Windows 'Start' button, and type 'eclipse.exe' in the search menu. The Eclipse program does not have an installer, so there is no menu shortcut. After the operating system finds the file, double-click the EXE to open the program.

2. Click the 'Windows' menu item, then click the 'Android SDK and AVD Manager' item. A window opens with a list of virtual devices. A virtual device is an emulator that displays an Android device window, so you can test your Android apps for bugs. Click the 'New' button, then choose the Android SDK version you want to use. Click 'OK' to create the virtual device.

3. Click the Eclipse 'File' menu item, then click 'New,' then 'Project.' The opened window lets you create a new Android project, which contains all of your Android code files. Click 'Android Application' for the project type, then enter the basic information for your project. The required setup information is the project name, Android version and the activity name. Click 'OK,' and Eclipse opens to your project work space.

4. Open your main Android app file. The left navigation window is the 'Package Explorer' window. This panel displays all of your project code. A default Java class is created by Eclipse. Double-click the '.java' file in the left panel. Eclipse opens the source code in a Java editor.

5. Create your first Android app. Add the following code to your Java file:super.onCreate(savedInstanceState);TextView tv = new TextView(this);tv.setText('Hello, World');setContentView(tv);

6. Click the 'Run' button at the top of your Window. The code compiles and the new app displays in the Android SDK emulator. Notice the layout uses the standard Android buttons and text, which you can customize in the future. The emulator works in the same way a handheld or tablet functions. In this example, 'Hello World' displays in the emulator.

No comments:

Post a Comment