homescreen

How to check if my application is the default launcher

岁酱吖の 提交于 2019-11-27 19:50:38
I am developing a buissness-application that is essentially a Home-screen, and is supposed to be used as a Default Homescreen (being a "kiosk"-application). Is there any way of checking if my Launcher is the default Launcher? Thanks! Ps. Similar example, but for checking GPS-settings LocationManager alm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); if (alm.isProviderEnabled(android.location.LocationManager.GPS_PROVIDER)) { Stuffs&Actions; } You can get list of preferred activities from PackageManager . Use getPreferredActivities() method. boolean isMyLauncherDefault()

How to add a widget to the Android home screen from my app?

Deadly 提交于 2019-11-27 19:07:07
I'm writing an application which should be able to add widgets (just text boxes) to the home screen of the user's phone when the user instructs my app to do so. How can I do such a thing? I know that I can add an app widget but how about adding more? stinepike It is not possible from a app to place a widget in the home screen. Only the home screen can add app widgets to the home screen. similar links link1 , link2 , link3 But you can offer user to pick widget from widgetpicker. Intent pickIntent = new Intent(AppWidgetManager.ACTION_APPWIDGET_PICK); pickIntent.putExtra(AppWidgetManager.EXTRA

Use my own Android app/apk as launcher/Home Screen Replacement

我们两清 提交于 2019-11-27 12:29:35
I've created my own app and I want this one to be my launcher. It's a simple app, but it works. Is it possible to replace the default launcher with my app so that my app always starts by default after booting? Setting the correct intent filters in your manifest will allow it be prompt you to use it as a replacement: <activity android:name="Home" ... android:launchMode="singleInstance" android:stateNotNeeded="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.HOME"/> <category android:name="android.intent.category.DEFAULT"

Add Shortcut for android application To home screen On button click

穿精又带淫゛_ 提交于 2019-11-27 12:14:24
I want to make it easy to add my app to home screen by pressing a button. So What I am Thinking is a button at the bottom of my app that says "Add to home screen" and when it is pressed, it adds the shortcut to the home screen without closing the application. what code should I add To do that? Send an INSTALL_SHORTCUT broadcast with the resulting Intent as an extra (in this case, the result Intent is opening some activity directly). //where this is a context (e.g. your current activity) final Intent shortcutIntent = new Intent(this, SomeActivity.class); final Intent intent = new Intent();

How to Launch Home Screen Programmatically in Android [duplicate]

岁酱吖の 提交于 2019-11-27 04:05:14
This question already has an answer here: Going to home screen programmatically 6 answers I want to launch home screen of Android with my application. The main target is to show all of apps to user when he/she presses a specialized key. Actually, the way is not important. Any idea to do this? Here is the code for starting HomeActivity Intent startMain = new Intent(Intent.ACTION_MAIN); startMain.addCategory(Intent.CATEGORY_HOME); startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(startMain); The comments you made on some of the answers suggest you actually want to launch the

How can I add my application's shortcut to the homescreen upon app installation? [duplicate]

穿精又带淫゛_ 提交于 2019-11-27 00:53:49
问题 This question already has answers here : How can I place app icon on launcher home screen? (6 answers) Closed 2 years ago . I want to create my app's shortcut/launcher icon on the homescreen as soon as I install my app (even before I start it). Is that possible? How might I do that? 回答1: NOTE: This answer is now wrong. See, for instance, Robin's answer for a way to do this. As far as I know, an app cannot force itself onto the home screen. It gets added to the app list that the launcher app

android: choose default launcher programmatically

只谈情不闲聊 提交于 2019-11-27 00:39:59
问题 I want to pop up a dialog that lets the user choose a launcher to be launched with set as default option . I tried Intent home = new Intent(Intent.ACTION_DEFAULT); home.addCategory(Intent.CATEGORY_LAUNCHER); Intent chooser = Intent.createChooser(home, "Launcher"); context.startActivity(chooser); But the dialog popped by this does not have the option to set default. While the following code will not pop up the dialog if a default launcher is already set. Intent startMain = new Intent(Intent

Creating shortcuts in Android via Intent [duplicate]

霸气de小男生 提交于 2019-11-27 00:39:42
问题 Possible Duplicate: Android create shortcuts on the home screen I am having one TextView and Button in my Activity (HomeActivity.class). Goal : When I click on the Button it should create a shortcut with the default android image as icon and text as entered in the TextView . So far I've found out that we can create shortcuts using ACTION_CREATE_SHORTCUT This is the code I have so far: Intent result = new Intent(android.content.Intent.ACTION_CREATE_SHORTCUT); result.putExtra(Intent.EXTRA

“Add to homescreen” button in Android does not show website as a Web App

故事扮演 提交于 2019-11-27 00:04:12
问题 I've created a mobile-friendly web site with jQuery Mobile and added some meta info so that it should be pinned to iOS and Android homescreens and should be launched as a web app (in other words: in a browser, but without browser navigation elements). It works fine for iOS, but it doesn't work for Android 4.4.2. I followed this tutorial for creating Android-Compatible web apps: Despite adding all the meta info as listed in the tutorial, Android does show the "Add to homescreen" button for my

using onOffsetsChanged() to get home screen swipe direction

▼魔方 西西 提交于 2019-11-26 21:44:20
问题 I'm working on my Live Wallpaper and I want it to scroll with the screen like a normal wallpaper does. I know I need to use onOffsetsChanged() but which parameter will tell me the direction that the home screen is being swiped? It seems like xOffset always returns a positive value no matter which way the screen slides. Thank you. 回答1: The direction alone will not help you: you need to know the exact offset, because the user may have jumped several screens at once (e.g. by using a pop-up that