kkashi's Recent Forum Activity

  • Okay, I think I got it resolved. The issue with exporting for Cordova and then using XDK is that the generated .apk gets too large; about 30mb. For those interested, here is what I did:

    1. Export for Amazon - select option to run on own server

    2. Created a simple Android app that basically has a webview and loads index.html as shown below. Built the .apk and instead of a .30mb .apk, I now have 5mb .apk for my sample app:

    webView.getSettings().setJavaScriptEnabled(true);

    webView.getSettings().setAllowFileAccessFromFileURLs(true);

    webView.loadUrl("file:///android_asset//index.html");

    -Hossein.

  • Well, I have created a simple android app. In the assets folder. In the assets folder, I have dropped-in all the c2 html5 exported files. Next, for my webview, I have enabled javascript and set the setWebChromeClient and the setWebViewClient. When I try to run the app, I get a message that says: "Exported games won't work until you upload them. (When on the file:/// protocol, browsers block many features from working for security reasons.).

    Above also happens when I directly run that from a computer.

    I just want to disable this default behaviour.

  • Hi, When c2 project html5 is exported, I'm not able to run it locally because c2 [1] checks for file:/// protocol and won't allow run. How can I disable this behaviour?

    [1]

    <div id="c2canvasdiv">

    <!-- The canvas the project will render to. If you change its ID, don't forget to change the

    ID the runtime looks for in the jQuery events above (ready() and cr_sizeCanvas()). -->

    <canvas id="c2canvas" width="1280" height="720">

    <!-- This text is displayed if the visitor's browser does not support HTML5.

    You can change it, but it is a good idea to link to a description of a browser

    and provide some links to download some popular HTML5-compatible browsers. -->

    <h1>Your browser does not appear to support HTML5. Try upgrading your browser to the latest version. <a href="http://www.whatbrowser.org">What is a browser?</a>

    <br/><br/><a href="http://www.microsoft.com/windows/internet-explorer/default.aspx">Microsoft Internet Explorer</a><br/>

    <a href="http://www.mozilla.com/firefox/">Mozilla Firefox</a><br/>

    <a href="http://www.google.com/chrome/">Google Chrome</a><br/>

    <a href="http://www.apple.com/safari/download/">Apple Safari</a><br/>

    <a href="http://www.google.com/chromeframe">Google Chrome Frame for Internet Explorer</a><br/></h1>

    </canvas>

    </div>

    Thanks,

    -Hossein.

  • Please take a look at my html5 JunglePerformer here: http://3nportal.com/temp/jp

    I wrapped that into Android webview (.apk here: http://3nportal.com/temp/jp/jp.apk ) yielding much smaller .apk

    The two boxes on top left/right are for touch/mouse buttons (I was lazy and didn't add in images).

    However, as you notice, on Android performance is slow because its communicating with files over the net.

    This is why I wanted to wrap the files locally into .apk

    -Hossein.

  • > I tried to create a simple Android app that uses WebView to load local file; c2 index.html. My thinking is to use this approach to load the html5 c2 exported app using WebView. A WebView can load a local file using file:/// protocol. However, c2 checks to see if protocol is file:/// and it will show error message. Is there anyway to overwrite this default behaviour?

    >

    > THANKS

    >

    [quote:oscvfibm]Maybe my tutorial will help you <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">

    http://help.shatter-box.com/wiki/intel-xdk-how-to-build-to-android-with-crosswalk/

    AndreasR, Thanks for your reply. I'm looking for alternative approaches. The problem with cordova, xdk crosswalk is that it makes the .apk huge (+20mb). Does anyone know how to get an Android WebView work with c2 exported html5 output? As stated previously, since protocol is file:/// c2 will not start-up the app

    http://stackoverflow.com/questions/2087 ... ew-android

    Thanks

  • I tried to create a simple Android app that uses WebView to load local file; c2 index.html. My thinking is to use this approach to load the html5 c2 exported app using WebView. A WebView can load a local file using file:/// protocol. However, c2 checks to see if protocol is file:/// and it will show error message. Is there anyway to overwrite this default behaviour?

    THANKS

  • Thanks for quick replies. Will check into them.

    -Hossein.

    Amerkashi.Wordpress.com

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi, I'm new to c2. Just tried a tutorial. For export, I don't see Android (.apk) option. How can I create a .apk for publishing to such stores as Google Play Store?

    Thanks

kkashi's avatar

kkashi

Member since 10 May, 2015

None one is following kkashi yet!

Trophy Case

  • 9-Year Club
  • Email Verified

Progress

10/44
How to earn trophies