- Download JDK (jdk-6u18-windows-x64.exe)
- Install JDK to C:\Java\jdk1.6.0_18
- Install JRE to C:\Program Files\Java\jre6
- Download Ant (apache-ant-1.8.0-bin.zip)
- Unzip to C:\Java\apache-ant-1.8.0
- Add C:\Java\apache-ant-1.8.0\bin to PATH env var
- Set env var JAVA_HOME=C:\Java\jdk1.6.0_18
- Set env var ANT_HOME=C:\Java\apache-ant-1.8.0
- Download Android SDK (android-sdk_r05-windows.zip)
- Unzip to C:\android-sdk-windows
- Add C:\android-sdk-windows\tools to PATH env var
- Install Android SDK components
- Run C:\android-sdk-windows\tools\SDK Setup.exe
- Install Install Android 2.1, docs, usb driver, Android 2.1 SDK and docs
- Add Android Virtual Device (AVD) called "MyVirtualAndroid"
- Install USB driver
- Use Device Manager -> Nexus One -> Update driver
- Browse to C:\android-sdk-windows\usb_driver (enable recursive search)
- Create Android project
- Open cmd prompt in new empty project folder (e.g. C:\Dev\Android\Hello)
- Type "android list targets" and see what id number the Android 2.1 target is (1)
- Type "android create project --target 1 --name MyAndroidApp --path . --activity MyAndroidActivity --package com.example.myandroid"
- Check that the folder now contains a bunch of new files and sub-folders
- Compile
- From the project folder, compile with "ant debug" (signed with debug key) or "ant release" (unsigned and will not run on the device until it's been signed)
- Run on emulator
- Launch emulator with "emulator -avd MyVirtualAndroid"
- Install app with "adb install -r bin\MyAndroidApp-debug.apk"
- May have to run it twice if the daemon wasn't running
- You can check if the daemon is running by typing "adb root" or "adb devices"
- Launch app within the emulator (should show up as an app icon)
- Run on Android device
- Connect Nexus One via USB cable
- On the device: Settings -> Applications -> Development -> Enable debugging
- Verify connection by typing "adb devices"
- Make sure the attached device is the only one in the list (close the emulator if it's running)
- Install app on device: "adb -d install -r bin\MyAndroidApp-debug.apk"
- Launch app on device (shows up as a regular app icon)
Have fun!
JDK <- ewww! I can't get over that step. I need to find a phone where I can code straight in C. :)
ReplyDeleteJDK is for the tools Android SDK. You can code in straight C with the NDK. :)
ReplyDeleteI like your blog performance.This is one of the popular post.Thanks for your support.Your blog is providing good entertainment.Nice post.Android app developers
ReplyDelete