5

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.

user2310041
  • 101
  • 1
  • 2
  • 10

1 Answers1

4

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.

Community
  • 1
  • 1
Shobhit Puri
  • 25,769
  • 11
  • 95
  • 124