Set Home Launcher via ADB - android

I want my app to be in KIOSK mode every startup, so in my AndroidManifest.xml I define my MainActivity as
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</activity>
I am developing in an S99 smart watch. Unfortunately, I couldn't find a setting item where I can customize its default home launcher.
Home launcher selection won't also display when I tap the home menu.
So I am thinking to have it via ADB. Is it possible?
How can I set my Activity to be the default launcher in ADB?

Related

android home application not starting after reboot why?

i have an android tv application and need to make it launcher application and home application
i added the below code in manifest
<activity
android:name=".ui.main.LandingActivity"
android:launchMode="singleInstance"
android:stateNotNeeded="true"
android:exported="true"
android:screenOrientation="landscape">
<intent-filter>
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</activity>
Also in Settings -> Default -> Home App -> i select my own application
So when i click home button in device it navigate to the launcher activity of my application, but when i restart the device , the application set as default doesn't run by default and immediately
i checked the settings and make sure that is selected by default.
So why the app is not opened by default after reboot?
try
android:launchMode="singleTask"

How to redefine the HOME key press in Android, but only when my application is in the foreground

I want my app to handle the HOME key press with a custom action, and also stay in the foreground. I put the following code in AndroidManidest.xml:
<activity
...
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
....
</intent-filter>
</activity>
However, this has set my app as the new home screen, which I don't want. I only want to capture the key press while my app is in the foreground, just like you can capture other buttons. Is there any way to do that? Perhaps set the intent filter to only work while my app is in the foreground?

My android application always be in launcher list

hi i am new in android application Development
after successfully Developed android application when i install apk of that application it is always under launcher list, and always ask to select default launcher when i press Home key. How to prevent app. to be in list under launcher.
manifest file code are as follow.
//Manifest
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.dewebclient.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.example.dewebclient.IpConfigure" ></activity>
<activity android:name="com.example.dewebclient.WebViewClientDE" />
<!--android:theme="#android:style/Theme.NoTitleBar"-->
</application>
Remove below line from your AndroidManifest.xml file.
<category android:name="android.intent.category.HOME" />
Explanation :
The category HOME is used to declare your application as a Home launcher. By putting this in the AndroidManifest.xml, user will have the option to have your application open upon pressing the home button.
According to Developer Docs.
This is the home activity, that is the first activity that is displayed when the device boots.
<category android:name="android.intent.category.HOME" />
Remove above line from AndroidManifest.xml .
<category android:name="android.intent.category.HOME"/>
Remove this and check.
This indicates that when you press home button, your app will be listed as an option to launch the launcher home or your home activity (along with all the applications which have this category in their manifest for an activity). To be more simple, whenever you press the home button, all the applications installed in your phone which have CATEGORY.HOME category and Action_Main in intent-filter in their AndroidManifest.xml will be listed (unless you have chosen some application as default) in a chooser for the user to select which HOME they want to launch.
change your intent filter look like below.
and relaunch application.
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
referenc this link

How can my Launcher deploy default launcher choice window?

I had an android launcher project. After installed on my phone, pressing HOME will NOT make the "default launcher choise" popwindow showing to choose default launcher.
following is related setting:
<activity
android:name="MyLauncherActivity"
.....
.....
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.MONKEY" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
how can I make that popupWindow show ?
P.S How curiouse it is! I just restart Eclipse and reinstall it, pressing HOME make the default launcher choise popupwindow showing!
<category android:name="android.intent.category.LAUNCHER" />
in your activity intent-filter means this is the start point of the app, when the user clicks on the app icon, will run this activity ( it doesn't mean this activity is a launcher app)
and you are looking for this:
How to make a launcher

Adding app launch icon to the home screen

I would like to place the app launch icon on the home screen once the user installs my android app. This should be done even if the user does not open the app.
I have tried adding "category android:name="android.intent.category.HOME" in the manifest file for my main activity. But this does not work.
Any pointers on how solve this issue?
Thanks
Srao
I think this would be enough:
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

Categories

Resources