AngularJS and PhoneGap

3,117 views
Skip to first unread message

Nolan Dubeau

unread,
Oct 24, 2011, 7:08:48 PM10/24/11
to ang...@googlegroups.com
Hi folks,

Just wondering if anyone ha explored using Angular and PhoneGap to build mobile apps. If so I would love to hear about your experience as I'm looking to start using PhoneGap and would really like to use Angular in conjunction.

Thanks!

Nolan Dubeau

Sent from my Commodore-64
Load *.*,8,1

Di Peng

unread,
Oct 24, 2011, 7:22:07 PM10/24/11
to ang...@googlegroups.com
Hi Nolan,
     I have experiences with both AngularJS and PhoneGap (although not both of them together). But I don't foresee any troubles. PhoneGap is known to work very well with JQTouch and Sencha Touch, and should do great with AngularJS :)
Di 


--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/angular?hl=en.


Igor Minar

unread,
Oct 24, 2011, 8:02:24 PM10/24/11
to ang...@googlegroups.com

This sounds right.  While I haven't tried it, it should work.  If it doesn't let us know.

Nolan Dubeau

unread,
Oct 24, 2011, 9:01:27 PM10/24/11
to ang...@googlegroups.com, ang...@googlegroups.com
Thanks guys,  I will give it a whirl and let you know.  Thanks. 


Nolan Dubeau

Sent from my Commodore-64
Load *.*,8,1

Di Peng

unread,
Oct 24, 2011, 9:15:00 PM10/24/11
to ang...@googlegroups.com
That will be great, good luck!
Di

dan.ba...@gmail.com

unread,
Sep 16, 2012, 8:11:26 PM9/16/12
to ang...@googlegroups.com
Any luck? I haven't found much information online about PG \ Angular integration. Would be great your hear your findings...

Dan

Efflam Daniel

unread,
Sep 17, 2012, 6:35:35 AM9/17/12
to ang...@googlegroups.com
I've built an iOS / Android app with angular and phonegap without any problem. In fact you can build your Angular app as you normally do and encapsulate it with phonegap.

Wizek

unread,
Sep 17, 2012, 4:42:36 PM9/17/12
to ang...@googlegroups.com
I second Daniel's findings.

One piece of advice though: look out for deviceready event to avoid surprises like: "How on Earth can Cordova.exec be undefined when the docs say it should be a function!?", and such.

Robert Mirabelle

unread,
Oct 16, 2012, 8:35:56 AM10/16/12
to ang...@googlegroups.com
How do you do that? That's the information I'm looking for and have been unable to find - seems like something to do with manually bootstrapping...help!

Tim Stewart

unread,
Oct 16, 2012, 8:40:18 PM10/16/12
to ang...@googlegroups.com
Depends what you want to do on deviceReady. You don't need to wait for that to bootstrap Angular, just to use PhoneGap APIs. If you're waiting for that, it's probably something to do with local data access at startup? So that would be encapsulated in a service, and your service constructor could include code like:

document.addEventListener("deviceReady", function() {
self.db = openDatabase(....);
}

Other PhoneGap APIs (Camera etc.) will generally not be needed until long after they are initialized and ready.

And I can definitely confirm PhoneGap and Angular work together. I used them in this app on App Store / Google Play:

 
Regards
Tim

mlegenhausen

unread,
Oct 17, 2012, 5:50:23 AM10/17/12
to ang...@googlegroups.com
We are currently building a bigger app based on phonegap, angularjs, jquery-mobile (with the great jquery-mobile-angular-adapter), requirejs, lawnchair for iOS and Android. We are utilizing the native SQLite databases of iOS and Android and planing in app purchase integration. One great think is I can test everything in my desktop browser, when I think everything is working I simply copy all the JS files to the different platform projects and deploy them on the mobile device. When you want to make use of the PhoneGap APIs keep in mind that you need to write your own mocks, cause there is currently no browser emulation library that supports all PhoneGap features for desktop development (if there is one, please notice me ;)).

In generell all javascript frameworks will work on PhoneGap when they are running in the browser of iOS or Android, cause in PhoneGap's core all apps simply running in a browser without a toolbar.

Harlley Oliveira

unread,
Oct 18, 2012, 6:26:31 PM10/18/12
to ang...@googlegroups.com
there is currently no browser emulation library that supports all PhoneGap features for desktop development (if there is one, please notice me ;)).

@mlegenhausen Some emulations are possible using http://emulate.phonegap.com


Harlley Oliveira


mlegenhausen

unread,
Oct 19, 2012, 3:57:38 AM10/19/12
to ang...@googlegroups.com
@harlley thanks for the tip

Porus

unread,
Dec 3, 2012, 3:39:02 AM12/3/12
to ang...@googlegroups.com
I'm new to mobile development and working on a project to create a Web App and wrap the same as Android & iPhone apps.

Planning to use Angluarjs + Saas / bootstrap and eventually wrap it with PhoneGap Build for Andorid / iPhone native app. Does it work?

This app has media (images, mp3, mp4, ppt) playing and HTML 5 question and answer games. Appreciate any recommendations/comments on frameworks.

Joshua Moore

unread,
Jul 16, 2013, 7:09:54 AM7/16/13
to ang...@googlegroups.com
Greetings,

I'm using PhoneGap and AngularJS together. I was wondering if anyone had experience with the $http module in this setup. 


Inside of a controller, I'm reacting to a button click event by $http.get()ing a file from a simple python http server. 
The server acknowledges the request with a code of 200, however, in angular the error function is called. 

Only the config parameter is filled, JSON.stringifying it yields:
{"transformresponse": [NULL], "method": "GET", "url": "http://server-ip:8000/request_token", "headers": {"accept": "application/json, text/plain, */*"}}

Does anyone know what that could be?

Joshua

Alexander Kohout

unread,
Jul 17, 2013, 2:46:41 AM7/17/13
to ang...@googlegroups.com
Have you allowed cross origin requests? 

The only problem we had was that the connection to the API was not possible due to the Cross-Domain Policy. 

Our Solution:
- on server side we send headers that allow cross origin
- on angular, we configured httpProvider to useXDomain and we delete the requested-with header (we found that solution somewhere on Stackoverflow)
Reply all
Reply to author
Forward
0 new messages