iOS App: webView or PhoneGap? - ios

We are developing a HTML5 mobile app with Sencha Touch.
Now we want to package the App, and found that we have two methods:
The first one is to use PhoneGap to generate a native app based on our html5 code.
The second one is to create a Single WebView app in Xcode, and request the url which will host our HTML5 code.
I found the second method relatively easier. So are there any advantages in using PhoneGap to generate the native app?

We usually use phonegap/cordova when we need some native function from the device, for example a barcode scanner.
Of course you can create your own barcode project, however why reinvent the wheel. Since phonegap/cordova 3.0 the effort needed for creating a app is kinda low. Just follow the guide and your all set.
http://docs.phonegap.com/en/3.4.0/guide_platforms_ios_index.md.html#iOS%20Platform%20Guide
in short:
Advantages of Phonegap/Cordova
Ready for different platforms, little effort to create android app
Native functionality already implemented (plugins)

Related

Integrate Worklight project in existing IOS project

I have to integrate a Worklight project into my existing IOS project (Objective-C)
I have googled but i have not found a clear "guide" on how to perform this integration.
Could you drive me in the right way of integrating this project? The idea is to have a button in my IOS project that open a WebView that loads the pages (HTML5 and javascript with AngularJS and Jquery) contained into the Worklight project.
Thank you so much
There is no guide for this approach, as I don't think it is sustainable.
In Worklight you currently have two approaches:
A native application to which you add the Worklight Native iOS SDK, allowing you to implement security features, invoke adapters and use various other features
A Hybrid application to which you can add native functionality (via Cordova or otherwise), and use the entire set of features provided by Worklight
It is important to note that a Hybrid application is a native application. It is a fully actual real native app. It is a native shell that calls a webview (provided by Cordova) into which the Worklight JS framework and the application web resources are loaded, and thus you see your web app. A Hybrid application allows you to mix & match web and native in one.
So what I am saying is that you can't take an existing iOS app and transplant it into another existing iOS app.
It sounds to me like what you are essentially trying to do, is what a Hybrid app is. A native app that displays web content...
So:
This is not an approach Worklight officially supports. By doing this, you are on your own
You could maybe take the guts of a Hybrid app's iOS environment (myapp\iphone\native) - its classes and resources and add them into your existing app and load the main class which theoretically, or at least the wanted effect, will load the Cordova webview. But I give this low chances of success...

Using twilio sdk for an iOS app?

I am planing to develop an VoIP iOS app and use Twilios SDK. I am making the choice to either use LiveCode, Appery.io, PhoneGap or build a native Objective C app. I am going to build the app for iOS, Android and HTML5 so the ideal would be to develope in JavaScript for all platforms, but as I understand the support for WebRTC is laking on the iPhone so the alternative for iOS is the native twilio SDK.
My requirements is:
be possilbe to use in iPhone 5 with iOS 7 be able to use twilio iOS
SDK´s voip functionality or twilio´s js SDK (if it is possible to
wrap a browser that supports RTC in the code?) be able to integrate
billing such as in-app payment or paypal with zooz or similar
communicate with REST API´s such as Amazon S3 or a node.js server
store temporary info in a SQLLite db when app is off line make fast
and responsive views (file listings etc) is very important
create cfuuid´s
I have seen several Twilio projects that use PhoneGap but none that are using LiveCode.
I have already built an iOS VoIP app in Objective C, but I want to be able to release it on several platforms also such as for Android and build a HTML5 app, without redoing everything.
This isn't really a programming question and should perhaps not be asked here.
You can create an external for LiveCode and quickly create an interface using the LiveCode IDE. This is probably a quick and easy way to make a working app. If you're starting with LiveCode but are experienced in Objective-C, creating an external won't be a problem for you.
LiveCode doesn't contain native iOS controls, which means that you have to emulate the GUI. If you use PhoneGap, you also will need to compile a plugin for PhoneGap using Objective-C, but you can use a framework, such as JQuery, to get the right GUI.
Either way, you will have to compile the SDK and you'll need to be quite profound in Objective-C.
LiveCode will meet all your requirements. However, Apple will deny your app if you use PayPal for in-app purchases. You'll have to use Apple's in-app purchasing feature. I believe this is possible in LiveCode now. I'm not sure how easy it is.
I'm not sure about file listings either. On iOS, you won't have complete access to all files on the phone. This isn't a LiveCode limation but a limitation of the OS.

Difference of Native packaging between Sencha touch2 and PhoneGap

What is the difference of native packaging between Sencha touch2 and PhoneGap?
Many people use PhoneGap to natively package app based on Sencha touch, but I find that Sencha touch 2 has a new feature of native packaging.
So which type of native package is better in Performance, scalability, functionality, maturity, etc. ?
How do you choose?
PhoneGap is a middle-platform which is able to access some native APIs on many platforms and its interface language is Javascript. This means that PhoneGap is able to work with many cross-platform mobile web frameworks, such as: Sencha Touch, Titanium, jQuery Mobile, etc.
Sencha Touch 2 also provides a few native APIs (currently available on iOS, Android) through its SDK.
If you are not going to use any native APIs, then they don't have any major differences on performance and functionality as the only work done is just to wrap your Javascript code into a webview native component on corresponding device.
Lastly, the 2 main differences are:
PhoneGap provides much more APIs than Sencha Touch SDK.
PhoneGap supports 7 platforms, while Sencha Touch SDK only 2.
I had the same questions, I agree it's a real mess at first glance. Here is a very good article that "clears up confusion" quite well.
To quote the gist of the article:
Sencha Touch (and jQuery Mobile) are mobile web frameworks. You can use these technologies to create web-based, mobile apps. They don’t have access to any native API’s.
You can use Sencha Touch and jQuery Mobile inside both PhoneGap and Titanium. If you decide your html/js is cool as a native app too, you can use either PhoneGap or Titanium to wrap a browser around your app and put it in the app store or marketplace. This is where, I think, the confusion comes. Putting your Sencha Touch or jQuery Mobile apps in a native wrapper doesn’t make it a native app. It makes it appear as if it is a native app. You might get some extra functionality from PhoneGap or Titanium API’s, but it’s still not necessarily a ‘native’ app. It’s a web app running locally on the device. It’s a great way to use web technologies inside a native-like area.
The difference is that Sencha Touch allows you to build native iOS-Applications even on Windows, whereas PhoneGap 'only' bundles your HTML files into an XCode project, which further needs to be compiled on OSX for distribution/packaging.

HTML5 mobile app - when to simply use UIWebView and when to use PhoneGap?

I am a web developer who needs to build an HTML5 mobile app - which we will need to try and submit to app stores, including Apple's App store. Therefore, I need to somehow wrap my app into a native framework.
That being said, I don't have time to learn the nitty gritty of Objective-C and figure it all out.
I am trying to decide between using a service like PhoneGap, or simply creating a smaller native app with a webview that pulls up my mobile app from my site's server.
In this case, the only native hardware that my app needs to be in touch with are push notifications (probably through Urban Airship) and Geolocation (which can be accomplished via HTML5).
When is it wise to go with something like PhoneGap vs. simply creating a UIWebView, and vice versa? Which would you suggest in this case?
Apple is loyal enough to PhoneGap apps - almost no problems with approval on iStore. You should just follow Apple Human Guidelines and everything should be OK.
PhoneGap provides lot's of different and interesting features. Also it's cross-platform - works great on iOS, Android, WP7 etc. I think it's the best way to wrap your HTML5 and JS.
Talking about pushes - if you select phonegap, i recommend to look at pushwoosh service.

Can I pack the html5 from playn to be use as IOS app?

Can I pack the HTML5 from playn to be used as an iOS app using some thing like phonegap, or another method?
You can. Bear in mind that when using WebKit in a Phonegap-style application, you lose the benefit of just-in-time compiling in the JavaScript VM. So your game will be slower. If you don't need to integrate with the iOS App Store, a better solution is to have users get to your app via regular Mobile Safari and then click "Add to home screen" which will install your HTML5 app in a very app-like manner on their home screen and allow it to run with the JavaScript JIT.
Eventually PlayN will also support native compilation for iOS, but the above approaches are useful stopgaps if you plan to ship a game soon.

Resources