Is the default Android webview an option for you?
Hi, thanks for the reply!
Sure, I can give it a try, but I don't know how to implement it to my app using PhoneGap. Do I need to simply put a line of code in the config.xml? Or there's more that needs to be done?
Just remove the Crosswalk plugin from your config.xml; the android webview will be used by default.
Nothing to implement, just remove the crosswalk plugin reference from your config.xml. PhoneGap by default uses each platform's built-in webview, unless you direct it to use some other third-party webview (such as crosswalk).
Actually that's what I have done. But I am facing issues like the window sometimes gets rescaled (doesn't fit the screen), the screen is blinking and sounds start playing only when the screen is touched.
I had none of these problems with crosswalk webview, any idea why is this happening?
You'll see different behaviour depending on the webview that is rendering your app, to be expected.
For your issues specifically
- windows sometimes gets rescaled:
Try playing around with the viewport in your html file(s) -- here's an example viewport declaration:
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
- the screen is blinking
- sounds start playing only when the screen is touched
what sounds? how are you triggering them?
Here's what I've got:
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui" />
What would you suggest me to modify here?
As for the issue with the sounds. Literally, every sound starts playing only when I touch the screen for the first time. I am sure my sounds are triggered correctly, also this was not the case for Cordova Crosswalk Webview.
The xml code I found above is for iOS actually. I have found this comment above it: <!-- Allow fullscreen mode on iOS devices. (These are Apple specific meta tags.) -->
I have read somewhere that on iOS sounds are started only when you tap the screen, and this problem with the window..... Does this mean that this data somehow conflicts with the Android data? Cause I'm building for Android.....
Should I add the same line of code below where it says <!-- Chrome for Android web app tags --> ?
I tried changing the index.html file a milion times and there are no changes in the app. The problem is still there..
What else may cause this problem? I am really stuck 0_0
Are you using a library to play your sounds? A lot of them come with tap detection so that they work on iOS, and that may be getting in the way. They also usually come with some way to configure that, so you could add the `cordova-plugin-device` plugin, check if the device is an Android device and disable it.
As to the rest of your problems -- screenshots / video might be useful to see what's actually going on. Also, what device(s) are you testing on, and what version of Android? Double check to make sure your Android system webview is up-to-date as well (it comes from the play store on Android 5+).
No I am not playing my sounds using a library..
I am testing on a Samsung Galaxy Grand Prime 5.1.1 Android
Okay, I tested the app on a different device (Xperia Z3) with 58.0.3029.83 WebView (my WebView version is 55.0.2883.91)
And the problem with the viewport is gone, but the screen flickering is still there and the sounds start playing only when you touch the screen..... :/
Also, on my device, the video Ads I have in my app are stuck at the beginning and keep restarting, while on Xperia it's cutting....
Surprised there's a viewport difference between v55 and v58 -- may be more related to the device than anything else. How do the screen sizes and resolutions compare on the two devices?
As to the flickering -- it would help to see a video of this in action to see what you mean.
Sounds: going to need to see some code showing how you're playing sound.
Ads: I don't understand what you're getting at here... perhaps a video would be of use.
The screen size of Xperia is 1920x1080
While on my phone it is 960x540
The flickering (or screen blinking) is a common issue, the screen just becomes black (actually it's the color of the background, in my case it's black) for a fraction of a second and then it goes back to normal. It is really annoying.
As I said, all sounds are played properly, and when using Cordova Crosswalk Webview, the music would play on the start of the layout as it should be. I haven't changed nothing since then, this problem occurs only on a phone, and I am testing it on my PC as well...
There has to be a solution for this problem, there are apps with APK no bigger than 10MB which have no such issues. Why do I have to use Crosswalk Webview and get +25MB APK so my game can be played?