Navigate / search

How to setup Netbeans for Android development

When Google released the Android open mobile platform, they have made an Eclipse plugin to be able to develop Android software using the Eclipse IDE. If you’re a Netbeans user, don’t worry because you can use Netbeans for creating Android applications also. Several guys created a Netbeans plugin that makes it possible to do Android software development under Netbeans.

android-and-netbeans

To start setting up Android development under Netbeans, just open up your Netbeans 6.5 IDE. After starting up, click on the Tools | Plugin from the menu and select the Settings tab from the dialog box. Click on the Add button and enter the Name of the plugin and update URL for the plugin your are manually adding. You can put any text for the Name field, the plugin update URL for the Android for Netbeans plugin is http://kenai.com/downloads/nbandroid/updates.xml .

Update: New update url for downloading the plugin is now http://kenai.com/downloads/nbandroid/updatecenter/updates.xml – Thanks pop.

android-netbeans-install-01

After clicking on Ok, it should now be included in the list of configured update centers.

android-netbeans-install-02

Go to the “Availalble Plugins” tab and you should see Android in the list. Click on the checkbox to mark it for installation. Then click the “Ok” button.

android-netbeans-install-03

You’ll get a dialog box similar to the one below informing you that the Android plugin will be installed. Click on the “Next” button.

android-netbeans-install-04

The license agreement will be displayed. You need to agree to to install the Android plugin. Click on the “Install” button once you have clicked on the “I accept..” checkbox.

android-netbeans-install-05

It should start download the Android plugin.

android-netbeans-install-06

After the download, you’ll get a message similar to the one below. It basically says that the plugin hasn’t been signed by the Netbeans group. This serves as a warning for potentially dangerous plugins. If you trust the developers of the plugin, just click on the “Continue” button.

android-netbeans-install-07

After which, you should get an “Installation completed successfully” message.

android-netbeans-install-08

Now that the Android plugin for Netbeans has been installed, you need to do just one more step to configure it. You need to tell Netbeans that it can now also setup projects for the Android open mobile platform. To do this, click on the Tools | Java Platform menu of your Netbeans IDE.

android-netbeans-install-09

Click on the “Add Platform” button. Select the “Google Android Open Handheld Platform” and click the “Next” button.

android-netbeans-install-10

Now locate where you have extracted the Android SDK on your computer and click “Next”.

android-netbeans-install-11

Give the platform a name. I think “Android” would be appropriate and click on the “Finish” button.

android-netbeans-install-12

You should now have added Android in your list of supported platforms for the Netbeans IDE.

android-netbeans-install-13

That’s it. You can now start developing Android applications using your Netbeans IDE. I’ll post about writing an Android application in Netbeans next time.

Gerry Ilagan

Gerry Ilagan is into mobile apps and WordPress development at @speeqs. He loves to write about electronics, the Internet of Things, mobile phones, and #crazyideas.

Comments

Deb
Reply

Thanks Gerry. Let me check this out now.

Adil
Reply

Thanx a bunch gerry!

Abhay
Reply

Thanks Buddy……
Was sucked by using the Eclipse….
Now, I can show off using NetBeans..

Prasad
Reply

thx a lot………!!!
i successfully installed it but…

when i run my project i don’t get any device to select…
do u know abt the same…?

gerry
Reply

Hi Prasad, haven’t encountered that problem.

cs.lev
Reply

Prasad, you need to create a AVD!
To do that type this into a console:
android create avd –target 2 –name my_avd

This will create you an AVD called my_avd. If you don’t have this command “android”, you have to link that into the Global PATH variable, or change your directory to your sdk/tools lib and then give the command!

cs.lev
Reply

I’ve got another problem. Everything works fine. my emulator boots up and I can use it but I’m not able to build Activities…my netbeans says:
Device’s package manager not ready to install new packages

Anyone help?
Thx

Tyler
Reply

That’s Great, let’s start android 🙂
Thanks

Mark
Reply

Everything works fine for me until I get to this step:

Now locate where you have extracted the Android SDK on your computer and click “Next”.

I get a message saying “a platform target has to be selected”. I note that the directory structure where I unzipped the SDK does not look like what’s in your screen shot.

I’m using nb 6.7.1 and Android SDK 1.5 I downloaded today.

Can you help?

Mark
Reply

Nevermind.

I think perhaps I missed a step when installing the Androind SDK… using the android tool to actually download and install it.

chuck
Reply

I received the error ” … Device’s package manager not ready to install new packages” for every Android app I tried. Was working fine yesterday…

I cleared up some RAM (closed a few other things like Opera, etc) and suddenly the error disappeared.

Try that (clearing some RAM).

chuck

Yogi
Reply

Hi all

I have a problem ,i cant add the android platform to my netbeans , the next button is not enabled after i choose the android platform .please help me

Joe
Reply

Yogi: add platforms using android sdk tool. C:Downloadsandroid-sdk_r04-windowsandroid-sdk-windows”SDK Setup.exe”

Jamie
Reply

I had the same problem while selecting the platform where it says ‘a platform target has to be selected’, but shows no targets to select. After installing the docs for android though, it worked fine.

Vic
Reply

How exactly do you install the Android docs?

Dave
Reply

Anyone follow up on adding platform target? I’m in same state as Yogi.

Thanks-

raqz
Reply

thanks buddy..it worked…you are the man

John
Reply

To add the platform, you have to go to the directory (in netbeans as the picture above), but then go one directory further to the platform directory of the directory of the android sdk, then select the android platform. (2.1 is an example). This will then pull up another screen that shows the android platform and google api. Click finish.

Java.Snake
Reply

Hi all,

Before you all do these steps above, be sure to install Android SDK first in a folder of your desire. After that do all thoes steps…when you are about to choose the platform and nothing apears to choose from, even if you have selected the Android SDK instalation folder and you click “next” and nothing apears.
Try this, worked for me:

– Close your netbeans IDE ( btw mine is 6.8 )
– If that doesnt work reboot your computer.

Why reboot computer? Dunno lol
I have done all the steps above and when i was to choose the platform nothing a apeared…well i was sleepy and i shutdown the IDE and the computer. Next day, right about now while im writting to you :p i tryed to do the final step ( choosing the platform ) and voilá platforms apeared 🙂

Hope this was usefull to you.

Cheers

Java.Snake
Reply

By the way i forgot to add that, before i shutdown my computer, i did something that i dont know if its relevant. At the screen where u press the button “addPlatform” manually i added to the source paths, the path to my android SDK installation folder.

Ib
Reply

thanks a million.

fivechiemera
Reply

Definitely install the Android SDK first. Preferably not with NetBeans running at the time. That’s what tripped me up. (I was gonna say “bit me,” before I realized that “Java.Snake” was the one who provided the suggestion [grin].)

Thanks, all! Can’t wait to play with my new toy!

PW
Reply

Hi,

any suggestions for how to build a netbeans/android project with existing sources?
it is a shame that the nbandroid plugin doesn’t provide this option…

Thanks!

gerry
Reply

You can trying asking for help by posting to the nbandroid forum.

Android and NetBeans « Life and Tech
Reply

[…] NetBeans to develop my first Android app. Among the first few search results I found this article How to setup Netbeans for Android development and it worked the magic. Even though the above mentioned post was written for NetBeans 6.5 it works […]

Binu
Reply

You gave me a smooth start into Android with Netbeans, Thanks Gerry!

ritesh
Reply

hey gerry,
Actually i m a biginer…so which IDE shud i use either netbeans or eclipse????

gerry
Reply

If you’re going to use Android, I’d suggest that you use Eclipse since it’s the IDE that Google supports for Android development.

ahmed akl
Reply

thanks very much
i really need it

Guillomal373
Reply

Hey man im trying to do my hello world app on netbeans, but when i hit the run button a window shows and it says “Select Device”, and i dont even have one device to start on, help me thanks

Bhavi
Reply

Thanks a lot Gerry…
I m fresher for Android n i cudnt find scratch from where i can start…thanks again…

Take Care 🙂

Evan
Reply

Thank you. Guide was clear and concise. Worked first time. Eclipse seems to suck the heart out of my Mac Book Pro.

Cheers 🙂

gerry
Reply

You’re welcome, evan.

Kenshiro
Reply

++ man! awsome!

Carlos
Reply

Hi all,

I have done all the steps, and it all works fine. but when I try to run the application it throws an error saying this:

Created dir: C:Documents and SettingsAntonioCMy DocumentsNetBeansProjectsAndroidApplication1dist
=C:Documents was unexpected at this time.
C:Documents and SettingsAntonioCMy DocumentsNetBeansProjectsAndroidApplication1nbprojectbuild-impl.xml:411: exec returned: 255
BUILD FAILED (total time: 3 seconds)

I am using netbeans 9.1

Please someone help me on that.

Thanks in advance

neel
Reply

Thnks a lot……….

Sajid
Reply

Thanks a lot frnd…..
I really need this instructions…..
I configured my Netbean…..
Thanks Again.

Sebastian
Reply

After Selecting the platform and clicking on “Finish” the platform is NOT added to the list.

There is no error message or output.

I am a little bit desparate now. Any ideas?

Ian Merriman
Reply

It does not like the spaces in the directory names E.g. “My Documents”

Try moving the NetBeans project to somewhere like:
C:NetBeansProjectsAndroidApplication

and then re-build the project. Hopefully it will then build without errors.

Ian

>>Hi all,

I have done all the steps, and it all works fine. but when I try to run the application it throws an error saying this:

Created dir: C:Documents and SettingsAntonioCMy DocumentsNetBeansProjectsAndroidApplication1dist
=C:Documents was unexpected at this time.
C:Documents and SettingsAntonioCMy DocumentsNetBeansProjectsAndroidApplication1nbprojectbuild-impl.xml:411: exec returned: 255
BUILD FAILED (total time: 3 seconds)

I am using netbeans 9.1

Please someone help me on that.

Thanks in advance

iwombat
Reply

I’m stuck on the adding platform as well. I’ve installed the sdk w/ the installation tool and followed all the advice above, but still can not get the set-up wizard to recognize that I’ve selected a platform.

Netbeans 6.8 – On Mac, Windows, and Linux. No joy.

Daniel Tebar
Reply

Hi,

I’m getting a : “THIS TOOL IS DEPRECATED.” message when running Android in Netbeans…

Any suggestions?

–Daniel Tebar

Gfortune
Reply

thanks a lot Gerry.
Android with netbeans it’s must esier than eclipse.

gerry
Reply

You’re welcome

Adnan
Reply

This was really nice share…
it help me so much

primus
Reply

After Selecting the platform and clicking on “Finish” the platform is NOT added to the list.

There is no error message or output.

I am a little bit desparate now. Any ideas?

netbeans 6.8
nbandroid-0.11

Shuaib
Reply

After doing all I just cant find android when i start a new project.please help

liumin
Reply

thank you very very very very very very much!~~~~~~~~
I really need it.

Zeus
Reply

After Selecting the platform and clicking on “Finish” the platform is NOT added to the list.

why???
please Help me. thanks

im use.
netbeans 6.9.1
nbandroid-0.11

Rajiv
Reply

Thanks man, without you i would you have been dead…

Keith
Reply

I just downloaded Netbeans 6.9 with a view to getting started with some android development. However, I found that I could not get past adding the platform folder in the wizard. Just realised what the problem was though, I did not have the Java ME enabled in the plug ins, once I did that I was able to complete the wizard.

Anyway thought this might help somebody, in hindsight it seems obvious but I had overlooked it!

LogikBlitz
Reply

This guide works, even on Netbeans 6.9.1 but when adding the platform you have to choose the root of the SDK – just like in the guide.
When pressing next, netbeans kept on incisting that no platform had been chosen, so a shutdown and reopening of netbeans fixxed this, and everthing went smooth after that.
This was done on a Macbook Pro.
Thanks for the guide. Very helpfull.

didit
Reply

thanks a bunch….

Xotan
Reply

Thanx for the introduction.
Can anybody tell me how to include the DOCs into Netbeans IDE. For other platforms NetBeans has the option to include JavaDocs, but for the Android-Platform this option is not available (don’t know why). Since developing with NetBeans and available JavaDoc is very comfortable I would like to use this for Android too.
Thanks for any help!

Gerry
Reply

Updated. Thanks shareef

xenix
Reply

I am working with netBeans 6.9.1.
I could install android plugin,
but when I tried to add platform, there was no option
“Google Android Open Handheld”, and no platform was found in Android sdk folders. Somebody has the answer?

Akshit
Reply

I can’t see “Google Android Open Handheld Platform” In add platform.
Netbeans 7.0
NBAndroid 1.0

plz help me

Lukmanars
Reply

i got same problem with akshit,
anybody pliz help us,,
>__<

Web Designer
Reply

I’ve got the same problem as Akshit on Netbeans 7.0. Anyone solved this?

Radim
Reply

This article is out of date now. Please take a look at http://www.nbandroid.org/p/installation.html

While the beginning here is mostly OK (autoupdate setup if you use current URL) the rest dealing with Java platform is obsolete. The whole concept is abandoned a new new version. Just set up Android SDK location in Tools | Options | Misc | Android and you are ready to go.

Yohan
Reply

I believe we need to activate installed plugins (i’m using netbeans 7.0.1) and previously i have not activated user installed plugins yet and i can’t see new android project. but after i activated it, i can now build one

MrEd
Reply

Basically, the installation process was changed and the “platform” concept was scrapped. So follow the instructions for installing the nbandroid, found here:

http://kenai.com/projects/nbandroid/pages/Intro

They work, as of today, for:

Netbeans 7.0.1
NBAndroid

Ivan
Reply

I have just downloaded the required plugins for Andriod development.

Everything went on successfully however when it came to add the Andriod plat, i had no option for it listed, I am using Netbeans version 7.0.1.

Need help!!

Nazmul Ahsan
Reply

NetBeans 7.0.1, after installing android, I cannot see the plat form options either, can anyone please respond?

Thanks

anna
Reply

I am working with netbeans 6.9.1
I could install android plugin,
but when I tried to add platform, there was no option
“Google Android Open Handheld”, and no platform was found in Android sdk folders.
what I must do to fix it??????

manali
Reply

thanks ya truly helpful
died trying to do this wid eclipse
thanks a lot

Leave a comment

name*

email* (not published)

website