Operating System: Windows 7 Ultimate 64 bit
- Download "Java Platform,Standard Edition JDK" (filename: jdk-6u23-windows-i586.exe) from http://www.oracle.com/technetwork/java/javase/downloads/index.html
When asked to select the platform, select "Windows" and not "Windows x64" because we want the 32 bit software and not the 64 bit one eventhough our OS is 64 bit.
No special installation instruction, just keep clicking next on the installation wizard dialog boxes that pop up. - Download "Eclipse IDE for Java Developers" (filename: eclipse-java-helios-SR1-win32.zip) from http://www.eclipse.org/downloads/
Use the 32 bit Eclipse eventhough your OS is 64 bit. - Extract the folder "eclipse" from within eclipse-java-helios-SR1-win32.zip to C:\
Rename this "eclipse" folder to "eclipseandroid" in case you want to distinguish it from other installations of eclipse. - Run C:\eclipseandroid\eclipse.exe
- Rename the workspace path from "C:\Users\Anurag Chugh\workspace" to "C:\Users\Anurag Chugh\androidworkspace" and before pressing "OK" check the box "Use this as the default and do not ask again"
- Close Eclipse. Check the box "Always exit without prompt" before pressing "OK"
- Download "Android SDK Starter Package" (filename: installer_r08-windows.exe") from http://developer.android.com/sdk/index.html
- Install installer_r08-windows.exe. No special installation instruction, just keep clicking next on the installation wizard dialog boxes that pop up. At the end uncheck the box to prevent running the "SDK Manager" before clicking Finish.
- Create shortcut to "C:\eclipseandroid\eclipse.exe" on the Desktop and name it "Eclipse - Android"
- Download "ADT Plugin for Eclipse" (filename: ADT-8.0.1.zip) from http://developer.android.com/sdk/eclipse-adt.html
- Start Eclipse using shortcut placed on the desktop and go to Workbench.
- Click on "Help > Install New Software" .
- Click "Add"
- Click "Archive" and browse to point to "ADT-8.0.1.zip" and install everything related to Android. You will have to accept the license agreement before proceeding.
- Restart Eclipse when asked to do so.
- Close eclipse.
- From "Start Menu", right click "SDK Manager" listed under "Android SDK Tools" and click "Run as Administrator".
- Install all packages listed under "Android Repository". Select "Accept all" Radio button. Internet is required for this step. (takes lots of time to complete)
- If it throws an error, check the "Force https:// to be http://" checkbox listed under SDK Manager "Settings" and try again
- Within SDK Manager, go to Virtual devices and create a new "Android 2.3 - Level 9" Virtual device named "A2.3L9Hello". Set SD card Size to 64 MiB. Close the SDK Manager.
- Start Eclipse.
- Go to Window>Preferences>Android
- Browse for SDK location and make it point to "C:\Program Files (x86)\Android\android-sdk-windows" and click Apply.
- Click OK and come out of the preferences.
- File>New>Project
- Select "Android Project" and click next.
- Project name: HelloWorld
- Build Target: Android 2.3 (API Level 9)
- Application Name: Hello, Android
- Package name: com.example.helloandroid
- Create Activity: HelloAndroid
- Click Finish
- Open HelloWorld>src>com.example.helloandroid>HelloAndroid.java
- Replace all the code in there with:
package com.example.helloandroid; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class HelloAndroid extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); TextView tv = new TextView(this); tv.setText("Hello, Android"); setContentView(tv); } }
- Press the "Run" button (one with "Play" icon on it)
- When asked for a way to run the application select "Android Application"
- Whe asked to "Save Changes" click "Yes"
- Virtual device will boot up (takes lots of time). First textual animation appears and then Graphical Animation appears.
- When the home screen appears, the application will run and display "Hello Android". If it doesn't press the launcher icon on the screen (one with the small square grid on it) and run the "Hello, Android" application by click on its icon.
Explore Further:
http://developer.android.com/resources/tutorials/hello-world.html
Comments
Post a Comment