Turn off mobile screen in HTML5 web application - android

I wrote an HTML5 web application which is intended to run for a long time (on Android and iOS).
I would like to lower the battery consumption by turning off the display without locking the phone.
Is it possible to achieve this functionality using a web application or only by using a native application?
Thanks,
Buenon

Related

How to prevent automatic screen lock for a mobile website on android and iphone

I've build a mobile web app with PHP, HTML and JS. (The app is not native and not in the Apple iPhone App Store or Google Android Play Store).
In my mobile app I use jPlayer (https://jplayer.org/) for users to listen to sound meditations. The duration is around 20 minutes for each meditation. The problem is that the screen goes automatic in lock or sleep mode.
On some Android devices is 10 minutes the maximum for the automatic lock. So they can not relex and listen to the full sound without reactivating the screen.
I tried to use the javascript lib NoSleep.js (https://richtr.github.io/NoSleep.js/) and tested it on my iPhone 12. It is not working, the screen locks anyway.
Is there some way to keep the screen active?
Update: I found out that the sound keeps playing when I use the mobile website application in the browser Chrome or Safari. But when I save the app as a desktop icon and then use the jPlayer it stops after screenlock. Probably there is no solution for this.

Communication between cordova app and native app?

I am building a cordova app which will communicate with a device using BLE in background using https://github.com/don/cordova-plugin-ble-central
Here are the challenges I am facing :
I want this app to be kind of a service to be used by another native app i.e communication between cordova and native app. I assume both apps need to be opened in background or one of them in foreground for this to work. Is it possible? How?
This cordova app will be a separate apk. But is it possible that it can be a part of native app so that user only have to install the native app without installing the cordova app separately?
Such app which continuously scans for Bluetooth Low Energy (BLE) peripherals is eventually be cleared by mobile OS to conserve battery. Is there any way to have it opened in background all the time. I know in android you can disable battery optimizations for a particular app. But what about IOS?
Is it maintainable across different platforms(both IOS and android)? Or native implementation will be a better choice?

Can I Lockdown iPad Browser to a Specific Web Application?

I'm developing a Point-of-Sale solution to be deployed on an iPad. The application will be engineered as a web application. I've seen some great info on how to lock down the iPad to a specific application and so this gets me halfway to my solution; the application I lock down to will be the browser.
Lock-down iPhone/iPod/iPad so it can only run one app
Now, can I take this one step further? Can I lock down the browser to disallow ad-hoc browsing? I'd like to do this because I want to ensure that the user is constrained to the confines of the POS application at all times.
(If I can't do this, I'll need to write a small shim application to host my web application and I don't want to do this, because this violates the zero-install architecture we're trying to achieve.)
Alternatively, is there a way to achieve this with an Android tablet? As the application is constructed with HTML5, we are relatively agnostic as to the client device.
Thanks for your advice!
You could add the Website to the Homescreen. Then it appears as an app - maybe you can then lock it down with the mechanism you mentioned.

Monitoring network activity in an HTML5 iphone/android app?

I want to create an HTML5 app for iPhones and Androids that is based on an HTML5 app framework. The app will do nothing but monitor the network activity (only cellular not WIFI) of the device.
I have been searching for how to do this for a few hours now, but haven't been able to find out how to do this, or even if it is possible or not.
Is it possible to monitor iPhones/Androids network activity in an HTML5 app built on an HTML5 app framework? And if so, how?
(I'd prefer to find a framework that exposes the network data usage of iPhones and Androids to the app instead of coding my own if possible)
If you built the application container for your HTML5 app then yes with the new Web Inspector for Safari, this works as well if your building a mobile html5 app on a server.
Chrome also has a similar debugging feature for Android.
http://webdesign.tutsplus.com/tutorials/workflow-tutorials/quick-tip-using-web-inspector-to-debug-mobile-safari/
https://developers.google.com/chrome-developer-tools/docs/remote-debugging

Access the GPS of Android device in a Web Application

We are trying to access the GPS of the Android Tablet from the web application opened in the Android browser.
We are not developing Android application. All we want to do is, just browse the web application from the Android browser and in that we would like to access the in-built GPS in the Android device.
Right now, we are using HTML 5 geolocation API, but those values are approximate.
We would like to have more accurate values, so we want to access GPS in the Android device from the web application.
We are not going with Android app because the user may use this application in iOS too.
Appreciate the help
Thanks
HTML5 geolocation API is the best you'll be able to do, at least in a crossplatform way. But it shouldn't be particularly inaccurate, since the browser geolocates with the GPS too.

Categories

Resources