PhoneGap and Android

Neeti Sharad Wagle neeti.wagle at colorado.edu
Wed Feb 3 13:14:35 UTC 2010


Hello,

Ive been working on figuring out how to use PhoneGap (http://phonegap.com/)
for Android development.  Here are some of things Ive done so far:

   - Downloaded and imported PhoneGap into Eclipse. This was pretty simple
   and direct based on the instructions given in the Starting
Guide<http://phonegap.pbworks.com/Getting-started-with-Android-PhoneGap-in-Eclipse>.
   I then tested the Android Application on the emulator. However, since
   PhoneGap's javascript demo example included several features like
   Accelerometer, Geolocation, Vibrate the emulator run was not very
   satisfactory. Also a lot of the comments to the post mentioned having
   problems with these features on the ADPs. I have at this point tested these
   features on the phone and they all work correctly.
   - The next question was whether PhoneGap allowed extending the Java
   functionality.  I added a new class to their src code under a new package
   named 'extension'.  I implemented the class to have a single beep function
   which I copied from a function already present in PhoneGap. I then modified
   the ringtone used in the beep. Finally I linked the javascript call to this
   new class and its function. I have tested this both on the emulator and the
   dev phone and it works correctly.
   - Opening the browser and loading a URL passed from the Javascript.
   There is no direct class or function that handles opening URLs in PhoneGap.
   So I wrote a new function in my extension to do this. However, my function
   currently opens a browser outside of PhoneGap.

On this background, I am currently working on two different aspects of the
project

   - Once the URL is loaded in an external browser I believe the control
   goes outside PhoneGap. The only way to get back to PhoneGap is to use the
   Back button. For this reason, Im checking if I can fork a thread and open a
   child view with an embedded browser. I am not sure how easy or difficult
   this is, but I think this
thread<http://groups.google.com/group/phonegap/browse_thread/thread/662190137bf6c34c/a8da582717cbba79?hl=en&lnk=gst&q=phonegap+browser#a8da582717cbba79>on
the google group was exploring similar possibilties.  Unfortunately,
the
   trail has been cold for a while.
   - I have downloaded and imported the ZXing (zebra crossing) project's
   code for barcode generation and reading.  This comes up as 3 different
   projects in Eclipse : zxing, zxing_client and BarcodeGenerator. I am now
   looking into how this code can be included or called from the extended Java
   code I am writing under PhoneGap. My first approach is going to be to load
   ZXing's apk on the droid and understand the interaction between the barcode
   generation, barcode scanning and decoding, and loading the relative URL in
   the browser. This should help me articulate the use-cases which would help
   me understand how I want the code bases to speak to each other.

I would greatly appreciate any suggestions and please do correct me if I
have not quite completely or correctly grasped any of these constructs.

Regards
-- 
Neeti Wagle
PhD Student
Department of Computer Science
University of Colorado at Boulder
http://csel.cs.colorado.edu/~waglen/<http://csel.cs.colorado.edu/%7Ewaglen/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://fluidproject.org/pipermail/fluid-work/attachments/20100203/263ff204/attachment.html>


More information about the fluid-work mailing list