Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android / phonegap performance [closed]

I've read about phonegap which enables users to write web-based apps for android and i was wondering:

  1. how is the performance of phonegap compared to a "real" android app
  2. what would NOT work in phonegap?
  3. i know it's possible to implement google maps with phonegap but i guess there's a lots of limitation compared to direct coding the maps under android?
  4. as a newbie to android (but intermediate in web-programming), should I go for direct android coding instead of phonegap?

i'm planning to write an app which uses google maps service+gps, database access and such, and i'm afraid it's not really possible with phonegap.

thx

like image 452
Fuxi Avatar asked Jun 19 '10 12:06

Fuxi


4 Answers

I am building an application with Google maps, GPS and uses a back-end Service/Database. I have chosen to use

  • Phonegap - To 'wrap' my HTML and I also use the Geo-Location library.
  • Javascript - JQuery - JQuery Mobile - Most of the UI
  • HTML5 - Heavily custom UI where I needed to do graphics and gesturing etc, needed to hand-code
  • Node.JS - my back-end service.
  • JSONP - Communicating between my Mobile app and the service
  • CouchDB - In the cloud, NoSQL Javascript friendly Database, very cool.

Having almost finished, I can say that this type of app certainly is do-able with this stack of technologies and the whole cross/platform aspect of it is fantastic. However it has not been particularly easy. In particular, you need to watch out for ...

  • Phonegap uses file:// based URLs so all kinds of problems with browser 'security' and cross site scripting messing up your Ajax and cookie code. I got around this by using JSONP but it did stop me from using some cool stuff that would otherwise have been possible like SocketIO.

  • debugging your JavaScript within the browser, within the Phonegap container, within the emulator... is virtually impossible. I got around this by doing most of my debugging on Firefox with Firebug and then using alert('blah') for any issues that popped up only when deployed.

  • Google Maps hosted inside HTML will only work while connected to the internet, this meant that debugging while mobile (i do a lot of coding while commuting) was a pain. I needed to find reliable mobile internet, no biggie, its cool anyway but, it was something extra.

  • Google maps InfoView windows suck suck suck. I eventually gave up and pop any necessary dialogs from the map as JQuery Mobile pages.

Hope this helps somebody ;)

like image 60
Michael Dausmann Avatar answered Sep 19 '22 13:09

Michael Dausmann


The performance of PhoneGap apps is good, but it largely depends on exactly what you are doing (for example animations probably perform better native).

If you are only building it on one platform it might be best to go native since there is going to be a learning curve with both PhoneGap and native Android development. It may also be easier to go native since you are using maps a lot.

like image 21
davejohnson Avatar answered Sep 19 '22 13:09

davejohnson


I would avoid Phonegap at all costs. I've been working on a project with Phonegap, and we had lots of problems with it. In the end, we turned to coding in native languages (java/objective c/java me).

Maybe something changed in the meanwhile, but at that time (Q2 of 2010) Phonegap was really OK only for iPhone. Android API didn't have half the features documented on their site, and even those features were stuffed with bugs. For instance, their Contacts API had a huge blocker - used some non-existing javascript object. It seemed as if they just copy/pasted the code from iPhone API and didn't even care to check if it worked. I was really disappointed with Phonegap - we couldn't use database, we couldn't get contacts, documentation was false....

One more thing I hated about doing an HTML app for Android was the lack of libraries with native looking Android GUI. Almost all the JS GUI libraries were focused on iPhone, and replicating the iPhone GUI. A few of those that advertized to have support for Android had such a bad components design that they were useless.

Again, these are my experiences from 6 months ago. I hope some things changed in the meanwhile, but I'm sure I won't be using HTML for mobile apps/android any time soon.

like image 24
zorglub76 Avatar answered Sep 19 '22 13:09

zorglub76


The good thing about phonegap is that it enables you to build cross-platform mobile apps. If you are doing just android, I guess it doesn't make sense.

like image 23
Macarse Avatar answered Sep 17 '22 13:09

Macarse