Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Start android application without activity

Tags:

People also ask

Can we have Android app without activity?

Yes. Customize Keyboard application ( IME :Input Method Editor ) in Android is an application without any activity subclass .

Can we have application without activity?

It's not possible to have a Service on its own as a stand-alone "app". It needs to be started manually by a user through an Activity .

Is it possible to show UI without activity?

Explanation. Generally, every activity is having its UI(Layout). But if a developer wants to create an activity without UI, he can do it.


I've an application which aims to run only as a service (no interface, just run in background). I have no activity mentioned in my AndroidManifest.xml but put a receiver to start the application at phone start.

<application     android:icon="@drawable/ic_launcher"     android:label="@string/app_name" >     <service         android:enabled="true"         android:name=".MyAppService">         <intent-filter>             <action                 android:name = "me.myapp.MyAppService">             </action>         </intent-filter>     </service>     <receiver         android:enabled="true"         android:name=".BootReceiver">         <intent-filter>             <action android:name = "android.intent.action.BOOT_COMPLETED"/>         </intent-filter>     </receiver> </application> 

The problem is that as I'm developing (using Eclipse) the application, I need to test my changes often. When I run the application (with my phone connected in debug mode), I've got a message like

[2011-12-14 00:18:40 - MyApp] Android Launch! [2011-12-14 00:18:40 - MyApp] adb is running normally. [2011-12-14 00:18:40 - MyApp] No Launcher activity found! [2011-12-14 00:18:40 - MyApp] The launch will only sync the application package on the device! [2011-12-14 00:18:40 - MyApp] Performing sync 

How can I start the application at run, without having to restart it every time ?


Edit this is not possible anymore for Android 3.1 or above. Source