Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Application without app launcher icon

Tags:

android

I know that this is a very old question, but with the new Android API (currently I'm working on API 19+) could we do it?

I can not remove:

<intent-filter>
    <action android:name="android.intent.action.MAIN"/>
    <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>

from manifest file because Android studio will not compile the app:

Default Activity not found

Updated: Thanks all, I have decided to do it programmatically

like image 561
Norutan Avatar asked Nov 25 '16 16:11

Norutan


2 Answers

because Android studio will not compile the app

Yes, it will. Build > Build APK works just fine.

Android Studio will not run the app, because it does know how to run such an app, but that does not prevent you from compiling the app and generating an APK.

Application without app launcher icon

This situation has not changed significantly since Android 3.1. You are welcome to write an app without a launcher icon. Outside of a few specialized scenarios, that app will be useless, as none of its code will ever run.

like image 170
CommonsWare Avatar answered Sep 22 '22 06:09

CommonsWare


I'm creating an application that runs only in background. I had this same problem, having to create an activity that did nothing just to execute the finish() method.

So I found this question: (https://stackoverflow.com/a/16603708/7548147), all you have to do (in Android Studio) is Go to RUN -> Edit Configurations... and Launch Option-> Launch: choose nothing option.

After this, you'll be able to delete your code in Mainfest

like image 34
pedroaugust0 Avatar answered Sep 21 '22 06:09

pedroaugust0