1

Could someone please help me figurate how to make an app that has no icon and starts at the startup?

I want it to start in every startup and keep running all the time, because I want to Toast the name of the sender each time there's an incoming SMS.

Blo
  • 11,903
  • 5
  • 45
  • 99
Eyal
  • 1,649
  • 3
  • 25
  • 49
  • Will your project is going to have any activity ? – Lucifer Apr 18 '14 at 03:58
  • I think so 'cause I want to read the name of the sender and Toast it – Eyal Apr 18 '14 at 03:59
  • So, if your project doesnt contain any activity then you can't actually listen incoming SMS using BroadcastReceiver. You can do it only if you are targeting your application to Android OS < 3.0 – Lucifer Apr 18 '14 at 04:00
  • You mean I can't run apps without a layout on Android OS > 3.0 ? – Eyal Apr 18 '14 at 04:04
  • Yes, Please read this blog http://commonsware.com/blog/2011/07/13/boot-completed-regression-confirmed.html – Lucifer Apr 18 '14 at 04:07
  • I think we're not talking about the same thing. I'm talking about a layout-less app that runs in the background. That's what you was talking about? – Eyal Apr 18 '14 at 04:21
  • that means there will not be any activity in your project right and that blog clearly states that if your project is not going to have any activity ( GUI ) then it won't run. It will be in stop state all the time. – Lucifer Apr 18 '14 at 04:23
  • Ist there maybe a way to make the app visible at the app drawer and after the user enters for the first time the app hides itself and will make it start every startup? – Eyal Apr 18 '14 at 04:32

1 Answers1

0

I'm not sure what you mean by "hidden" as the O/S generally tries to avoid allowing you to hide behavior from the user. What you want to do is discussed in this question Trying to start a service on boot on Android. That will enable you to launch a service and then by watching for the appropriate intents related to SMS messages you can create the toasts you desire.

Community
  • 1
  • 1
caskey
  • 12,305
  • 2
  • 26
  • 27