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

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.

Related

Integrate an apk into AOSP's build system and run it on boot

I would like to have an app (LMT from XDA specifically) Bundled in AOSP/LineageOS.
I can do it via adding it in a Android.mk file , so that's not an issue.
My issue is that I want to have this app launch every time I reboot and unlock my phone.
The reason being I disable the navigation bar and use LMT to navigate, but I cannot use it every time I start my phone as LMT does not auto start.
I am on Android 10.
Can anyone help me figure out a way to tell the system to start LMT every boot?
The app that starts first and shows your Home screen, App drawer etc. is called a Launcher.
You can either:
Have your new app be a Launcher app. You'll need to modify it to add the HOME intent, and also set it as the default launcher of the system.
Or modify your current Launcher app to open your app as soon as it itself starts.

Start service on app install

I have a service in my app along with activity classes. I want to start service as soon as app is installed. I have been able to start service on app launch,on device reboot, but not on app install.
Any idea if it is possible and if possible then how it can be done?
Thanks in advance.
Any idea if it is possible
Upon installation, your app is in the so-called "stopped state" and will remain there until something uses an explicit Intent to start up one of your components. Unless your app is a plugin for some other app that will do this, your app will not run until the user taps on the home screen launcher icon associated with one of your activities.

No launcher icon but still able to be opened

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.

Start Android application without launcher

How to start an application that has no launcher activity?
Story behind the problem:
I have an application that is basically a BroadcastReceiver that waits for a couple system intents like BOOT_COMPLETED. The problem is that as my application has no Activity, it doesn't get started and so it receives no intent.
Android 3.1 release notes mention that intent options can be overridden to start up applications but I assume it requires another active application to do so.
P.S. Write all the ways you know. ADB commands as well.
First piece of advice would be to make a very simple "Welcome to my App" Activity that could be run. Use it to show a splash screen, some advertising, or be a settings screen. That gets you around the "no Activity" problem.
As far as I know, you cannot have anything hooking into BOOT_COMPLETED until and Activity in your application has been run. So you need to have an Activity of some sort.

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.

Categories

Resources