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

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.

Related

Technical differences between PWA and Hybrid App

What are the differences between a PWA and a hybrid app? This question was asked before but I haven't found found a proper answer to my question.
I know a PWA runs in the browser and you get a hybrid app from an app store.
But both are using JavaScript with HTML and CSS and both enable offline support and I can access native features like camera and local storage.
Once I have added a PWA to my Homescreen, it uses a web view to render the app right? And a hybrid app uses a web view as well, so what exactly are the differences between PWA and a hybrid app?
With Ionic I can even use the exact same code for a pwa and a hybrid app...
Roughly it is like this below:
web app (PWA) is just a web-site that declares certain capabilities using manifest file etc which can get it some special treatments (like leverage service worker, sign up for web notifications, go full screen etc IF target browser supports it). As a web-app it is super limited in its "privileges" on a system level (like persistence quota etc)
hybrid app (like Cordova for example) is a binary code that is "wrapping" your web-code and exposes certain "native" SDK capabilities via plugins. You can potentially also write your own plugin and in theory access any native SDK API this way. But since your main app code is still a web-app that runs inside of a webview it still has a lot of penalties like performance etc. But at least you can get things like storage etc.
native app is a binary build using target platform's SDK. That in
theory gives you max access to capabilities and performance at
expense of having to write separate code for each platform.
Makes sense?
Progressive Apps
Today, these apps only work on Opera, Chrome, and the Samsung mobile browser. However, these browsers take up only less than half of the mobile browser market.
In some devices, some of the features will not work. For instance, notifications on iOS devices will not work.
In some apps, cameras, fingerprint scanner, and GPS may not work or work with glitches.
Cordova/ Ionic based hybrid apps
Making the hybrid apps run efficiently on multiple platforms is no easy task. In some instances, it could cost almost the same as running native apps. The cost will depend on how close you want to get to the native app experience.
Since these apps will launch using a browser-like component, they are only as good as the component on which they run. Earlier, Google and Apple did not agree on the WebView. While it has vastly been improved, it does not have the same efficiency as running a native app.

iOS App: webView or PhoneGap?

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)

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.

Does Google Analytics Tracking for Flash works in packaged air application for IOS?

I'm building an air application (using adt packager) for iPad. I would like tracking some informations in my app so is it possible to embed Google Analytics library for Flash (.swc) in my packaged app ?
otherwise are there alternatives ways ?
Note: Currently, Flash tracking is available for any Flash content embedded in a web page. Tracking of data sent from Adobe Air, Shockwave, or via the Flash IDE (e.g. using Test Movie) is not supported at this time.
got this from https://developers.google.com/analytics/devguides/collection/other/flashTrackingIntro
I am having better luck with this alternative native extension (ANE) for iOS and Android:
https://github.com/alebianco/ANE-Google-Analytics
GAForFlash (http://code.google.com/p/gaforflash/) v1.0.1.319 did work for me when compiling with AIR and running in ADL on Windows, but seems to work intermittently when compiling and running it on an Android or iOS device. The visual debug feedback reports it always sending correctly, but half the time GA never receives the data.
Both solutions can send both pageViews and events, but neither (currently) works with the new mobile app GA profiles so you need to use a classic web profile.
It is possible. I have it running in my pure AS3 AIR project for mobile.
See http://code.google.com/p/gaforflash/ there is a swc you can use there.

Single Page Web Apps for the iPad?

I'm looking to make a single-page web app that works exclusively on the iPad, like Gmail on the iPad and the iPad User Guide. An app like this must be made using a framework that allow web pages to behave in ways much more akin to iPad's native applications (momentum scrolling, split-view panes, UIKit-style interface), but done completely in HTML5, CSS3, and JavaScript (with WebKit and Safari extensions like iOS-specific multi-touch and gesture events).
The only public framework I've found that targets the iPad in this matter is Sencha Touch. Naturally, Google and Apple aren't sharing the libraries they've written (ie. PastryKit, AdLib, etc). Are there any others (the open-source only license for Sencha Touch is prohibitive, and jQTouch is only for small-screen devices like the iPhone 4, and not the iPad)? How would I go about writing momentum scrolling and split-view panes like this? Any good resources/tutorials/books/links on these advanced topics?
For a lot of reasons, people want to write web apps for the iPad that can compete with native.
I don't think you'd have to do it yourself. The sencha touch commercial license is free, so you won't have to open up your own code. On the iPad it looks really good.
You can also use PhoneGap to put a native wrapper around it so most users won't notice it's a web app.
Jquery mobile is also an option but it doesn't look as good as sencha, IMHO
Sencha Touch license
PhoneGap
Also checkout App Titanium... You develop in Javascript, but it renders your app as native code...
Take a look at SproutCore and:
http://blog.sproutcore.com/post/531215199/introducing-sproutcore-touch
http://touch.sproutcore.com/hedwig/
http://www.npr.org/webapp

Resources