Any improvements to C2?

Discussion and feedback on Construct 2

Post » Tue Nov 08, 2016 11:34 am

glerikud wrote:
MPPlantOfficial wrote:I only have android 4.5. I will try that Cocoon io . :D

Then you'll have to make friends with the Chromium browser bundled with your game. This is the most efficient way of running HTML5 code as an app. I don't think that either of the options we listed in this topic will free your from that additional size. In 2016 that +20-30MB shouldn't be a problem. And if you target Android 5+ then the WebView is already on the phones, so your apps can be smaller.


I built my games without Crosswalk and got a 3.5 mb APK. 12 mb when installed. However I did notice very long load time opening the games.

What is "Webview?" the default browser I have on my CAPX file is Chrome. Should I switch to Default?
Image Image Image
B
29
S
11
G
27
Posts: 729
Reputation: 16,995

Post » Tue Nov 08, 2016 8:58 pm

MPPlantOfficial wrote:What is "Webview?" the default browser I have on my CAPX file is Chrome. Should I switch to Default?

It displays web pages to put it simply. Google the term to find more detailed information. Here's one link: https://developer.android.com/reference ... bView.html
B
129
S
33
G
17
Posts: 1,552
Reputation: 20,515

Post » Thu Nov 10, 2016 6:41 am

glerikud wrote:
MPPlantOfficial wrote:What is "Webview?" the default browser I have on my CAPX file is Chrome. Should I switch to Default?

It displays web pages to put it simply. Google the term to find more detailed information. Here's one link: https://developer.android.com/reference ... bView.html


Yes I did search the term but I don't know how to actually implement that upon exporting CAPX.
So I'm supposed to set browser to default and select Android 5+ then that Webview thing will automatically be included thus decreasing my install size? :)
Image Image Image
B
29
S
11
G
27
Posts: 729
Reputation: 16,995

Post » Thu Nov 10, 2016 7:21 am

@MPPlantOfficial Android system WebView is a kind of browser which is installed separately. It does not include into your APK, that's why the APK size is lower if you build it without Crosswalk. The point is that if you export with Crosswalk, your app will be launched in that Crosswalk browser which is included in your APK. So it will be the same browser for all devices which means your game will behave the same way on each of those devices.

Now when you export without Crosswalk then your game will be launched in the system's WebView. In other words, your game will run in the browser which is installed on the particular device. Now each device might have different version of WebView installed. Different versions support/not support different features so there is no guarantee that your app will behave the same way on every device. I would even say, it is guaranteed that it will not.

Now regarding Android 5+ which everybody talk about. Shortly saying Android 5+ WebViews support most needed features and C2 apps should work well and you shouldn't need the Crosswalk any more.

My personal opinion after some tests is that Crosswalk is still more safe to use and has better performance that native WebView.
ImageImage
B
27
S
16
G
68
Posts: 946
Reputation: 38,601

Post » Thu Nov 10, 2016 7:32 am

BackendFreak wrote:@MPPlantOfficial Android system WebView is a kind of browser which is installed separately. It does not include into your APK, that's why the APK size is lower if you build it without Crosswalk. The point is that if you export with Crosswalk, your app will be launched in that Crosswalk browser which is included in your APK. So it will be the same browser for all devices which means your game will behave the same way on each of those devices.

Now when you export without Crosswalk then your game will be launched in the system's WebView. In other words, your game will run in the browser which is installed on the particular device. Now each device might have different version of WebView installed. Different versions support/not support different features so there is no guarantee that your app will behave the same way on every device. I would even say, it is guaranteed that it will not.

Now regarding Android 5+ which everybody talk about. Shortly saying Android 5+ WebViews support most needed features and C2 apps should work well and you shouldn't need the Crosswalk any more.

My personal opinion after some tests is that Crosswalk is still more safe to use and has better performance that native WebView.


Thank you very much! :)
Image Image Image
B
29
S
11
G
27
Posts: 729
Reputation: 16,995

Post » Thu Nov 10, 2016 8:54 am

MPPlantOfficial wrote:Yes I did search the term but I don't know how to actually implement that upon exporting CAPX.
So I'm supposed to set browser to default and select Android 5+ then that Webview thing will automatically be included thus decreasing my install size? :)

You just export your game with the Cordova export option. Then you can set in the XDK if you want to build your game with or without Crosswalk.
B
129
S
33
G
17
Posts: 1,552
Reputation: 20,515

Post » Thu Nov 10, 2016 9:19 am

glerikud wrote:You just export your game with the Cordova export option. Then you can set in the XDK if you want to build your game with or without Crosswalk.


Hey @glerikud do you know how to set Cocoon to build with or without Crosswalk? After reading through this thread I decided to do some tests myself, so I exported for Cordova specifying Android 5+ as the minimum supported Android OS > Compiled in Cocoon > Installed on my phone and did some tests etc.
But now, I cant seem to get Cocoon to go back to compiling with Crosswalk... If I specify Andoid 4.0 (Crosswalk) as minimum OS in my Cordova project, then Compile in Cocoon, now its only giving me the small apk (~12MB) thats not wrapped in Crosswalk. Previously my apk would be ~30MB... I think I screwed up a setting in Cocoon somewhere.

And for the record. I totally agree with @BackendFreak 's statement
BackendFreak wrote:My personal opinion after some tests is that Crosswalk is still more safe to use and has better performance that native WebView.

My testing gave the same result, Crosswalk gives better performance than native WebView. Plus, for me not having Crosswalk broke my music playback. Apparently its a known bug that music wont start playing in Chrome for Android (=native WebView?) until first touch (gah!)...
B
66
S
46
G
57
Posts: 387
Reputation: 35,721

Post » Thu Nov 10, 2016 11:01 pm

@glerikud, disregard my previous question, after getting some help on the cocoon forum it looks like this a bug with cocoon. They are working on fixing it now.
B
66
S
46
G
57
Posts: 387
Reputation: 35,721

Post » Thu Nov 10, 2016 11:19 pm

Artpunk wrote:
glerikud wrote:My testing gave the same result, Crosswalk gives better performance than native WebView. Plus, for me not having Crosswalk broke my music playback. Apparently its a known bug that music wont start playing in Chrome for Android (=native WebView?) until first touch (gah!)...


Im getting an extra 10fps using crosswalk over webview, so ill take the 20mb hit.
Image
B
29
S
9
G
3
Posts: 170
Reputation: 3,297

Post » Fri Nov 11, 2016 9:24 am

gameglaux wrote:Im getting an extra 10fps using crosswalk over webview, so ill take the 20mb hit.

That's good to know about native WebView.

@Artpunk Sorry, I wasn't online. I don't use Cocoon.io, so I can't help you with that.
B
129
S
33
G
17
Posts: 1,552
Reputation: 20,515

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: kanjmarrie, RoboticPhoenix and 6 guests