Download the Android SDK, installer_r11
the SDK. On the second dialog,
it may come up saying it can’t find the JDK or it
is the wrong version. So you may have to “help” it find the latest JDK (e.g., C:
jdk1.6.0_20). You can default on everything else, it doesn’t take long to
. If it doesn’t start,
ook at Control Panel
> Advanced tab
> Environment Variables
> Path. Make sure the path to the
Java SDK bin (e.g.,
bin) is before that for
at for any other path that may have a version of java.exe in it.
Install all the packages from Android SDK Manager
. This can take awhile (
hour or so).
Install the nbandroid plugin for NetBeans:
> Settings Tab, Click Add
In Dialog, Leave “Check for updates …” Check. Put Name:
Go to the Available Plugins tab, clic
checkbox for Android and click Install
Proceed through the installation
it will say it is not trusted, that’s OK.
eans where the
> Miscellaneous, choose Android Tab, Browse to where you
installed it, e.g.,
and click OK
Start a new Android Project: File
> New Project, Choose Android and Android Project
me, Location as you do for Java programs
Set as Main Project
Choose an Activity Name (name
Activity when installed
Choose a Package Name
(like Java packages, use dotted name: xxx.yyy
Choose an Android Platform.
Try Android 2.2.
It is easy to change it and rebuild
Hello World App
Open the Java Source Code for your Activity
dd the import:
Modify the OnCreate method and replace the setContentView line with:
TextView tv = new TextView(this);
Build it: Run
> Build Main Project
e a Simulator
(Android Virtual Device)
Start the Android SDK Manager
Choose Virtual Devices and click New
Pick a Name, like MyDevice_2_2 and a Target
, like Android 2.2.
Default on rest and click “Create AVD”
Run your program on the virtual device
eans, select Run
> Run Main Project
If you have more than one AVD, it will ask you to choose one
It may take
awhile (maybe a few minutes)
, but the AVD should eventually come
up and be ready for use.
Run the App as you would from the real device
your program on the real device
, no debugging
I was able to do this on the Archos 43. I could not do it on the Xoom. In
particular, Xoom has no Windows Explorer equivalent. I read some web postings
that indicate there
an App you could get t
something like Explorer, but not
sure if it would let you browse to a file and install it.
So I was able to go through
step f for the Xoom, but could not do step g.
On the Device, go to Settings
>Development and make sure
ing in NOT checked
Connect your device to your computer via USB. It should mount like a drive.
On your PC, browse to your NetBeans project folder,
then to its bin folder
Copy the .APK file (NOT the unaligned one) to somewhere on the Android. You
a new folder like Temp if you want.
Disconnect the USB
Browse on the device to where you put it the APK file, tap it, and install it.
Then Open it to run it.
Debugging your program using NetBeans on the real device
I was able to do this for the Xoom but
not the Archos 43. There is a special
firmware version for development on the Archos at the following, but I did not try
and not sure it would even work for the Archos 43
Download any special Windows drivers
to allow a debugging connection. For the
the Motorola USB Driver 5.0 from
On the Device, go to
> Applications and enable Unknown sources. Go
>Development and check USB debugging
. For the
Xoom, Settings is under “Device Administration”.
Connect the Xoom via USB to the PC. When the “Found New Hardware” wizard
ignore it for now. From the start menu on the PC,
> Motorola Drivers
> Motorola Driver Installer. Select Update
Drivers. When it gets done, cancel out of the “Found New Hardware” wizard.
You can check if thi
s works by using a CMD prompt, going to
tools and running
. The device
should appear (hex number and the word device).
Note that every time you
connect after this, it will probably come up with t
he “Found New Hardware”
wizard. Just cancel out. Not sure how to get rid of this. I assume it wants to also
install another driver. As long as “adb devices” shows this device, it should be
Go to NetBeans and run the project. The App should appea
r on the Xoom.
Note: We probably want to get the files from above and put them at: