How to update Android Webview version?

Post Reply
adam1128
Posts: 3
Joined: Sat Oct 22, 2016 9:24 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

How to update Android Webview version?

Post by adam1128 »

tl;dr:
I've downloaded the most recent andriod system webview but the odroid android 5.1 doesn't seem to use it, and instead sticks with the built in webview, which is > a year old, and very buggy. How do I get odroid to use the new webview?

In detail:
I'm pretty new to hacking hardware, so apologies in advance. I recently bought a C2, and installed the latest HK android version (Android 5.1.1 (v2.3)). I'm running a webRTC web app. It's built into an APK using a webview. When I run the APK, getting the local video from my usb webcam is very jittery, and crashes after 5-10 seconds. (I've tried a lot of webcams, all the same). However, when I run the web app on the latest android chrome browser on the C2, it works perfectly, and the video is perfectly smooth.

I figured the webview was out of date, as I've seen this kind of thing before with the old webview that was built in to android 5. Google decoupled the webview from the OS soon after android 5 came out, so I installed the google play store and downloaded the most recent version of the system webview from there (Version 53.0.xxx). Normally, android will just use this automatically. I fire up the APK, but the app crashes again. When I look at the webview user agent string in my app, it's still using the very old webview (non-decoupled) that was built in to android, which is based on chrome v39:

Code: Select all

UA: Mozilla/5.0 (Linux; Android 5.1.1; ODROIDC2 Build/LMY49M) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/39.0.0.0 Safari/537.36
In contrast, if I run this on my lenovo android tablet, which also has the newest webview installed, I see it's using the most recent (decoupled) webview:

Code: Select all

UA: Mozilla/5.0 (Linux; Android 5.1; Lenovo TAB 2 A8-50F Build/LMY47D; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/53.0.2785.124 Safari/537.36
And the app works perfectly well on the lenovo, using the current webview version. (After checking, it seems the 'wv' after the build number signifies that the decoupled webview is being used. It's not there in the C2's user agent string, so the built in webview is being used.) Anyway, this is a major problem for me, because I need webRTC to work in the webview, and at the moment it simply crashes. How can I get the C2 to use the updated webview? It's a total blocker to this project, and I'll have to move to some other hardware platform otherwise, so any help would be really appreciated. Thanks!

adam1128
Posts: 3
Joined: Sat Oct 22, 2016 9:24 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: How to update Android Webview version?

Post by adam1128 »

Hey Odroid, any update on this? Using the webview app from the play store is standard Android 5 functionality, but it's not working. Any ideas?

User avatar
odroid
Site Admin
Posts: 34859
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 933 times
Been thanked: 760 times
Contact:

Re: How to update Android Webview version?

Post by odroid »

I have no idea about the webview version management in our BSP.
Is the Chrome using the system webview framework? or its own webview?

adam1128
Posts: 3
Joined: Sat Oct 22, 2016 9:24 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: How to update Android Webview version?

Post by adam1128 »

I am sure that Chrome doesn't use the system webview, it is entirely separate.

In android 4, the webview was coupled with OS, and could not be updated separately. In Android 4.4, google chose to base the webview on Chromium
https://developer.android.com/guide/web ... ating.html

In Android 5, google decoupled the webview from the OS, and made it an app, so it could be updated monthly:
https://www.sencha.com/blog/android-5.0 ... -promised/
http://www.androidpolice.com/2015/03/10 ... p-to-date/

I would therefore expect that downloading the most recent webview in the Odroid Android 5 would cause that new version to be used by the android system. You'd think that the downloded webview would just overwrite/update the old webview that comes bundled with the OS. Maybe the odroid system doesn't recognise the new webview download as a new webview version?

User avatar
odroid
Site Admin
Posts: 34859
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 933 times
Been thanked: 760 times
Contact:

Re: How to update Android Webview version?

Post by odroid »

The system partition is read-only and it will not over-write the webview.
The downloaded new webview should be stored in the user-data partition.
So there should be an information about the new webview location path in somewhere. But I have no idea how AOSP handle it.

OverSoft
Posts: 22
Joined: Wed Feb 01, 2017 5:34 pm
languages_spoken: english
ODROIDs: C2, XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: How to update Android Webview version?

Post by OverSoft »

Is there a solution for this? We really require the newer Webview versions to run on our systems.
On systems like the Minix U1 (which is really the same system (chip and software)) we can just update the WebView by installing a new Android System Webview, but on this system it seems that the webview is branded Odroid and that's why it doesn't update the WebView (there are two different WebViews installed when you view all the apps).

This really breaks the product in my opinion, since we can not update to the latest version and it's running on a year and half old browser engine.

OverSoft
Posts: 22
Joined: Wed Feb 01, 2017 5:34 pm
languages_spoken: english
ODROIDs: C2, XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: How to update Android Webview version?

Post by OverSoft »

Btw: i've found out how the CyanogenMod guys did it here:

https://github.com/CyanogenMod/android_ ... l/82/files
https://github.com/CyanogenMod/android_ ... l/83/files
https://github.com/CyanogenMod/android_ ... l/84/files

Now, i can patch this myself in the Android source, but i'd like to keep up with the normal updates, so it would be great if you guys would implement this too.

User avatar
odroid
Site Admin
Posts: 34859
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 933 times
Been thanked: 760 times
Contact:

Re: How to update Android Webview version?

Post by odroid »

If you can confirm it works on your C2, we will merge the patch into our Android 6 source tree.
Please try the patches and get back to us.

OverSoft
Posts: 22
Joined: Wed Feb 01, 2017 5:34 pm
languages_spoken: english
ODROIDs: C2, XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: How to update Android Webview version?

Post by OverSoft »

Yes, i've just installed the new firmware. You only have to use the 83 and 84 patch. (82 hard codes the updated Android Webview, don't use that)

It will use the default included WebView if no Android System Webview updates have been installed, but it'll use the updated WebView if that is installed.

/edit:
A small extract from my logcat:
03-01 08:22:51.568 4590-4590/my.app I/WebViewFactory: Loading com.google.android.webview version 56.0.2924.87 (code 292408700)

User avatar
odroid
Site Admin
Posts: 34859
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 933 times
Been thanked: 760 times
Contact:

Re: How to update Android Webview version?

Post by odroid »

We will try those two patches.

BTW, do you think it is applicable to our Android 6 AOSP BSP too?

OverSoft
Posts: 22
Joined: Wed Feb 01, 2017 5:34 pm
languages_spoken: english
ODROIDs: C2, XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: How to update Android Webview version?

Post by OverSoft »

I haven't downloaded the Android 6 source yet, but from what i know (i am also developing on the XU4 on multiple Android versions) is that WebViewFactory hasn't significantly changed, so it should work.

It's actual a pretty simple patch, the old WebViewFactory looks for a package named: "com.android.webview" and loads it.
The Android System Webview packages is actually named "com.google.android.webview", so that never gets loaded in the old situation.
(That's why overwriting the default webview on the system partition with the newer Google Android Webview will not work, because it's not named "com.android.webview")

The new situation looks for "com.google.android.webview" and if that doesn't exist, it falls back to the default "com.android.webview".

User avatar
odroid
Site Admin
Posts: 34859
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 933 times
Been thanked: 760 times
Contact:

Re: How to update Android Webview version?

Post by odroid »

We will include the patches on Android 6 soon.
We've tested it and the newer Google webview was loaded well on Android 6.

BTW, can you give us a link of webRTC web app?

User avatar
odroid
Site Admin
Posts: 34859
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 933 times
Been thanked: 760 times
Contact:

Re: How to update Android Webview version?

Post by odroid »

New Android 6 Marshmallow update has been released.
http://odroid.com/dokuwiki/doku.php?id= ... allow_v2.4

OverSoft
Posts: 22
Joined: Wed Feb 01, 2017 5:34 pm
languages_spoken: english
ODROIDs: C2, XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: How to update Android Webview version?

Post by OverSoft »

It's not my app, that was someone else. ;)
Webview 55+ has a significantly improved screen redraw speed. We're using WebView quite heavily in our app (a digital signage / narrowcasting app), so every improvement in display speed is great.

User avatar
odroid
Site Admin
Posts: 34859
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 933 times
Been thanked: 760 times
Contact:

Re: How to update Android Webview version?

Post by odroid »

Thank you for the confirmation.

Post Reply

Return to “Android”

Who is online

Users browsing this forum: No registered users and 2 guests