Cordova application: does webassembly supported on Android? - android

I am developing an app with Cordova + Webassembly.
The customer needs the app to work on Windows and Android.
I am using Visual Studio 2017 + TACO.
The webassembly is generated from C/C++ code using emscripten and is working all fine on Edge and Chrome. It is also working on an Android device (Chrome)
The Cordova app running on Windows is working perfectly.
Now my problem is on Android. The Cordova app on Android log this error:
Fetch API cannot load file:///android_asset/www/script/myApp.wasm. URL scheme "file" is not supported.
I can't find anywhere if Cordova supports WebAssembly on Android. My understanding is Android is using a WebView component and should rely on Google Chrome (my Webassembly is working fine on Chrome on Android).
Is there an option somewhere to add a mime-type for cordova on android?
Thanks in advance for any help.

There is another option using the XMLHttpRequest object like showed at https://studiolacosanostra.github.io/2020/02/23/How-to-run-rust-wasm-on-cordova/.
Of course, you don't need to overwriting the fetch function like they do there, but you certainly can use the idea to create your own function.

As you can see in the console, "URL scheme must be “http” or “https” for CORS request.".

Related

mjpg link not rendering on mobile app when built using Meteor

I am currently trying to get a multi-image url to render in my app. It works when I am testing it out in the url, but when I deploy it on my android device it doesn't render at all. It shows that no image found icon.
I am able to successfully build it using Meteor and having Cordova build the mobile version for me.
Here is the url I am trying out for example.
<img src="http://193.85.239.147:86/mjpg/video.mjpg?COUNTER">
What I am particularly looking for is some sort of work around that could also render this similar to that of or some setting stuff I need to change.
I read that there is a version of Chrome that this bug is present, but the Cordova uses Chromium and I am unsure if the bug exist in that as well or not.
Edit:
Upon further test, when I build and use on android phone img won't render anything in which its src is a url/link. It renders properly when I use it in a web browser, but mobile it fails. This is an issue I have yet to figure out a work around.

Open Intel XDK links in system browser?

I've been working on an HTML5 app in the Intel XDK lately and part of the app is buttons that link to external websites. I'm having a problem with the apps opening in the same window, which then causes the user to get stuck in the browser. I'm using the Jquery mobile framework currently. I constantly call the link to open in a "_blank" target, and have also tried several other things such as "window.load". What do I do to get this to work? The app has to work with android and iOS. Any help is appreciated.
Use the Cordova inAppBrowser plugin, see the docs here: https://github.com/apache/cordova-plugin-inappbrowser You will want to use _system target with it.

XDK - open link in browser without using Cordova

I want you to open a link in my app via browser not in Appview. I ma making my html5 mobile app via xdk. I don't want to use cordova in my app as my app is heavy enogh and don't want to make it heavier because of just one link.
I saw this :
www.kidzout.com
But the problem is I must install Cordova InAppBrowser plugin for this to work. Do you have any solution without using Cordova or external plugins? Do you think is it possible at all?
You can open a link in the native browser(Mobile Safari, Android, etc.) from within a HTML5 Mobile app using the intel.xdk API formerly AppMobi.
In the head, include a reference to the intelxdk.js file.
<script src="intelxdk.js"></script>
Use this for opening your link:
Launch in Browser
For more information, go to http://www.html5dev-software.intel.com/documentation/jsAPI/device/launchExternal/index.html
If you are opening a remote URL in your webview and adding javascript is not an option, you can make a patch in native code.
Here I show the workaround for Android:
https://stackoverflow.com/a/35037737/813951

Debugging Cordova + Chrome + App

i'm using Cordova Chrome App with Android ADT Bundle.
I have made a test application that runs ok in web browser and as web app for chrome.
But when i run the app for android window.close() doesn't work when i create the "native" app for android.
I read about other methods in cordova and chrome.app... but it is difficult for me because i can not debug using console.log in android emulator.
My questions:
How can i close the app?
How can i debug through console.log for example?
I read and try log cat, etc. but it doesn't show anything from javascript
Thank you
You could use the below line of code to exit the app.
navigator.app.exitApp();

Google navigation on a html5 Android app

I just wanted to know if someone can explain why is this happening to me.
I am developing a mobile app using phonegap and jquerymobile and one of the features of the app is to guide the user using a navigation tool.
For iOS we have choose Waze. It is really easy to add it:
<a href=" waze://q=Adress">
and it works! It works if we run the app using safari or even if we build a native app using phonegap.
The problem comes when using Android. For android we are using Google Navigation. The code we are using is:
<a href="google.navigation:q=Adress">
It is working ok, but only if we build a native app with our htlm code using phonegap but it is not working if we run the app on Android Web Browser.
We dont want the user to install the app to use this feature...
The question is: Why? Why the html code is working ok inside a webview on a native app but it is not working on Android Browser?
I just had the same issue and used the geo URI and it is working:
Wikimedia Headquarters
for a more detailed explanation see this link: http://en.wikipedia.org/wiki/Geo_URI#Example
The href above will open navigation apps, such as waze on Android (just tested it on the Galaxy S4 with Waze and it is working - it also opens up the Google Maps/Navigation app, which is now a combined app).
Hope this helps! :)

Categories

Resources