Answer
Yes. Inside an HTML APK, navigator.mediaDevices.getUserMedia() (camera and microphone) and navigator.geolocation work when the app declares the matching Android permission and the user grants it. In HTML2APK's builder you switch these permissions on per app; your JavaScript should still handle the user saying no.
async function startCamera(video) {
try {
const stream = await navigator.mediaDevices.getUserMedia({ video: { facingMode: 'environment' } });
video.srcObject = stream; await video.play();
} catch (e) {
showMessage('Camera access is off. You can turn it on in Settings → Apps.');
}
}
navigator.geolocation.getCurrentPosition(
p => showNear(p.coords.latitude, p.coords.longitude),
() => showMessage('Location is off — choose your city instead.'),
{ enableHighAccuracy: true, timeout: 10000 });Tips
- Ask at the moment the feature is used, with a sentence explaining why.
- Only enable the permissions you use — extra permissions trigger store questions and Play Protect suspicion.
- Location stops when the app is in the background.
Frequently asked questions
Does QR scanning work in an HTML app?
Yes — a JavaScript QR library reading frames from getUserMedia works, provided the camera permission is enabled for the app.