A
A
Alexey2016-01-30 13:24:57
Android
Alexey, 2016-01-30 13:24:57

How to automatically launch Google Chrome on Android when tablet boots up without user action?

The task is to make a monitor out of the tablet that will constantly show one web page, and there will be no access to the touch screen of the tablet. Accordingly, it is necessary that when the tablet is loaded in full screen mode, a web page in Google Chrome is launched and constantly displayed, this should happen without any user actions like unlocking the device, etc. Ideally, the Android desktop with icons should not be shown - immediately Chrome with the desired page.
Can you tell me where to dig?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
IceJOKER, 2016-01-30
@IceJOKER

Write a service that will run with the device and write the code that opens chrome:

Intent intent=new Intent(Intent.ACTION_VIEW,Uri.parse(urlString));
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.setPackage("com.android.chrome");
try {
    context.startActivity(intent);
} catch (ActivityNotFoundException ex) {
    // Chrome browser presumably not installed so allow user to choose instead
    intent.setPackage(null);
    context.startActivity(intent);
}

(c) StackOverflow

K
Kir aka Dober, 2016-01-30
@dobergroup

Write a shell script that starts the activity using the command am
#!/system/bin/sh
am start -n com.android.chrome/com.google.android.apps.chrome.Main.'uri'
Script in init.d, (check support, enable if necessary).
UPD Insert a delay, otherwise the browser may start before the connection is established.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question