Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure Eclipse to use Phonegap on Ubuntu?

Definition

Phonegap = tool to make things such as HTML5/Javascript games into phones. It is pretty cool because desktop versions should work in phones without extensive redoing things for other platforms.

I can find the general instructions but everything about Eclipse and things like that. I cannot find a word about Ubuntu such as here unless a lot of google -spam with a massive amount of confusing threads about different platforms where people are more-or-less bullying one another like here with red-herrings such as google. I wish there was some nice make -files to do things but no, the README is instruction to read the more-or-less ambiguous Get-Started. So:

Problems

  1. Where can I find step-by-step instructions on Ubuntu to set up Phonegap?

  2. I hope some outlining over different platforms.

  3. ADT Plugin is not getting installed in Eclipse. Why?

Android Eclipse ADT -problem

I can find here the instructions but cannot move forward for some odd reason, no instructions or help -text to proceed. You can see in the photo that it does not allow me to click OK although I am following the instructions. I wish I could do this on console!

enter image description here

like image 992
hhh Avatar asked Jun 03 '12 16:06

hhh


1 Answers

Definitions

AVP = Android virtual phone (you do not need all phones to test your code, use emulator)

ADB = application to push application from command-line to the phone

ADT -plugin in Eclipse = adding some buttons to Eclipse for things such as to add AVPs

ADT = Android Development Tools (not sure what they are actually, perhaps emulation-related things containing things such as linux kernels, APIs etc)

I am trying to provide instructions for console -power-users, hopefully helping to get things fast set-up instead of wasting time a lot with the cumbersome instructions.

1. set up the development environment such as the Android SDK here.

$ wget http://dl.google.com/android/android-sdk_r18-linux.tgz

$ tar -xvzf *.tgz

$ ...follow README or some tutorial there...

I. Now go back to the Android SDK site where you can find the ADT Plugin for Eclipse here. The unclikable button becomes clickable if you search now with the search-bar for Android something. The ADT stands for Android Development Tools so install everything you get there under something tools or related.

II. Fix the @override -problem (shortly requires 1.6 compiler -compliance-level), more here.

III. Test your Android installation work by loading an Android Sample -file and then plugging in your phone (with USB -debugging enabled: Settings > Development > click) or use Android Virtual Phone (=AVP)

$ adb devices   # Shows your physics devices such 
                # as phones with USB -debugging enabled.

$ adb install ~/workspace/yourChosenSampleDemo/bin/*.apk 
                # Your first Android -app emerges to your phone, have FuN!

2. Set up the Phonegap with the below:

  1. Some general instructions apparently here.

  2. iOS: you need Xcode so somewhat limited.

  3. Perhaps useful, source -code here and general download here.

The instructions are extremely inaccesible with Eclipse's click-click-something, poor! After wasting time with Eclipse's symlinks, I swiched to the console:

$ tree|less
$ search for the files needed, mark them done or use find -command directly ^C
$ copy the files to some dir such as ~/Android/Public so easier to do ^C
$ things at once ^C
$ pwd
/home/xyz/workspace/HelloCordova/res
$ cp ~/Android/phonegap-phonegap-475bfd2/lib/android/xml/* .
$ cp ~/Android/Public/cordova-1.7.0.js assets/www/
$ cp ~/Android/Public/cordova-1.7.0.jar libs/
like image 177
hhh Avatar answered Oct 02 '22 11:10

hhh