Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fullscreen Web App for Android

I want to run my Web App, which i programmed with HTML5, in fullscreen mode on Android. (hide the status bar, and the adress/navigation bar)

for iOS you only write:

<meta name="apple-mobile-web-app-capable" content="yes" /> 
<meta name="viewport" content="width=device-width, initial-scale=1.0">

But that did not work on Android.

There are a lot of solution´s with Javascript, but all solutions which I tried are inoperative.

Somebody know the solution?

like image 960
user959456 Avatar asked Sep 22 '11 15:09

user959456


People also ask

How do I make a website full screen on Android?

Now, just tap the icon on your home screen to open the website in a full-frame, borderless window. You can swipe from right to left with two fingers to go back, or from left to right to go forward. You can even swipe down with two fingers to reload the page.

What is fullscreen app Android?

Full! screen lets you hide the system navigation bar and notification area on your Android phone or tablet so you can use that space for apps and games in full screen mode. It's not just crashing your system UI, though. Full! screen places minimalist replacement buttons tucked away in the corners.


3 Answers

This worked for me on Chrome for Android.

Add this to the head tags:

<meta name="mobile-web-app-capable" content="yes">

Then in the chrome browser menu, Goto Add to Homepage. This Icon will now open your website up in fullscreen.

like image 100
jason Avatar answered Oct 16 '22 23:10

jason


I use a mix of the HTML meta tag for iOS and a JavaScript solution. It takes away the address bar on iOS and android devices. It does not take out the bottom bar on iOS as this will only disappear when the user installs the web page as a HTML5 app on his home screen.

<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
<script type='text/javascript' charset='utf-8'>
    // Hides mobile browser's address bar when page is done loading.
      window.addEventListener('load', function(e) {
        setTimeout(function() { window.scrollTo(0, 1); }, 1);
      }, false);
</script>

I use PHP in the backend to only render the JavaScript for mobile browser with the following mobile browser detection

if (preg_match('/iphone|ipod|android/',strtolower($_SERVER['HTTP_USER_AGENT'])))
like image 10
philipp Avatar answered Oct 17 '22 00:10

philipp


I do not think you will find a global solution for that since not everybody uses the default android webbrowser (e.g. I prefer dolphin).

Facing that fact you will need to try every dirty javascript hack to force that behavior.

The only reason why this works for apple devices is the fact that apple is very restrictive about developing a custom browser and everybody sticks to the default app.

like image 3
Knickedi Avatar answered Oct 16 '22 23:10

Knickedi