Auto-start browser when device is rebooted - android

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.

Related

Progressive web app : Start at android device boot

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.

Close android service with a password

I'm working on android application which have one service runs in background,
I need to make sure that the user will close the app/service only upon inserting password (like app lock on the market only for the service and the app).
Any ideas suggestion of how to implement such a feature?
On android 2.3 isn't possible the user will kill your app, but starting with Android 4.0 and Device Administrator it is: reasonable. Take a look at Kaspersky's parental control app.

Keeping android browser open with a service

Is it possible after a user has opened the android browser to catch when the press home / onpause() in order to push the browser to a service or just to start the browser from a service in order to keep it open when the user presses home or locks the phone?
For instance, If the user is listening to a internet stream through the browser and they press home or lock the screen the audio will be cut off. However I would like to keep the browser open so the audio continues to play. I'm under the impression that a service would be the only way to accomplish this.
In fact this is (and should be) impossible within Android. All clicks and things of that nature should go through your app. There are some bad situations where you can do this, and it's widely considered to be an Android bug. Basically, the idea is that you shouldn't be able to control anything outside of your app. Instead, you can only accept clicks within an app, and getting this behavior would require extending the standard Android browser with your own implementation and having users use that instead.
To see why you can't do this, consider the kinds of security implications that it would have, you could control and reroute functionality from other apps to hijack their standard user experience. There are some situations (you can google "clickjacking" to see some) that have been possible in earlier versions of Android, but in any non malicious app, you really shouldn't be doing this.
I was able to create a webview within my app and started a service when the home button (onpause) was pressed that enabled the broswer to continue the playback of flash while the app was in the background or the screen was locked. So while I wasn't able to use the capture the browser outside my app I was able to make an effective webview to emulate that experience.
I followed the instructions here to create the webview and then made a service. The piece of code (android:hardwareAccelerated="true") that allowed the flash to play properly was:
<application android:hardwareAccelerated="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
in the manifest. It works great! (The api must be 3.0 or greater however)

Android development specifics

I am looking into mobile app development, and I had some questions about the android platform.
Does the android platform use a central settings and preferences page (much like the gears icon on an iOS device)?
I've been reading about services. Are these what I would use if I wanted to develop an application that doesn't have a UI (think something like the drop box client)?
In my reading about services I read that the android OS will kill your service when it thinks that it needs to reclaim resources. Is there a way to ensure a service wouldn't be killed?
How much control would I as a developer have over the physical hardware? Say if I wanted to make an app to block distractions, and to do this I would need to control the networking interfaces beyond purposely misconfiguring these interfaces to block their connection? Can I programmatically turn off these interfaces?
Each individual application has its own settings page, but this is generally created by using the built-in Android settings class (you can just subclass PreferenceActivity)
Every application must have an activity (A screen with a UI), but yes, you can do the majority of your work in a service, which is analogous to a background process on a desktop computer
There is no way to ensure that Android won't kill your service without rooting the phone. However,
"If the service is bound to an activity that has user focus, then it's
less likely to be killed, and if the service is declared to run in the
foreground (discussed later), then it will almost never be killed" link
Yes, you have access to any hardware (GPS, WiFi, Bluetooth, 3G radios, camera, etc) through the Android API. You will have to request an install time permission from the user in order to deal with them, however. Also, other programs can turn them back on.

Android phone as a dedicated device

We want to use Android mobile for dedicated application. Can somebody suggest how can we make it happen.
Here are the requirement:
The phone when started, should launch our application., so the user cannot launch any other application. The application will be a 1D barcode reader.
The application should be live as long as the phone is up and running, user cannot close the application at all.
Thanks for your help.
Regards,
Manish
Android after boot is complete sends a bradcast intent:
android.intent.action.BOOT_COMPLETED
if you listen for this intent, you can launch a service that in turn launch your activity.
In the Activity you have to take care of the user's interactions that explicitly close the activity, like home button, back button and camera button press.
Setting your activity to be full-screen also should prevent the user to use the notification bar to interact with notification like those from market-app that can close your activity.
Finally, your activity can be killed by the system by various and uncatchable reasons: in those cases, the service that first launched your Activity comes in handy, as it can periodically monitor the general state of the application and relaunch components as needed.
Check out the new Android Enterprise solutions for your use case.
https://developers.google.com/android/work/overview
Its well documented. You can either use
Android Management API to provision the devices and apply policies to the device which will be applied to the device using Android's Device Policy Controller (DPC) or,
Use Google Play EMM API and develop your custom DPC
It depends upon your use-case really, but the first solution set should serve your purpose
I'm afraid there's no single answer to this, but you need to work on multiple fronts.
One of these fronts is preventing user from running other applications: for this there are applications sold on Android Market that can put other apps of your choosing behind passcode.
You need to combine this with automatic launch, but I don't yet know how to do that.

Categories

Resources