THREE.js - Cannot load texture locally in Chrome Browser in Android device - android

I have been trying to load textures for a WebGL application in a Chrome browser in an Android device
I came across a similar post THREE.js - Can't load texture locally where a solution to load textures is given for Chrome which works only on a PC/laptop device
The flag --allow-file-access-from-files works on a laptop device as I can use the command line but how to do it on a mobile device?
Can someone please help with this?

The Crosswalk projects embeds a Chromium webview and, by standard, will allow the loading of textures and models from files.You can compile your demo with Crosswalk by using this if you have a blacklisted gpu:
make_apk.py --package=org.crosswalkproject.yourproject \ --manifest=your_webgl_demo/manifest.json --xwalk-command-line='--ignore-gpu-blacklist'
The last part isn't necessary if your gpu supports webgl completely.
If you have problems though, replace the last part with
--xwalk-command-line='--disable-web-security'
which will give you total access to files (with all the risks involved).
But the simplest method is to use a webserver on android to access files from 127.0.0.1:8080.
There are many free webservers on the playstore and I use them on a daily basis to test webgl demos on my device.

Related

Web development on Android tablet - no dev tools?

Suppose you wanted to do web development on an Android tablet. There are some options available for code editors etc. One thing I can't get around is that Chrome for Android doesn't have dev tools. It doesn't even allow to disable the cache. Are there any other browsers that have the basic console and inspect element functionalities?
Please note that it doesn't have anything to do with remote debugging. I'm looking for a way to develop with an Android tablet only.
The only thing that comes to mind is BrowserStack, but it would be slow as hell especially on a mobile device.
Look at these features requests for both Firefox and Chrome. Sadly, nobody seems to really care, given that remote debugging solves the problem when you have a computer next to your tablet.
https://bugs.chromium.org/p/chromium/issues/detail?id=817837&q=&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified
https://bugzilla.mozilla.org/show_bug.cgi?id=1434065
In the meantime, you can :
use a service like Browserstack with the devices (ex. Galaxy S9) that offer native debugging (the devtools are on your side, communicating with the remote mobile device)
use that modified version of chromium and the accompanying hack : https://github.com/laem/chromium. Building a stable and fast version of Chrome is time and resource consuming, any help appreciated !
The best solution would obviously be to build Chromium with the devtools integrated, but I don't have enough knowledge : is it just an "if (!android) import DevTools" line to remove ? Or would it need lots of adaptations to work ? It's all HTML and JS as far as I know, so it shouldn't be that hard to get the console, debugger and inspector to work.

What are differences between Chrome on Android and Desktop Chrome?

I know both use the same webkit version (537.36) and both use the same javascript engine (V8), but are there any other major differences between them?
I have a webapp with automated tests for desktop Chrome but nothing for Chrome on Android. I'm trying to decide if I know it works on desktop Chrome do I need to go through the trouble of testing it on Chrome on Android, or are they similar enough that I should have confidence it works on both.
Thanks!
Main difference is that Android don't have Flash because of the HTML5 implementation, and also there's a lot of different screen sizes and users don't like to zoom in and out a pan and zoom again, so the best you can do is to create a web designed for mobile devices.
On the other hand, if your site is mainly HTML and Javascript, will work 100% on mobile Chrome. I have a HTML5 game and works equal in desktop and mobile.
Also, you can download the Android SDK and test your site in a bunch of different Android versions and screen sizes with the AVD, is like an official Android emulator.

Android HTML5 Video offline caching

I've an android app already developed.
The android app is essentially a wrapper around a HTML5 web app.
We use HTML5 offline caching to provide the ability to play when disconnected from the internet.
Chrome/Firefox on the desktop will cache the video and images however Android devices
appear to selectively ignore video in the cache manifest which prevents the video from
being stored locally on the device.
It's understandable that Android would ignore caching video to keep the storage use to a
minimum on mobile devices but we need a way around this.
Just stumbled across this question after I stumbled across an answer - so thought i'd help out!
I'm trying to do a similar thing for Android/iOS, and as far as I know the appcache is very restricted on mobile devices (Android varies depending on available disk space & browser used, and on iOS I haven't had luck getting above 50mb).
I recommend using a framework such as PhoneGap or Chrome Apps - they offer other forms of local storage by communicating with the device's native file APIs.

Testing a Web application with an emulator

i am currently a mobile web application with jquery mobile. Is there a way of testing the application with an emulator that works for ipad, ios, blackberry, android, symbian and other major os on my local machine without connecting to the internet or using a real phone or hardware.
You may be interested in the ripple project. Currently its a chrome extension for emulating different devices. Sure it has shortcomings but it can be very useful for certain situations.
http://ripple.incubator.apache.org/
To avoid connecting to the internet: run your server on localhost
To avoid using actual hardware, use the emulators that come with the SDKs for the platforms you're interested in. But at first, just use the computer browser; I'd recommend Safari, as it is based on WebKit, like iOS and Android use.
One thing I tend to do is use FireFox with user agent switcher plugin. This allows you to configure a series of user-agent identifiers in your browser to 'fool' your jQuery mobile website into thinking it's dealing with particular devices.
if all you want is to load a mobile url and see how it looks on different phones you could try this site
http://www.synthphone.com/

how to load swf files without using webview

Is there any way to load the swf files directly without use of webview..
Now i am trying to run swf files using webview but the swf file is very slow on device.
In short according to my procedure the flash file running on android device and tablet is very slow as compared to if i view this on my desktop pc.
I don't think there is a standalone flash player for Android. But even if there was it would mean that people need to install that first before starting your app.
I believe the slowness you experience as nothing to do with webviews but simply with the resources available on a mobile device (1/3rd minimum of the cpu device and 1/10th of the memory).
You can check if that is the case by simply trying to launch your swf from the native web browser of your device and see if its better. If not, the problem is really your device.
You will probably need to create a strip down version of your flash for mobile devices.
Beside you should know that adobe plans to stop flash for mobile devices : http://www.fiercemobilecontent.com/story/adobe-confirms-flash-support-android-ice-cream-sandwich/2011-11-21
Good luck

Categories

Resources