Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How phonegap really works?

It is just a webview that have many api to native functions?

Can I have a phonegap activity and a native activity in an app?

like image 314
wizztjh Avatar asked Feb 25 '12 11:02

wizztjh


3 Answers

(1) Yes...PhoneGap provides a setup for every major mobile operating system that will create the same environment everywhere. This consists of a webview and a set of javascript functions that are mapped to native functions. This way you only need to develop one applications (based on HTML, CSS and JavaScript) and it can be run on any OS PhoneGap can provide its framework for.

  • Your application <--> Phonegap <--> Android
  • Your application <--> Phonegap <--> Windows Phone
  • Your application <--> Phonegap <--> iOS
  • Your application <--> Phonegap <--> ...

It takes having to deal with different operating systems away from you and instead you can focus on building your application, because you only "talk" to Phonegap and it will talk to the OS for you.

(2) Mixing the Phonegap webview application that is actually run by the phone with native stuff specifically created for one operating system will most likely end in disaster. That's not how Phonegap is supposed to work. And breaking out of PhoneGap's "jail", meaning it's JavaScript framework and the webview, will probably not work anyway. You can, however, open other applications on the phone and receive values from them. The question always is: On how many operating systems is this functionality available?

If you start asking questions like the one you just posted here... maybe you should first check that PhoneGap really is the right tool for what you want to do.

like image 137
Till Helge Avatar answered Sep 28 '22 00:09

Till Helge


It is not a phonegap activity. It is just a web view that uses phone gap javascript functions. Thus you will not have such problems. You can easily implement most of your UI using HTML, still using some native controls for menus, animations etc.

Phonegap actually is a library that translates your javascript calls to instructions for the different OS like Android/iOS/Windows phone.

like image 36
Boris Strandjev Avatar answered Sep 27 '22 22:09

Boris Strandjev


Phone gap is a intermediary layer that talk with your phone & between your application. Your application resides inside a chrome less browser & using phone gap api you connect to phone features like contact, camera, io etc...

like image 34
Praveen Vijayan Avatar answered Sep 27 '22 23:09

Praveen Vijayan