No launcher icon but still able to be opened - android

I have got an app that is using "plugin apps" (apps without launcher icon that get started via intent by the main application) and i want to have the Play Store "Open"-Button for this application to just open the main application.
Is there a way of not having the launcher icon but defining an entry point in order to launch the main application after play store install (by intent or launching a dummy activity which will launch the other applications activity immediatly).
I thought about removing the launcher category "android.intent.category.LAUNCHER" and still setting the main action "android.intent.action.MAIN". But this seems not to work at least via apk install the "Open" button is not active.
Thanks

You could try android.intent.category.INFO.
According to the documentation, this is for the case where you want to provide an entry activity for your app, but don't want your app to be shown in the app list.

Related

Android static App Shortcut is not showing

I created app shortcut as specified in https://developer.android.com/preview/shortcuts.html. Despite running on API 25 and Pixel launcher, app shortcut is not showing on launcher screen. What might be the cause?
Using reference (#string) as shortcutId results in app shortcut silently not showing up.
Check this
Only main activities—activities that handle the Intent.ACTION_MAIN action and the Intent.CATEGORY_LAUNCHER category—can have shortcuts. If an app has multiple main activities, you need to define the set of shortcuts for each activity.

Android Studio How to run application but it should not have launcher

I have an application which I simply want to run but it should not have launcher Icon.
I have deleted this tag
category android:name="android.intent.category.LAUNCHER" />
But then Android studio starts to give error that
Could not identify launch activity: Default Activity not found
Error while Launching activity
then I switched the run configuration as the following :
What I want :
I just want that My application start running once I run it from the android studio , but it must not have launcher icon . SO that user should not be able to launch it by himself.
Note:
I do know that it is not legal we should have activity so that user can se it , use it and change something if he wants. But that is not the case in my app as the user want himself to hide its launcher so that no body knows about app. So do not worry about such case. :)
I have an application which I simply want to run but it should not have launcher Icon.
Then your app will never run.
running service or broadcast receiver
Your app, once installed, is in a stopped state. None of your code will run until something uses an explicit Intent to start one of your components. Normally, that is the launcher icon. Other possibilities include if the user sets up an app widget, or if your app is a plugin for some other app (and that other app uses an explicit Intent to start one of your components). Outside of those scenarios, your app will never run. This is to help prevent malware.
the user want himself to hide its launcher so that no body knows about app
You will still need a launcher icon. However, when the user runs your app, you can use PackageManager and setComponentEnabledSetting() to disable that activity, so it will no longer show up in the launcher.

Android: Launch app from app installer will cause several instances?

1.install an apk from app installer
2.then just click "OPEN" to launch it at once
3.after the app launched and then press HOME key
4.find the app from app list and click its icon to launch again
5.then the app will be launched with a new instance.
And if you repeat 3~5 several times, it will repeat create a new instance. if you press "BACK" key now, you will see the app is still there for the same times you launched.
But if you just click "DONE" at step 2 and then launch the app from app list, everything will be OK then.
Why?
The app installer (as well as many Android IDEs) use different intent flags than the regular app launcher does, which means that the launcher's intent doesn't properly match with the Activity's existing intent and it ends up creating a new activity on top of the stack.
I think this question is similar to what you're asking about:
Activity stack ordering problem when launching application from Android app installer and from Home screen

Switch another opened app android

I think we have three apps, and all of them are open and we know the process name. How can I switch from one app to another app, also keeping in mind that another app has opened a intent, and I do not want to go to another app with opening an app launcher, just switching or making another app at front.
I want to make another app on front, for example if Internet is background, I make it at front.
Make the main activity for your applications singleProcess, if the application is already running it will be bring to the front. you can also, implement a custom BroadCastReceiver to start the application using its package name.

I have two app icons in Recent Applications , how to avoid?

I have two activities in "Recent Applications". For those that don't know, Recent Applications is when you long press the home button.
I know why this happens. I am starting my app from a BroadCastIntentReceiver. Then I start my app from the normal launcher icon.
When I press the first icon in Recent Applications, the app opens from the Main activity. However, when I press the second icon, the app opens from the place where the BroadCastIntentReceiver starts the app, this is called PictureActivity.
I have been looking into taskAffinity and am having trouble deciding the most simple way to solve this issue.
Thank you!
When your BroadCastIntentReceiver builds its intent to launch the PictureActivity, try setting this flag on the intent:
intent.addFlags( Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS );
Reference: Android dev site.

Categories

Resources