Confusion regarding PhoneGap/Cordova - html

I have a webapp developed (game), based on HTML5 + CreateJS, but since Android lacks of standards, I've run into unsolvable issues for my webapp. That's why im recurring to PhoneGap.
Yet my confusion lies in the fact that I need to make this game into a phonegap app that runs on Android/iOS, using for each platform native specific stuff.
So, should I build 2 apps (one for each platform), all over again, or use the one I have and try to deploy it into different devices using phonegap?
The truth is I don't know how to approach this problem... can anyone help?
Best Regards.

Yes, you can use Cordova (PhoneGap) to create a cross platform mobile app. Basically, Cordova (PhoneGap is Adobe's version of Cordova) is an open source project that provides JavaScript API's for accessing native device functionality (like the Accelerometer or Camera.) Cordova also lets you package your app in the native application shell, so you put your app on the app store. Please see my other answer here about Cordova and hybrid apps: Beginning with Apache Cordova
If the game runs completely in HTML5, I think it would be easiest to just use that one codebase and integrate it with Cordova and then deploy to the various platforms - why rewrite the app twice if you don't need to?
However, if you are using native device functionality, you may need to develop your own Cordova/Phonegap plugins for use. This way, you can call regular Android/iOS code (Java or Objective-C code) that you write from your web app code with JavaScript. This might be more work, especially if you have never written in these languages.
Personally, since you already have a working HTML5 app, I'd just try to get it working with Cordova and see how it performs. If you really need some native specific stuff, then I'd try creating that "stuff" as a plugin. Rebuilding the app twice, once for Android and once for iOS seems like a pretty big waste of time to me.

The answer here is either yes or no.
Yes if you want to use some specific feature of the native code. For instance, iOS's default objects is beautiful itself, you can easily drag and drop it to build your application. However, it takes lots of time to rebuild for another platform. Specially, if you intend to create app/game for multiple platforms, it would be a nightmare.
HTML5 is much faster for you to approach several platforms. However, you can't get the best result on all platforms and all devices. I mean, it is really difficult to bring the max performance of the app on all devices. For this solution, I suggest HTML5 with some libraries such as LimeJS, Crafty, Impact, etc. or some tools such as Construct 2, etc. I used to use HTML5 with all those libraries but found out that Construct 2 is much better.
Instead of using phonegap, I recommend cocoonjs. Specially if your targets are iOS and Android platforms.
Hope that help.

Yeah, even the simplest game such as bubble buster would be difficult to make cross platform with different version of android webview and you need cross platform? I would suggest looking into something like Unity3D.

Related

Building an Air app for desktop#2015, any disadvantages?

Since I'm familiar with AS3, I'm planning to build a desktop app using Air, and I'd like to not run into limitations, I never developed a full blown app for desktop using Air, only small apps and others for mobile.
The idea of this app is to be similar to an IDE, with some visual management, think of the design view of Flex, something like that. But not that big, a smaller/reduced version of that.
I'm asking this because I don't remember seeing any app like that built in Air, and I wonder if there is a good reason, or not.
If for example someone says: "use Java, its better", please tell me why, and more importantly, what things I can do in Java for desktop that Air just wont allow me to.
IMHO AIR is extremely powerful and if you combine Stage3D + Native Extensions you can do almost everything with a good performance. I have been working in several projects for desktop, iOS and Android and using Starling + Feathers + Robotlegs + creating my own native extensions (plus there is a lot of free/open source/commercial) was possible to achieve all my (and clients) goals.
Also, there is a huge (ActionScript/AIR) community sharing knowledge and helping each other, several open source frameworks (for games, 2D, 3D, animations, GUI).
I have tried Objective-C, Swift and Java and of course, there is a lot of positive points, native performance, powerful IDE's, GUI integration, native components, etc.
It's a mix, if you need to have your app running in multi platform, I believe Adobe AIR is a good option, if not and you have the necessary knowledge to work using Objective-C/Java, use native.
Of course, it's all relative, I'm just trying to share some tips.

Cross-platform web development combining HTML5 and native capabilities

I am absolutely new to the mobile development and I am puzzled by the following question:
How can I write a cross-platform mobile application with UI on HTML5 (same for all platforms), most of logic in JavaScript and ajax, but keeping some of native capabilities like marketplace and a good offline storage?
Do "hybrid" applications provide what I need? Is it possible to get access from javascript code inside "web page" to the phone native resources?
Could someone suggest an entry point for such kind of work (framework/toolkit)?
There is some frameworks like Corona SDK or PhoneGap, which can help you to achieve this. Also take a look to this similar post. Another good comparison between such frameworks is available at Mashable

MVC4 mobile Web app into app store

I have developed an web app using MVC4- mobile and HTML5. Every things is working fine when we enter URL from any phone. But i am wondering how to convert my web app into hybrid app so that i could upload in istore or GooglePlay.
Please help me with the procedure or steps i need to follow and is there any tool other than phoneGap that i could use.
Thanks in advance.
There are few options but I will mention only two of them.
Most commonly used is a Phonegap/Cordova app wrapper framework (Also my main choice). Cordova is a new name for a Phonegap framework. It will give you an access to common mobile phone functionalities (Android, iPhone, Blackberry and WP7+). It is rather easy to use and there are a lot of vorking tutorials available, you can even find them in youtube.
Here's an phonegap link: http://cordova.apache.org/. There you will find tutorials how to install/configure it on all available platforms. This is a older link: enter link description here, it still has usable informations.
If in doubt always search for phonegap examples instead of cordova. For some reason Phonegap is still a mostly used name.
Here's an Phonegap + jQuery Mobile example: http://therockncoder.blogspot.com/2012/07/jquery-mobile-phonegap-and-camera.html, there you will find a github link for Android and iOS implementation.
Through the PhoneGap javascript APIs, the "web app" has access to the mobile phone functions such as Geolocation, Accelerometer Camera, Contacts, Database, File system, etc. Basically any function that the mobile phone SDK provides can be "bridged" to the javascript world. On the other hand, a normal web app that runs on the mobile web browser does not have access to most of these functions (security being the primary reason). Therefore, a PhoneGap app is more of a mobile app than a web app. You can certainly use PhoneGap to wrap a web app that does not use any PhoneGap APIs at all, but that is not what PhoneGap was created for.
Now some disadvantages. With PhoneGap for each platform you have to maintain a different project. The burden for that increases when there is a need to use multiple PhoneGap plugins because you need to search and update different files on each platform.
Mosync is also an excellent solution. This framework has a few things better handled then Phonegap. Like:
With MoSync you’ll have only one project to maintain for all the platforms. For iOS you will still need to use Xcode because MoSync outputs a project for it but, other than just building it, there is no need to dig deeper in Apple’s IDE.
The entire provided functionality for JavaScript is placed in the same file for all of the operating systems. There are no files for plugins because it has none (at least that I know of), but the same extensibility is achieved in ways described in the next section.
If there is some functionality that MoSync doesn’t provide on the JavaScript side, there are no plugins that you can use, but there is another way. MoSync provides a lot of features from the C++ side and if they aren’t accessible from JavaScript by default they can be easily made available. I’m sure that in the future the MoSync team will add more features to the JavaScript library.
With MoSync you are not restricted to only JavaScript frameworks to replicate native UI, you can truly create native UI elements that are more responsive using only JavaScript.
Rhomobile on the other hand is much less used thus a lot less supported.
I heard few good things about this framework but never had time to learn/use it.
RhoMobile applications are OS-agnostic, able to support enterprise-
and consumer-class operating systems including Windows® Embedded
Handheld, Windows® CE, Windows® Phone 7 Series, Apple® iOS, Android®
and BlackBerry®. You have complete control over how applications
behave on different devices. With RhoMobile Suite, you are finally
free from OS design constraints, able to create business applications
that are every bit as elegant looking and intuitive as their consumer
counterparts (This was copied from their main site).

Working with HTML,CSS and Jquery Or Javascript in WP7

I am presently started working with mobile development and would like to know which is the best way to work with Html,css and jquery/Javascript for WP7.
As I have seen couple of things on the web as Phone Gap,Jquery mobile and Appcelerator Titanium
1.I have some of the problems actually this is not a problem but as PhoneGap gives a starter template with C# solution.
But I'm working on VB.Net.I'm unable to work with the C# solution as If I convert to VB.Net the entire starter template it is not working.
2.Just now I had a look at Jquery mobile there is no specific documentation mentioned how to use it with emulator in WP7.
Can anyone show me the links where I can start with the basics of Jquery mobile with WP7 emulator.
3.Do you think there is any other best way so that I Can work with jquery, html and css in WP7.
It sounds like PhoneGap is your best option here. Right now, it's the best way to deploy an HTML-based application on Windows Phone. The main thing that PhoneGap gives you is a bridge to the phone's hardware (things like volume buttons, vibration, etc.). It also gives you an easy way to wrap up your application into a package that can be installed like a real native app.
By themselves, other frameworks like jQuery Mobile, Sencha Touch and Kendo UI don't provide hardware access or the ability to deploy the app natively. They are purely UI frameworks, meaning they provide the interface widgets you'll use to build your app but little else. Generally, with these frameworks, you need to host the app somewhere like a website and access it through the browser.
Assuming you're running a Windows machine, you could host the app locally for development using Internet Information Services (IIS). Here's a guide to setting up a site. Then you could open the emulator and go to http://localhost to interact with your app. That would work, but it would be clunky.
The ideal scenario is to use both jQuery Mobile (or another UI framework) and PhoneGap to create a nice-looking, natively installable app.
What I'd recommend is trying to get PhoneGap set up in a VB project. From what I've seen, this shouldn't be too difficult. There are probably some details to work out, but mainly it looks like you need to copy the www and GapLib folders over. Then right click on References and browse to the GapLib .dll. You'll also need to get the MainPage.xaml and MainPage.vb files set up, but they probably just host a web browser control, so this should be straightforward.
Migrating the pieces into a new project should work a lot better than trying to convert an existing project.
If you post specific issues that you run into during the setup, I'm sure you could get them answered quickly.

How to use persistenceJS in phonegap application?

We are building a field data collection tool that will be available in two versions:
Fully html5 -- directly
downloadable through your browser
(does not support camera access,
etc..).
Hybrid using phonegap --
installation required (does support
camera access, etc..).
In the html5 version we are using
persistenceJS to store data. Somehow this does not seem to work in the hybrid version and it would be nice to keep the code base as generic as possible.
Does anyone know about using persistenceJS in combination with phonegap?
Note 2011/04/04: In a prototype we have gotten persistenceJS to work in phoneGap. Probably some kind of library is interfering in some way.
Phonegap is kind to persistencejs.
The only potential trouble is with iOS, which made its websql storage non-persitent starting in iOS 5. In other words your database can be periodically removed by the operating system.
If you upgrade to Phonegap 1.6 and up, there is a built-in fix for this problem and your persistencejs will work just fine.