I am attempting to create an Android game in Javascript, then I planned on putting it into a WebView. The problem is, although my game works 100% in the default Android browser, running it in a WebView seems to break it somehow. I've looked through all of my code and cannot for the life of me figure out what the issue is.
I used this game as the "codebase" for my own game, and it faces the same issue.
It loads perfectly in the default Android browser but when you put it into a WebView it will no longer play. Simply copy the above link into a webview and see for yourself.
Note I do have Javascript enabled and the webview is functioning properly.
Perhaps the cache manifest?
Have you tried Phonegap? You have all the hard work done and works out of the box.
Related
I want to make a samsung smart tv app with tizen.
I've made an webpage using springboot.
I tried making the app using that webpage codes I made, but I've got to know Tizen doesn't support java but html, css,and javascript only.
So I used meta http-equip="refresh", and let index.html go to my webpage url,
but there were long loading time, and ugly ui for a waiting page..
also remote control's pointer was weird. (not focusing on a certain button, but there is a cursor)
is there no way to solve this problem?
I've tried to find a way but I couldn't. please help me...
It seems that you are making a redirect to your website (hosted in internet).
Maybe would be better starting reading the basic concepts about Samsung Smart TV apps here
If you try to open external content (hosted websites) into your app the TV will use its web browser to open it.
I'm trying to make a really simple app for a friend to display his bar's ordering website in an app for when they reopen with the social distancing measures in place. The web app already exists, so this is really a simple matter of displaying the content in a WebView.
I've got the page loading, the content is visible, the styling is done - The only problem is that it doesn't seem to be loading all the elements. There's a line of filters at the top which just display as 3 dots (i.e. loading), and when I click any of the items on the menu, nothing happens. There should be a window pops up asking for a table number etc... If I open this in the Chrome browser on my phone, rather than a webview in the app it works perfectly so I know it isn't the website.
I've done the following;
setJavaScriptEnabled(true);
setJavaScriptCanOpenWindowsAutomatically(true);
setSupportMultipleWindows(true);
I've also turned off safe browsing in the manifest in case that was blocking anything. I have also given the app permissions to use the internet. I can't figure this one out at all and nothing online seems to be helping!
Admittedly I'm a tester (automated, but still), so coding isn't my best suit. I may be missing something really simple here. Any ideas?
Scratch that. For anyone who's interested, I needed to add this line;
setDomStorageEnabled(true);
For such a simple thing it proved impossible to find info on, I just enabled everything until something worked! So hopefully you don't have to do the same if you're looking at this.
We have an Android application which works well on Android 4.1+ till Android 7.
Only in Android 5.0 and 5.1 we experience a difficult problem (on all devices + emulators).
The icons we use in our application turn completely black after hiding the software keyboard (when you are finished typing something in a textbox).
They stay black, even after restarting the application.
But after restarting the device (or closing the application by taskmanager), the icons are back normal (till you hide the keyboard again).
I don't find anything unusual in the code or icons and since it works in Android 4,6,7 it seems related to just Android 5.
Does someone has some idea at what the cause could be?
Disabling hardware-acceleration didn't have any effect.
This problem mainly occurs if you are using some other format of images like jpeg , use only png images also you might want to have a look at this answer
i'm a web developer so i don't have a large knowledge with android apps, but i have found a project on github to make a simple webview app to show a website i have created which is fully responsible and work fine with all browsers on desktop and android phones, when i run the app in android studio it works great and everything run smoothly in many emulators, but when i install the apk on physical phone some problems show include taking larger width than the device and some containers which displayed 'none' shows at the bottom of the page and there are many issues with the proportions of the pages, i hope someone can help me to locate the problem or guide me to where i can search for it and find it by myself
this is the url to the github project
thank you very much
I see, I think just adding this code to your MainActivity will do the trick!
mWebView.getSettings().setLoadWithOverviewMode(true);
mWebView.getSettings().setUseWideViewPort(true);
maybe try this too:
WebView.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
put the above code below :
mWebView.setWebViewClient(new WebViewClient());
hope this helps :D and please tell me if it does!
Please, is there any way to force WebView to play html5 embedded vids? I spent two days tempting it (from just enabling js and plugins with hardware acceleration to using html5webview class) and made video tag working, but embedding with iframe only shows me preview.
Any suggestions, please?
Does it play if you click on it manually? There are all sorts of things that may go wrong with HTML5 video on the internet, on Android you also have to take into account the various permissions.
Try this first:
Load the webpage in a browser - does it work?
Load the webpage in the browser on the device, does it work?
Load the webpage in the webview, does it play when you click on it?
There should be an auto play property on the webview, but I know that one IOS at least that one is ignore and the video won't play until you click it.