2

I'm developing an android service application, which reacts on some intents. As you know, intents won't trigger until the app is launched for first time. Because my app is not interactive, I'd like it not to be shown in the launcher (app list). I can do this by removing

<category android:name="android.intent.category.LAUNCHER"/>

from the manifest file, but after that, how do I execute the app, as it is not shown anywhere? :|

Thanks.

Davita
  • 8,928
  • 14
  • 67
  • 119
  • Where will users be setting their preferences for how your app behaves? Where will users be toggling whether or not your service should be running or responding to these events? Where will users be reading the documentation for your app? Where will you be displaying your license agreement? – CommonsWare Jun 17 '12 at 00:02

3 Answers3

1

how do I execute the app, as it is not shown anywhere?

So you have to use BroadcastReceiver So similar topic where your can find similar solution. Check this

Community
  • 1
  • 1
Simon Dorociak
  • 33,374
  • 10
  • 68
  • 106
  • Apparently this doesn't work anymore as far as I know. The application should be launched at least once in order to receive intents from BroadcastReceiver. Correct me if I'm wrong :( – Davita Jun 16 '12 at 23:12
  • not? so you are not able to do what you want, firstly i want to tell you that is not possible or i don't know exacly then how to do this. LAUNCHER marks Activity like Main so you can add it to the Activity that you want to start when you launch application. – Simon Dorociak Jun 16 '12 at 23:16
  • Btw. you can send a flag with the intent to the broadcastreceiver (3.0+, where it doesn't work) in order to be received. In the case you don't know that yet and it's possible http://stackoverflow.com/questions/7349173/android-xoom-honeycomb-application-without-launcher-activity-does-not-work – User Jun 16 '12 at 23:50
  • Thanks, I didn't know about the flag. +1 for that. Though, its not going to help me, because my only intent is to use only one service, no other applications which will start them. The service relies only on system intents. – Davita Jun 17 '12 at 02:18
1

What about disable the launcher icon after the application was launched the first time?

http://www.helloandroid.com/tutorials/removing-app-icon-launcher

Although this

the icon will only disapper when the launcher is restarted, so likely on next phone reboot, forcing the launcher to restart is not recommended"

doesn't sound good...

User
  • 31,811
  • 40
  • 131
  • 232
  • Wonderful. I will test your solution soon and accept the answer. I think that's what I'm looking for. +1 :) – Davita Jun 16 '12 at 23:39
  • Thanks, but I edited my answer (didn't read the whole article before answering)... don't know if that's acceptable. – User Jun 16 '12 at 23:41
  • Thanks lxx, it's acceptable, after all, I'm not writing a malware :). The app won't have a gui, and there is no reason to keep an icon in app list. :) – Davita Jun 17 '12 at 02:19
0

If your application is serviced based, responding to intents, why do you need to execute it? Won't the intents start your application?

Make sure you include the right intent filters in your manifest. Without them intents won't trigger your services.

http://developer.android.com/guide/topics/manifest/intent-filter-element.html

Flynn81
  • 4,108
  • 29
  • 28
  • It will, but only after the user executes the application manually. See http://stackoverflow.com/questions/10973188/should-an-app-be-in-running-state-in-order-to-trigger-intent, CommonsWare's answer. – Davita Jun 17 '12 at 01:14