for the last months I developed several HTML5 Apps with Cordova.
Cause I saw some performance struggles on some devices I used the Crosswalk plugin.
Crosswalk adds a standalone chromium version to cordova so the HTML5 app (mostly a game) will open in the more powerfull webview.
Now I want to build a native Adnroid Library (aar) with an API so other developers cann just call a function and a new webview (or activity with an webview) will appear so the user can play the game. So this has nothing to do with Cordova, at all.
The question:
Does someone know some kind of "crosswalk" for a native a android project?
The best solution would be something like another aar which I can hook into the project :)
Thanks in advance
Tom
Okay! I am a bit stupid.
The answere is also Croswalk!
I thougth this is only for Cordova/Phonegap.
Here you can find how to implement crosswalk with a simple native Android application!
I just downloaded a crowwalk aar and imported it to Android Studio.
Related
I have a Polymer web app. I need to deploy it to mobile Android and iOS devices.
I have my vulcanized dist directory after running gulp.
I have a hosted URL.
Question
Now what do I do? What steps do I need to take? (And where is the documentation?)
I tried using PhoneGap Build but encountered compatibility issues.
This SO answer pretty well documents that PhoneGap Build does not support Polymer at this time.
There is article written by Eric Bidelman on
Using Polymer in a WebView. How to setup Polymer in an Android WebView app.
Here is the link.
https://www.polymer-project.org/0.5/articles/webview.html
We have built an in-house mobile applications with Polymer and Cordova.
It generally works with android 4.4 onwards since WebView for android 4.4 onwards is based on the chromium project.
As for iOS 8.1 onwards, we thus far have not encountered any issue. Note that Polymer will not work on iOS7 & below.
Should you need more modern web API, you can include Crosswalk for Cordova.
Hope that helps.
That's me. I look further into that.
I talked to my friends in that group, they know of no such projects.
However, they did express that it was possible, IF the web library supported ECMA5 (the Javascript standard). I looked into it and found that potentially there is support
However, I do not have any evidence that this will or will not work. The best I can say is to try the following.
Build the library on a local machine (your PC) to make sure you understand it.
Build a Cordova/Phonegap Application with the new Crosswalk Webview Library.
Find a very simple Webcomponent you can test with. Something equivalent to "hello world".
Test
Please let me know how this works out.
Best of Luck,
Jesse
Can't say I've found good documentation on this apart from this tutorial on using Apache Cordova with Polymer (though this is Polymer 0.5):
https://blog.nraboy.com/2014/07/use-polymer-apache-cordova/
I've been successful (so far) in using Cordova to build my polymer app and it runs successfully in a browser and on Android (haven't tried iOS yet).
I put all of my html and css in the 'www' directory of my Cordova project and have had no issues with build.
For android the simplest approach would be to create a webView and load your url to it. This kills most of the compatibility issues.
As rendering engine of chrome and web-view are both webkit based, most of thing that runs in chrome,will run in webview as well.
For details
https://developer.android.com/reference/android/webkit/WebView.html
how to display progress while loading a url to webview in android?
Similar thing can be done at IOS as well..
iOS: WebView Loading a url
It will definitely going to increase your workload a bit, however it does give you presence in both app stores.
I want to create a Android Application.
Altough I want to use HTML5 for creating that application.
Later on I even want to get the application to multiple platforms like for Apple.
I have tried Eclipse but couldn't get it to work.
When I create a new "Project > Web > Dynamic Web Project" I can't export this into a Android Application.
PhoneGap looks interesting.
Although I'm not sure how you can create a .apk (for android) there.
Or should this work together with Eclipse?
Could anybody give me a headstart?
What Application should I use to make a HTML application?
How do I create a .apk file?
Thanks in advance.
If you really want to dive right into developing with Phonegap, you can try out Telerik's AppBuilder (http://www.telerik.com/appbuilder). The demo project uses KendoUI Mobile (which I can also recommend) is comprehensive enough for anyone. As far as I recall you can use it for free for up to 2 projects.
There is also Intel's XDK (http://xdk-software.intel.com/), which is completely free - but the simulator and deployment features aren't as far developed as Telerik AppBuilder's are.
I strongly recommend AGAINST doing it the "real way" with eclipse/xcode if you have no prior experience with developing native android/iOS apps.
Start with the following project:
http://code.google.com/p/html5webview/
This will give you a good start. You can download it and import it into eclipse.
Phonegap does create an APK.
Essentially what Phonegap does is present a WebView and a simple API for calling native methods on the respective platforms. This allows you to write the same app and deploy it on multiple platforms with minimal or no changes. The majority of what you would do in Phonegap is set up the projects to pull in the cross-platform libraries.
The major limitations come from lack of access to native UI components. As you progress in app development you may find that it's a significant limitation. I rarely build HTML5-based UIs anymore, and instead go with native apps.
There are other cross-platform frameworks out there as well. Here's an article describing some pros and cons of each:
http://www.developereconomics.com/pros-cons-top-5-cross-platform-tools/
I am developing a native SDK which is integrated into a native app ("host app"). The app is calling my SDK method and this method will open a Webview (both for iOS and Android).
I looked into Phonegap as a solution, and saw that it gives me a platform for opening a Webview and communicating with the device. While this is ok, I cannot find a way to build this as the "SDK app" that I wanted, triggered by host native app, without writing the native code for that myself (duplicating my code for iOS and Android and dealing with native code).
Does Phonegap (or other platforms) have the ability to add a native logic (and not only webview) without the need to duplicate my code?
tnx!
Yaniv
PhoneGap is for developing apps. It is not really for third parties to create a library for others to use. While you can try to twist PhoneGap (and similar solutions) to serve that role, that will add extra baggage for anyone who would want to integrate with your library.
Hence, I suggest that you just create a library, sans PhoneGap.
In my team we are developing an application which is going to be played on tablets, the project has been largely developed and tested on Google Chrome.
At this time we are inserting this webapp on Apache Cordova in order to display it as a native application on Android (and later on iOS), but the app doesn't displays well on the tablet, this because of the WebKit version, which varies on every Android version and does not work as in Chrome.
The question is... There is any way to change the webkit version which operates with Apache Cordova? (or any other web rendering engine)
There is no way at this current time to change the Webkit version used by Apache Cordova - this is because Cordova uses the native Android WebView component, which is based on an old Webkit version. The native Android WebView is quickly becoming the IE 6 of the mobile world, if it isn't already.
EDIT WHOOO! Android 4.4 announced that the default WebView will now be built on top of Chromium! This means that Cordova apps running on Android 4.4 should run much faster (new JS engine) and support more features (HTML5 things.) There is still a lot of confusion around this new WebView and what it means. The best article I have read so far is here: http://www.mobilexweb.com/blog/android-4-4-kitkat-browser-chrome-webview
A lot of people have realized that this is becoming a big problem with Cordova apps. There has been some experimental work to build a version of WebView that uses the Chromium source (and thus an updated version of Webkit (Blink?)), you can view the code here: https://github.com/pwnall/chromeview Check out the "issues" tab and follow it; I've been getting a few emails every week from people filing issues. I think some forks are ahead of others and hopefully they are getting close. (According to Cordova mailing list archives, Opera was able to get this working on 2.2 but I can't find any code or anything more than a passing reference.)
If you are able to get WebView built with Chromium, it shouldn't be that difficult to switch out which WebView class Cordova uses; I'm pretty sure this ability was already added to Cordova with this and similar commits: https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;a=commit;h=f6049881
I think a lot of people are holding their breath that Android 5.0 will finally have an updated WebView that uses Chromium source and will be updated in sync with Chromium... if so, that'll be awesome, but it still leaves us with 4.0 and below that doesn't seem to work at all.
I'd suggest checking out CrossWalk. It's developed by Intel and uses the Blink rendering engine (same as chrome). You package it with your cordova app and then you can use same the Web rendering engine across all devices and versions 4.0+.
https://crosswalk-project.org/
Note: It adds about 20MB to your app's size, but I'd say that's minor for the headaches it would save you in cross device/version testing that you'd have to do.
Check out here to get started with crosswalk and cordova..
https://github.com/crosswalk-project/crosswalk-website/wiki/Create-Sample-App-With-Crosswalk-Cordova-Android
With the release of Apache Cordova Android 4.0.0, it supports "pluggable WebViews".
So, using Crosswalk with Cordova is just matter of installing the cordova-plugin-crosswalk-webview.
For our Android app, we would like to embed our own browser/rendering engine. The most likely candidate for this, is Webkit/Chromium. We are looking for something similar to WebView, essentially, but backed by a browser (version) that we control.
Background
Significant parts of our app consist of web page fragments embedded in the view (served by the app itself). We try to do this as transparently as possible (from a visual/user experience standpoint). So far, we have been using WebView for this and that works for the most part. Except when it doesn't.
Some phone vendors have unfortunately decided to tweak the standard Android browser here and there. In some cases, this breaks our app or makes the fact the we embed a web page more noticeable.
Our Idea
We'd like to have a component similar to WebView but where we control what version of Webkit/Chromium (or some other rendering engine) is being used. It wouldn't necessarily have to be the latest and greatest version. It is more important that we can get our app to work consistently across as many Android devices as possible.
So far
Our research so far has not turned up anything useful. We have found three dead attempts to port Webkit to NDK (the bare Webkit for Android port uses functionality not available in the NDK and thus not to app developers):
Webkit Android port by Company 100 (no updates for over two years)
mogo-browser (their last revision was to delete all source code)
NDK Webkit (officially abandoned by its author)
Looking on StackOverflow, we have also found a number of similar questions, most of which being solved by pointing to WebView (we already do that, and it's not good enough)
Webkit component for Android
Embed basic WebKit + V8 in my app
Embedding a newer version of WebKit with Android app
We are currently investigating whether Chromium for Android (or parts of it) can be turned into a library that our app could use. Has anyone else done this?
Update
After having a look at the chromeview project on GitHub (accepted answer), we decided that we'd rather wait for Google to release a Chrome-based WebView on future Android devices. The Chromium rendering engine turns out to be fairly large (~40MB), which doesn't leave much space for the actual app :(
pwnall/chromeview ยท GitHub
https://github.com/pwnall/chromeview
ChromeView works like Android's WebView, but is backed by the latest Chromium code.
You should all check out the Crosswalk project. Sponsored by Intel, and in active development. They pull the Chromium sources and promise to make all new Chromium features available in Crosswalk within 6 weeks.
Crosswalk is a web runtime for ambitious HTML5 applications. It provides all the features of a modern browser, combined with deep device integration and an API for adding native extensions. It is especially suited to mobile devices.
Crosswalk supports Android 4.0 and newer, on ARM and Intel architectures.
Within in one hour of finding this project, I had my Cordova/Phonegap app running on an Android phone with Crosswalk. I'm glad I don't have to adjust my Javascript code to respect the shortcomings of the (pre-4.4) android.webkit.WebView.
https://crosswalk-project.org
Without WebKit there is a GeckoView. Sure it adds over 20Mb of libs to the project.
Nowadays, GeckoView seems an alternative to consider
I tried to use lastest code version of Chromium to build a custom WebView and it's successful.
I will give my approach but not the source code here right now.
Eventually, the size of custom WebView library is about 30MB, quite big for some small app. But it's wonderful because can support perfectly from Android 4.0.
This below is my method:
fetch source code of chromium and build web_view_apk (AndroidWebView test shell) follow this instruction https://www.chromium.org/developers/how-tos/android-build-instructions
use apktool to decompile the apk file of Aw Shell above. https://ibotpeaches.github.io/Apktool/
create your project with res, lib folder as same as decompiled project.
Manifest file is located in /src/android_webview/test/src/org/chromium/shell
src folder: you find the classes in chromium project source code which are respective the files in smali folder of decompiled project.
I will update my code later, but you can try my guide now if don't want to wait.
I would consider Chrome custom tabs:
https://developer.chrome.com/multidevice/android/customtabs