2

I am trying to make an android application which is not having an activity but will going to act as a service in background and will startup on boot.

Is it possible to make an app without an launcher icon even in android lollipop? And is it possible to start service on bootup?

And one more thing that service is going to have access to sms of device and will trigger some action if there is some special predefined keyword in sms, is it possible?

I am newbie trying to make a college project. A detailed explanation on this will be very helpful.

Thanks

  • 3
    [Yes](http://stackoverflow.com/questions/2784441/trying-to-start-a-service-on-boot-on-android), [Yes](http://stackoverflow.com/questions/24307412/android-application-as-a-service-without-activity) and [Yes](http://stackoverflow.com/questions/2735571/detecting-sms-incoming-and-outgoing) – adelphus Aug 27 '15 at 17:17
  • Thanks for your response @adelphus but can you tell me little bit more about this how can I do this? just some basic info will be enough as I do not have enough knowledge of android development so, i will be able to start my project. Thanks – Suyash Gupta Aug 27 '15 at 17:31
  • I have done some research @SaschaKolberg but i did not found a specific answer for my ques and I have very less time to do it. So I found this the best way. Thanks for response. – Suyash Gupta Aug 27 '15 at 17:34
  • 1
    @SuyashGupta then you are almost certainly doomed to fail. You should [learn the basics of creating Apps](https://developer.android.com/training/index.html) first before diving into a project like this. The links I posted all contain code or references to what you are needing. No-one here is going to write a detailed explanation of how to write your App - that's what Google is for. Have a go yourself and when you get stuck, post your code in a SO question. – adelphus Aug 27 '15 at 17:41
  • I think you are right thanks for helpful info. @adelphus. – Suyash Gupta Aug 27 '15 at 17:44

1 Answers1

1

Is it possible to make an app without an launcher icon even in android lollipop?

Not realistically. for apps to be distributed through typical channels (e.g., Play Store). You will need a UI to:

  • Show the license agreement
  • Provide access to documentation and support
  • Request Android 6.0 runtime permissions, such as working with SMS
  • Allow any of the rest of your code to ever run

Noteworthy exceptions:

  • Apps that are shipped pre-installed on a device or custom ROM
  • Apps that are purely plugins to some other app

And is it possible to start service on bootup?

Yes... once the user has clicked on your launcher activity, or something else uses an explicit Intent to start up one of your components. If you lack a launcher activity, and you are not a pre-installed app, and you are not a plugin for another app, then your BOOT_COMPLETED BroadcastReceiver — which you would use to start your service — will never be invoked.

And one more thing that service is going to have access to sms of device and will trigger some action if there is some special predefined keyword in sms, is it possible?

Yes... but you will need a launcher activity to be able to request the required runtime permissions from the user, on Android 6.0 and higher.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491