Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Start service on installation of app without any activity

Tags:

android

Is it possible to directly start a service without any activity. by making a service a launcher. I want to start service repeatedly at the interval of 2 min. can I use alarm. At present I have an activity that starts an alarm using this manager.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime(), duration, loggerIntent); that starts service at every 2 min. How can I remove this activity.

like image 447
user2310041 Avatar asked Oct 05 '22 01:10

user2310041


1 Answers

There is no straightforward way to start a service on just installing the app, without user opening it first time. If you read the answers on the above two questions, you will get the gist.
1) How to start a Service when .apk is Installed for the first time

2) How to start android service on installation

Hope it helps you.

like image 110
Shobhit Puri Avatar answered Oct 13 '22 12:10

Shobhit Puri