My questions is :
1 -- Is it possible to have a WebView( Provided by Native framework) instance in my Native App , and extend it to support Webrtc,
if 1 is Yes, then probably following would be the action Item
1 -- Have a webrtc build on Android, 2 -- In Android WebView extend Javascript to couple / bind the Webrtc call,
Please confirm..
What i am trying to do is
1 -- We have webrtc based Voice / Video chat application working fine in Chrome & Mozilla desktop Browser, as both comes with webrtc... , i.e. user need to access www.xyz.com and it will start video / voice sessions,
2 -- same thing on mobile, we would like to go as a native app, i.e. we are trying to make an application, which will have native WebView instance, in which we will access www.xyz.com to have voice / video session
3 -- I tried the way i explained in 2 but it seems, in WebView instance provided by Application framework doesn't have webrtc enabled in it, so i am trying to add it and this is what i am thinking,
-- WebView instance has some mechanism to extend the Javascript , that means
http://dev.w3.org/2011/webrtc/editor/webrtc.html
some of these API i need to add into the WebView, and for their implementation will come if i am able to successfully integrate and build Webrtc over android and iOS Platform
Please comment....
If you want to use webRTC in a Native App, i've built a small android app (https://github.com/pchab/AndroidRTC) that share the back camera to a nodeJS server (https://github.com/pchab/ProjectRTC).
I found that the easiest way to use the libjingle library is with IntelliJ IDEA. I've had a lot of problems with Eclipse and Android Studio.
You're going to have a hard time with the WebView, although it's coming on (newer) Android at least. Nothing on the horizon for iOS.
If you want complete native, you can check out what we've done # FM with IceLink, sounds like it might work for you.
Android WebView does not support WebRTC APIs at this point.
Work is underway on Java an Objective-C bindings, though that may not solve your problem.
With Android L release this should be possible by using just the Android WebView, more below :
http://developer.android.com/about/versions/android-5.0.html#WebView
I know this question is kinda old, but I find crosswalk (https://crosswalk-project.org/) to be a pretty good solution for using WebRTC inside of an Android app. What crosswalk do, is compiling a chromium browser into an Android app and hosting your site inside of this chromium, so you will have support for the latest browser features, like WebRTC.
I'm building a native app with a webview and webrtc video inside.
So generally it is possible to build such application and nowadays chromium (webview) have a official support https://developer.chrome.com/multidevice/webview/overview , but I have faced really a lot of problem during writing that application.
Few problems are:
Support for phones and os version - I have android 5.1.1 (xperia m2) and after a lot of problems webrtc is running. On android 6 (xperia z5 compact) is not working.. On other phones is sometimes working sometimes not...
You can not be sure, how webview will work - today webrtc is working, but tommorow Google can add some security rule, and it will not work- it's a little bit unstable, and as I have seen, some things depend on os compilation. WebView can get update from store independently of os.
PERMISSIONS - there are a lot of stupid problems, based on the fact that is it a browser inside native app, like - you can't expect a permission question from webview, you have to implement it in android webview config, and in some android versions it is working- in others not :-)
Still a lot of problems of 'young product' - example is that nowadays webview has some issue with devices info display (like camera is front or back) so you have to find a workaround for such problem
Bad video quality - currently my problem is a quality of video- nice quality of video on phone, below maximum resources consumed (cpu, network, memory) and video on computer is really poor...
...and many more
So the fact is - yes this is possible, but it's still not good enough to use it without facing a lot of problems which are not so easy to solve.
You can actually go native with html5 features. So if you use Crosswalk as someone mentioned before, but if you are really set against using: Crosswalk/Ionic/Angular/Cordova (which is awesome), you can still use Crosswalk in a native environment to replace inconsistent and feature lacking WebViews with 1 single, full WebRTC compatible WebView based on the Blink Engine.
I remember reading a few guides on how to get Crosswalk going in Android Studio, here's one I quickly searched, but just Google around there's a bunch of them.
https://www.snip2code.com/Snippet/34721/How-to-use-CrossWalk-runtime-within-an-A
Related
I am making an application which gives support to webRTC for android & ios both for this I make a lot of R&D then I found an Ionic framework to support both platforms. you can see here/ionic. no doubt it is a powerful tool for us in nowadays. and for supporting webRTC I have used crosswalk. because internally ionic use phone`s browser means for android it uses Chrome and for ios ,safari but the issue was there: older version of Chrome did not support for webRTC and safari did not till now. so with crosswalk webView all thing is working fine means calls are getting connecting and user A and B can communicate utterly but I am facing an issue of apk size which is also mentioned # crosswalk issues tracker. I have done all possible ways to reduce the size of apk which is mentioned there - by generation two apks , but apk size is still more than 25 mb.
I found another way was to disable all instead of WebRTC -but I am not sure ,will it works or not / how to do that?
so can you please let me know how to solve this issue with the crosswalk. or is it possible or not ? if it is then how can I do this else please give me some references of plugins(webVisew) which supports webRTC.
thanks in advace.your help can save me thanks.
This is not my first hybrid app (I've published apps on both Google Play Store and Apple Store). My target platform is Android. I'm not sure which versions will be supported, I will determine that later if I decide to publish this idea at all.. I'm using Phonegap Build.
I'm having some trouble getting the HTML Download attribute of the A element to work. Here's what I have:
<a download href="http://static.guim.co.uk/sys-images/Guardian/Pix/pictures/2014/4/11/1397210130748/Spring-Lamb.-Image-shot-2-011.jpg">Lamb</a>
If I remove the download attribute, the image opens in my phonegap app (Android). With it, nothing happens though. Works fine in at least Chrome, too. Any ideas?
#Robbert,
I answer alot of Cordova/Phonegap questions like alot of volunteers on this forum. As such, you might find this FAQ useful.
Top Mistakes by Developers new to Cordova/Phonegap
From this FAQ, you want to be aware of #5 - Phonegap is not a webserver or a webbrowser. This is common mistake. It is true you can use your webbrowser to test you pages, but don't be fooled into thinking that all webbrowsers are the same. As Paul Irish likes to remind use "Not all webbrowser are equal". His article Webkit for Developers is a good read.
I quote
Different ports can have different focuses. The Mac port’s focus is split between Browser and OS, and introduces Obj-C and C++ bindings to embed the renderer into native applications. Chromium’s focus is purely on the browser. QtWebKit offers its port for applications to use as a runtime or rendering engine within its cross-platform GUI application architecture.
To be clear, Phonegap uses a library called webview (with Android, and similar on other platforms). The current incarnation is based on Chromium's "webkit", but previously it was based on an old version of Android "webview" - which was around for years. However, even with the attribute you are looking for may not be available.
The best was place to start is caniuse.com. A search for download shows that download is mostly supported, but missing is IE, Safari, and Opera. Otherwise, it appears it is available, but only for Android after 4.4. Looking at my notes this appears to coincide with Android starting to use Chromium's webkit, and not the dated webview library — as i stated before.
Possible Solutions
As #jcesarmobile alluded to you can use
cordova-plugin-file-transfer
_OR_
You can try another webview library that might have the attribute you are looking for
- like crosswalk.
At this time, crosswalk only supports Android, but there are also a few beta version you can also try that are in the repository. And, if your target platform is iOS, then use WKWebview instead.
NOTE the standard webview library is already on your mobile device, crosswalk is separate and will add at least 20megabytes to your app.
Yesterday I tried using Phonegap with a web app that uses angularjs and angular material. The performance is very slow on my device (ASUS Zenfone 5 running 5.0) including the animations and keyboard input which takes about a second before a character shows when typing. I've researched about Phonegap's performance and some says that I should try to use Crosswalk Project but still, the performance isn't good.
To my curiosity, I built an android app which uses the Android native WebView that uses WebChromeClient and the performance is better than a Phonegap + Crosswalk, but why? Isn't Phonegap also uses the Android native WebView then just load the site as an asset?
As far as I know, Phonegap/Cordova use the Chrome webview. By using Crosswalk, you ensure that you always use the latest Chrome webview, independent of what Chrome version is actually installed on your phone.
It could (but I think it's unlikely) lead to a difference in performance. What I expect however, is that some Cordova plugin you loaded is the culprit. I've seen (and read about) plugins that just drop the performance of your whole app.
EDIT:
I've only done one experiment with Angular Material myself, and I wasn't experiencing any real performance issues at the time, but I did read some people writing about it being slower than plain Ionic.
My suggestion would be to try to build an Ionic app (it's just plain Angular with performance optimizations and some handy directives). If you want to have Material Design for it, you can try Ionic Material. I made the switch to that, because I found some very hard to track issues with Angular Material, and it didn't follow the Ionic way of doing things.
Ionic Material has to easy to access documentation yet, but their Demo is full of code examples
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);
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