Force full screen mode in browser

Forum to discuss the new web client version of Servoy.

Force full screen mode in browser

Postby rafig » Tue Apr 04, 2023 5:01 pm

I am trying to make a solution fit on to a small Android (Amazon Fire HD 8) tablet screen, but the built in browser (Silk) doesn't have a 'full screen' option/button/menu, so there is always a bar across the top (with time etc.) & across bottom (with back/home etc.), as well as the URL bar.
I want to allow the user to click a button on my Servoy form that tells the browser to switch to 'full screen' mode.
I found an article that says it supports the Mozilla command "requestFullscreen", but I don' know how to get Servoy to send that to browser
https://amazon.developer.forums.answerhub.com/questions/197877/why-does-silk-browser-full-screen-now-have-a-soft.html?cmdf=silk+browser+kiosk+mode
https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen
I know it's possible for a browser to run full screen, as there is this one that I had to sideload that can do it, but requires a 'hack' & payment to enable some of what I need (this is me testing for a client to deploy to multiple sites, so don't want them to have to 'hack' each site's tablet & have to pay lots extra just to get my solution to fill the screen ;-) )
[The reason I am trying this particular device is due to the fact that it is currently, probably, the cheapest Android tablet (£~80) from a decent company with a reasonable resolution (1280x800) & a reasonable back camera (5MP), as client will need to take photos to upload in solution]
I have installed
svyUtils
svyUtils$NGClient
ngclientutils
(as well as lots of other stuff...)
Thanks in advance
Rafi
Servoy Certified Developer
Image
rafig
 
Posts: 704
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK

Re: Force full screen mode in browser

Postby mboegem » Fri Apr 07, 2023 3:08 pm

Hi Rafi,

if I follow the links you provided I bump into this code:
Code: Select all
function toggleFullscreen() {
  let elem = document.querySelector("video");

  if (!document.fullscreenElement) {
    elem.requestFullscreen().catch((err) => {
      alert(
        `Error attempting to enable fullscreen mode: ${err.message} (${err.name})`
      );
    });
  } else {
    document.exitFullscreen();
  }
}


This points into the direction of showing a specific element of a site as fullscreen, so I don't know if this will work for the entire application (this means you can try to show the total body part of the browser in full screen)

Anyway, in order to trigger this from Servoy, you will need to add this function to your application using an Angular Service similar to for example the Key listener service which you can install through SPM.
You can find the sources of the Key Listener on Servoy's GitHub repositories, to give you an idea on how to structure that.

Hope this helps
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image

Partner of Tower - The most powerful Git client for Mac and Windows
User avatar
mboegem
 
Posts: 1743
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Force full screen mode in browser

Postby rafig » Tue Apr 11, 2023 2:50 pm

Hi Marc,
thanks for your reply
I will look in to that as an option, but was obviously hoping for an easier way to do it with Servoy (latest) 'out of the box' ;-)
Servoy Certified Developer
Image
rafig
 
Posts: 704
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK

Re: Force full screen mode in browser

Postby mboegem » Tue Apr 11, 2023 3:03 pm

Can imagine that, however these things are outside Servoy's control and especially on Android you have to deal with different browsers.
I believe iOS is easier in this way, but cost of device is higher.

At least there is an easy possibility to extend Servoy with custom logic to have more control over whatever is happening in the browser.
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image

Partner of Tower - The most powerful Git client for Mac and Windows
User avatar
mboegem
 
Posts: 1743
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 10 guests

cron