PDA

View Full Version : Sencha Touch and PhoneGap



joinsky
17 Jun 2011, 3:37 AM
On the overview page of sencha touch it is written that Sencha Touch works hand in hand with PhoneGap and it is also written :"PhoneGap also enables developers to utilize native device APIs like the Camera and Contact list directly in JavaScript."

How can Sencha Touch work hand in hand with PhoneGap. PhoneGap surely has a different API than Sencha Touch.

steve1964
17 Jun 2011, 3:43 AM
Phonegap use a javascript api to access native functionality of the devices, Sencha Touch is a javascript framework, so where is the problem?

http://www.sencha.com/learn/Tutorial:A_Sencha_Touch_MVC_application_with_PhoneGap

joinsky
17 Jun 2011, 10:09 AM
can you access e.g. the camera with Sencha Touch or can you access or build anything with Sencha Touch, which you could also do with PhoneGap?

Jack9
17 Jun 2011, 10:30 AM
I've played with phonegap a bit. Phonegap has it's own javascript API for doing things that are outside of what Sencha Touch allows you to do. The vast majority of my Sencha Touch code required 0 changes to have phonegap build and deploy to my iphone correctly. If I wanted Camera access (let's say to take a picture and show it), I would access the phone and take the picture via the phonegap api, locate the file with the phonegap api, then build what I could in sencha to display a file, then hook it together.

joinsky
17 Jun 2011, 12:28 PM
Do you know how PhoneGap builds a native App out of you Web-App which you have created using Sencha Touch? Does it have a Compiler or anything like that or how else can Phonegap build a native APP out of a HTML file?

steve1964
17 Jun 2011, 2:49 PM
Phonegap dont build an app starting from html/javascript/css (as titanium appcelerator do), it's simply wrap this stuff in a webui, for more detail http://www.phonegap.com/start

joinsky
18 Jun 2011, 1:19 AM
Can you acess the camera or other native functions of a plaftorm (e.g. Contact, geolocations etc.) with Sencha Touch?

Jack9
18 Jun 2011, 11:26 AM
Do you know how PhoneGap builds a native App out of you Web-App which you have created using Sencha Touch? Does it have a Compiler or anything like that or how else can Phonegap build a native APP out of a HTML file?

It uses the Webkit Safari libraries. You have to use XCode to compile, of course, but it's relatively painless. Move the Ext.Setup(...) into a PhoneGap javascript bootstrap method like dobodyonload or something and you're basically ready to compile.

joinsky
18 Jun 2011, 1:24 PM
Can you acess the camera or other native functions of a plaftorm (e.g. Contact, geolocations etc.) with Sencha Touch?

Jack9
18 Jun 2011, 1:47 PM
Can you acess the camera or other native functions of a plaftorm (e.g. Contact, geolocations etc.) with Sencha Touch?

This is documented all over both PhoneGap and Sencha-Touch (it's on the main product page).

No.

That's part of what PhoneGap is for. To bridge the gap between webkit and the phone. Phone Gap.

joinsky
18 Jun 2011, 4:24 PM
What do you mean by webkit? Do you mean the browser?

Jack9
18 Jun 2011, 4:49 PM
Webkit is not an entire browser. It's a series of libraries that provide specific Javascript/DOM implementations for HTML4/5

http://www.webkit.org/

ar6
12 Dec 2011, 9:42 PM
What do i need to call the PhoneGap camera API from Sencha touch code?
I have a controller in the Sencha code which calls the navigator.camera.getPicture() function of PhoneGap, on an event of button press. But nothing happens on firing the event.
Do I need to call the getPicture() method in a specific manner frm Sencha?