Progressive web app : Start at android device boot - android

At work, we are switching from native app to progressive web app.
The last feature that we got before and not with the PWA is that before our application opened automatically at startup of device.
It seems that it not possible (am i wrong ?) with PWA.
We are looking to installing an android native application that could launch PWA at startup. But it seems that we need PWA package name or other to launch application.
Did you know if PWA have a package name or other ?
Or maybe if we speak more generally, did you think if it's possible ?

You need native code here to help start your PWA as your PWA itself cant listen for ACTION_BOOT_COMPLETED, which is needed for you to trigger your app on boot-up.
You can create BroadcastReceiverand once you receive ACTION_BOOT_COMPLETED, use Android Intent Filters of your PWA to deep link from your Native code.
If you are thinking of distributing your PWA to non enterprise environment, where installing your Native code is not controlled and guaranteed, I do not see any other way to call your PWA on boot.

Related

How I can start an android application after installation in a chromebook using mdm

I developped an android application which has to run on chromebooks.
I will be install it in mdm to avoid install it manually chromebook by chromebook.
This application wait alerts sent by a server. So, users has no action to do when the application starts. There is no screen. The authentification is done in background.
I want to start this application automatically after the installation without user action. But I don't know what I can do it.
Does somebody has an idea? I hope, I am clear

Is there a way to retrieve the current foreground application in Flutter (while app is running in background)?

I am looking to have my Android (Flutter) application running in the background, checking what app is currently running in the foreground.
When a certain app is opened (eg: Snapchat), I would like to redirect the user BACK to my application.
I've seen native android code that can accomplish this, but I was wondering if there were any Flutter-specific plugins that can accomplish this goal?
I'm aware that you can grab a list of currently installed applications using Flutter, but is there a way to see which app is running in the foreground and then redirect back to my own application, or is this something that would have to be done natively?

Progressive Web App Notification When Clearing Tasks/Killing App

I've been experimenting with Progressive Web Apps (PWA) and using service workers to create native Notifications on phones (like a Galaxy s7/s8).
All has been working great if the page/PWA is open or in the background/tasks (super slick :D), but one thing I've noticed is that if it is killed via the task manager, the notifications no longer work.
This seems to be the case whether I'm using the web app in the browser or if I add it to home page using the PWA functionality.
Here is a snippet of a simple piece of logic in case it helps:
if (Notification.permission === 'granted') {
navigator.serviceWorker.ready.then(function(serviceWorker) {
serviceWorker.showNotification('You have new notifications!');
});
}
Questions
1) Is this an inherent limitation of PWA's?
2) Is there a workaround (like auto-starting the app, perhaps)?
All has been working great if the page/PWA is open or in the background/tasks (super slick :D), but one thing I've noticed is that if it is killed via the task manager, the notifications no longer work.
I beg to differ. I have created a PWA for a bus app and even if I kill the app, I still receive the notification.
To answer your questions:
iOS is the biggest limitation as of the moment. The idea of having a PWA is to behave and look like an app. Having push notifications and offline caching is one of the things driving a PWA to be successful and not build an app.
There is no such thing as an auto-start. If the user has landed on the page and the SW has installed properly, it is already "listening" in the background.

Auto-start browser when device is rebooted

i want to open the browser on reboot. Is there any way i can programmatic invoke the browser without using android code. IS there any web API/Listeners to add for listening the system events like power boot in web APP (browser app) on android device..
Is there any way i can programmatic invoke the browser without using android code.
Not in standard Android. There may be a third-party app that could respond to a boot-completed event and be configured to launch an app of your choice at that point. However:
That's not really on-topic for Stack Overflow
It may not work, as the home screen also gets started on a boot
IS there any web API/Listeners to add for listening the system events like power boot in web APP (browser app) on android device..
No.

Restrict android phone to just install just my application

I am building a android application and I want to run this application in such a way that once it is installed in a device, that particular device should not be allowed to install any other applications. Basically restrict app installation to just one application(i.e mine).
I have looked at few options such a home launcher and tried but this allows me to install other applications as well. Is there a methodology where I can block other apps from getting installed in my device? Thank you.
You should take a look at this page:
http://developer.android.com/reference/android/content/Intent.html#ACTION_PACKAGE_ADDED
When a package has been installed, you should receive a new broadcast event with this intent.
Basically, you have to force uninstall or lock the app with that package id. You'll probably need to be root on the device if you want to avoid a new activity to show up.

Categories

Resources