Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I use PhoneGap instead of ramping up on the Android SDK?

Although I am comfortable with Java, I have much more experience with web development. I am looking to get into programming simple Android games.

Should I just program everything using Javascript/HTML and forget ramping up on Java/Android SDK? I guess my question really is, what are the limitations of PhoneGap? What are some things to consider, etc.?

Some advantages I can think of:

  • More selection in terms of game engines for HTML5/JS
  • Faster ramp up time
  • Automatically deploy to all major platforms
like image 319
Andy Hin Avatar asked May 04 '11 16:05

Andy Hin


4 Answers

The biggest pro for phonegap is that it takes advantage of your web development experience. I think what most people seem to miss (or ignore) is that there is no advantage in avoiding phonegap for an android only application! You can still write as much native code as you want to, mixing and matching phonegap as you please.

I am writing an Android app that uses text to speech. Because Phonegap doesn't support this in their API, you might think that Phonegap is a bad choice, but actually it was quite easy to call the Java code I need from javascript:

Java code:

public void onCreate(Bundle savedInstanceState) {
   //boilerplate and TTS set up
    ...
    this.appView.addJavascriptInterface(this.speak, "speak");
    ...
}

public void speak(String text) {
    this.tts.speak(text, TextToSpeech.QUEUE_FLUSH, null);
}

Javascript code:

speak.say("hello world");
like image 94
Brian O'Dell Avatar answered Nov 05 '22 06:11

Brian O'Dell


Pros for Phonegap:

  • deploys to all major mobile devices
  • sounds like it best fits your skillset
  • covers most available platform APIs with a uniform code base, no need to learn each one
  • PhoneGap Build (https://build.phonegap.com/) and Cordova (https://github.com/brianleroux/Cordova) are making it even easier to deploy to multiple platforms

Pros for Android:

  • Better performance
  • No limitations on which APIs you can use (i.e., video)
  • Defined toolset and workflow
  • native UI components
  • Fragments API and native layouts make handling different screen sizes easier

It really comes down to whether or not you want to be an Android-only developer or not. That first pro for phonegap is HUGE is you plan to develop for multiple platforms.

like image 27
Tony Lukasavage Avatar answered Nov 05 '22 08:11

Tony Lukasavage


I personally have major concerns over PhoneGap apps performance compared to that of a native Android app. The admittedly small amount of testing that I have done makes the PhoneGap version feel very unresponsive compared to native. I don't see how this doesn't translate to a poor user experience. Even PhoneGaps packaged sample application runs poorly.

I was very excited at the possibilities that PhoneGap appeared to open up, but I don't feel like it's there yet. I don't feel comfortable committing to a large project on PhoneGap.

like image 9
Ian Dixon Avatar answered Nov 05 '22 07:11

Ian Dixon


No WAY! Adobe has their cloud build which has a 9.5 MB file size limit. And, they are discontinuing support for other types of build.

like image 2
Rob Lawson Avatar answered Nov 05 '22 08:11

Rob Lawson