So far we have a web solution in html5, javascript for a webrtc solution. It is running successfully in chrome browser version 28.
Is it possible to embedded / convert the whole web solution in a single apk using phone gap?
Is the default phone gap browser support webrtc?
Please let know any info.
well, first you need to create projects in phonegap depending on your platform, say android, ios. Then you can start importing your web project into the www folder relatively and gradually, and see if it actually works. depending on functionality you will have to adapt to of course, jqm or some other framework perhaps along the way.
Related
I know that those kind of questions have been asked before, but I couldn't find a topic to help me.
I have been give a HTML5 game and I was asked to verify if I can run it on an Android tablet.
I'm a little bit confused with what I have to do? Should I create an Android project and import the file or is there an easier way to create an apk?
Thanks for your help.
You could look at Apache Cordova. This is a powerful environment made to support app development in HTML5. As such you should be able to literally copy your game resources over, run a build and have a full fledge Android App. Fun fact, provided you have access to OS X, Cordova will produce an iOS compatible app too.
If your game consists of HTML, CSS and JavaScript, such that it can be run off a modern web browser with no special plugins installed, rest assured it can run in an Android tablet.
You could access it directly from the tablet's browser or you can make an app (packaged in an APK and installed from it) which does essentially the same, but with a great benefit: the web page and the app can communicate (via JavaScript), enabling a richer experience.
Example of such communication: you're making an app for a web forum, and the link for "compose new message" opens an Android activity for writing that POSTs the result to the server, instead of constraining you to write in a small web browser form.
For more information on the subject, check out Android API Guides for Web Apps.
We're trying to combine HTML and Flash in a packaged mobile app. It needs to work on Android and it would be nice if it worked on iOS as well. One option is to use AIR with an SWF root containing a StageWebView, which should work, but we'd prefer to have the root of the app be in HTML and loading the SWF content as needed. Is there a way to do this by, for example, using Phonegap/Cordova or similar, perhaps with a plugin?
That's not possible. There's no plugin support for IOS.
The android situation only is slightly better since Adobe stopped publishing the plugin after/with Android 4.2. Older devices that have the plugin installed would work, the rest wouldn't. Also Adobes usage terms for the plugin wouldn't allow you to bundle it with your application if they didn't completely changed it since I checked it some years ago.
There are some solutions that might be providing you with what you look for some day, but they are not ready yet IMHO. Still, here some links:
https://github.com/mozilla/shumway SWF-Player implemented in Javascript
https://www.google.com/doubleclick/studio/swiffy/ Flash content to HTML5 converter
That means right now Air is your only serious option if you want to combine Flash and HTML on the same mobile device.
If you are still in the planning phase of your project or willing to rework the code you could also evaluate Haxe/OpenFL which is NOT FLASH but would allows you to develope your application with the Haxe language (similar to AS3), work with a Flash like display model - and then export the project as HTML5, SWF (also Air) or native Mobile applications for IOS/Android:
http://www.openfl.org/
http://haxe.org/
If you want to have HTML as a root, it means that you will run Flash Player as a plugin. Since 2012, Adobe stopped supporting Flash Player for mobile. Which means that it can be done easily - as just embedding your swf into HTML page, BUT it won't run on almost any device. That's because the player must be installed as a plugin for the browser. What you want is to embed the swf just like you're doing it on your desktop, and pray that the browser has it installed and run it. Nowadays most of the devices do not support it.
There isn't any easy workaround, because of the fact that Adobe cut the rope. And it's the proper way that should be done, as that Flash would be a part of an HTML. It won't have access to any hardware nor it would have permissions for writing and things like that.
So if you want Flash inside mobile, it's almost certain that it must be within AIR - it's native wrapper.
And the short answer basically is - yes, just embed it as swf inside HTML, but it won't work on much devices :)
I want to warn you that mobile webView has a lot of issues and limitations. As for me it is extremely bad idea to put flash player inside mobile webView (it looks like the castle in the swamp).
AIR as root application is definitely better solution (but anyway StageWebView brings a lot of pain too, it is just wrapper around native webView afaik).
Well, but if your choise is HTML, try to patch cordova\phonegap template (find there CordovaActivity class) to enable flash content as following:
WebSettings settings = appView.getSettings();
settings.setPluginState(PluginState.ON);
I'm currently testing worklight and I noticed a huge loss of performance on android devices compared to iOs ones. (tested on asus nexus 7 vs iphone 4)
The first point was: A simple html page jerks during a simple jquery mobile page transition.
No server calls.
I removed the jQuery mobile transition as it uses a lot of javascript instead of css3 transitions capabilities, but it still continue to tilt from a page to another.
I mean there's a 1/10 second 'blank screen' between 2 pages and the rendering of the next page lags.
To analyze that issue, I removed the worklight layer and hosted my simple html/jquery mobile page on an apache web server and called it from my device's chrome browser.
It worked perfectly fluid even with transitions.
After, I analyzed the worklight generated code in the mobile browser simulator and it appears that there's a lot of wlclient javascript files in the , which is not a good way of implementing a web page from my point of view, and what's more a mobile one.
Is there a way to compile all those files in one to avoid multiple http requests to the server ?
Is there a way to avoid to load all the client api if we just need a small part? I mean, if I don't need encryptedcache, why load the related js?
Is there a way to force the browser engine to use inside the app (chrome, opera, android native...) in order to test the perf of each one?
Worklight 5.0.5.20121217-0622
Android 21.0.0.v201210310015-519525
Win 7 64bit
Eclipse 3.7.2
Thanks a lot for your help.
removed the jQuery mobile transition as it uses a lot of javascript
instead of css3 transitions capabilities, but it still continue to
tilt from a page to another.
You can choose not to use jQuery Mobile and implement animations on your own or use another UI framework. You can also try creating custom CSS-based transitions for jQuery Mobile.
I removed the worklight layer and hosted my simple html/jquery mobile
page on an apache web server and called it from my device's chrome
browser
Worklight's file are not hosted on any server, they are part of the .apk you install on your device. The performance in the Web View is different than the performance in other browsers such as Google Chrome. You can try to improve it by looking at what other people are doing.
Is there a way to compile all those files in one to avoid multiple
http requests to the server ?
There's no way to do it as part of the 'Build all and deploy' step. You can edit the contents of the native folder generated for each environment and manually put the contents into a single file. However, I would not recommend that approach since those changes will get overwritten when you 'Build All and Deploy'. Read this if you want to minify your resources using Ant, however I doubt it will notably improve performance.
Is there a way to avoid to load all the client api if we just need a
small part? I mean, if I don't need encryptedcache, why load the
related js?
No, you can do it manually if you read my reply to the question above.
Is there a way to force the browser engine to use inside the app
(chrome, opera, android native...) in order to test the perf of each
one?
No, you Worklight uses Apache Cordova and that uses the Web View provided by the Android API.
I am new to PhoneGap, and I have several questions:
I need a way to develop an application that will have iOS, Android, and other platform compatibility. In other words, I want to write 1 app and get compatibility versions for different platforms.
By reading the "Get Started" guide linked by the PhoneGap website, I found there are different procedures for different platforms. So to have compatibility versions across platforms, do I have to go one-by-one and change all of them if I make a modification to my app?
Also, what exactly is PhoneGap Build? It seems like I can avoid all that hassle mentioned previously and toss my app into the PhoneGap Build? Do I really not have to do anything besides writing the app? What if I need to make changes?
And finally, I've read that PhoneGap works with HTML, CSS, and Javascript, but not PHP. What if my app needs to contact a server? Can PhoneGap handle that?
Thank you for bearing with all these questions!
PhoneGap achieves platform compatibility by embedding a webview within your application. Therefore you can apply your knowledge in HTML, CSS, JavaScript and it additionally provides ways to interact with native features (e.g. camera, gps, ...).
With PhoneGap you write one general web app, tweak parts for the specific platform (sometimes you do not have to this at all) and build it for that platform. The latter can be handled with PhoneGap Build service: It takes your webapp and bundles it for the mobile operating systems out there (Embeds it within a Java app on Android, an Objective-C app on iOs)
PhoneGap is able to communicate with a server hosting a PHP script just as every other web application. Trying to dynamically load resources from remote sites can be quite a hassle but this is another question.
traumalles is correct. All your HTML/Javascript/CSS is running from within a webview on the device. Your code is, therefore, all "client-side." You can communicate with a server just like with any other page. When they say PhoneGap isn't compatible with PHP, they mean only that PhoneGap can't execute PHP code like it's a server, because it's not. It's just loading your webapp in, basically, a browser.
One other important question is what exactly do you mean with "other platforms" phonegap does provide many functionality for nearly every platform but the different webbrowser of the mobile devices have their problems and limitations.
For example are there many problems if you want to provide your application on a WindowsPhone Device because the Webbrowser has a few limitations which will cause your app to not look and behave like a native app.
Just look a bit through the phonegap API you will see that some functions are just available for IOS or for Android and there are a few only Blackberry methods and so on.
So you really have to be careful when a framework tells you it will work on all devices.
So i really don't have a problem with phonegap i worked with it very great but there will be limitations you have to deal with.
If you primarily want to develop for IOS and Android you can really achieve great native like results !
Even after searching PhoneGap's website and their support group, I still cannot find an answer to my question:
Currently, I'm planning on developing an application that should exists as a pure HTML5 application, being able to run in any modern browser (Google Chrome, Safari, etc.) as well as on Android/iPad as native mobile applications.
So my question is:
Is it possible to use the same code base to develop both pure HTML5 applications as well as native mobile applications with PhoneGap?
PhoneGap is in effect a runtime environment for HTML, javascript, and any CSS that may accompany your code. So in short:
Yes, but it is recommended that you have some knowledge of Objective-C if you want to develop any iPhone app with extended functionality. If you have the right dimensions/proportions for the code there is no reason why you cannot simply copy that code into PhoneGap and compile it.
See, the support for #HTML5 varies from browser to browser, and varies a lot from a desktop browser to mobile browser. If one has to convert web-portal to a mobile application that can easily be done through Phonegap, you can refer to this link also. https://build.phonegap.com/ It worked fine for me.
Now lets come to Phonegap, what phonegap does is it has created wrapper through javascript that calls the native apis. Now to show content they use WebView object which renders your html5 page in your app. And you can create your own wrappers too. Not that much difficult.
So if your app is only a web based portal, that does not need much native access, you can easily reuse one codebase make #cross-platform apps using Phonegap. Else you need to go for hybrid apps.