using sendintent to start a service

KD
Koen De Meulenaere
VOLVO Cars Gent

We use zebra no sleep app to keep our devices active. When this app is installed via mobicontrol we need to activate 2 options. to start the service and to start the service after reboot.

I checked this via Github and there is the possibility to start this service via a sendintent. 

The service respond to two intent actions (both uses the category: android.intent.category.DEFAULT)

  • "com.zebra.nosleepservice.startservice" sent on the component "com.zebra.nosleepservice/com.zebra.nosleepservice.StartServiceBroadcastReceiver":

    Start the service.
    If the device get rebooted the service will start automatically once the reboot is completed.

But I don't know how to script this.

3 years ago
Android Scripting
ANSWERS
MD
Matt Dermody Diamond Contributor
3 years ago
RC
Raymond Chan Diamond Contributor
3 years ago

I don't have any Zebra device to do any test.  However, just based on the information provided in the post, the following can be tried:

sendintent -s "intent:#Intent;action=android.intent.category.DEFAULT;component=com.zebra.nosleepservice.startservice;end"

AND

sendintent -b "intent:#intent;action=android.intent.category.DEFAULT;component=com.zebra.nosleepservice/com.zebra.nosleepservice.StartServiceBroadcastReceiver;end"

Please let us know if the above or any other final version you eventually find to be working on your devices.

K
KCMOD@SOTI Silver Contributor
3 years ago