Ok, on the surface I thought this would be fairly easy to do but it's proving challenging for me. All I would like to do is programmatically start the default Android launcher and bring up the apps selection screen. By "apps selection screen" I mean the screen with all the devices applications that is often built into Android, often it can be seen by hitting an "apps" button on a device, the icon associated with the button is often a series of rectangles... I don't actually know what this activity/app is called... so I hope I am articulating this properly.
I know how to start the launcher, the intent I am using looks like this:
Intent().setComponent(new ComponentName("com.android.launcher", "com.android.launcher.Launcher"))
This can be used to start the launcher, however I don't know how to bring up the apps screen. I have looked at the logs using logcat and find that I see nothing to indicate an activity/package/application name when I press the apps button on my device(s). Would anyone be able to shed any light on this for me?
I've been Googling this for quite awhile and haven't found anything I can use, this admittedly could be because I don't know the name of the functionality I am trying to trigger, but for the life of me I can't find that either! . If anyone could point me in the right direction I would really appreciate it. Thanks much.
I know how to start the launcher, the intent I am using looks like this:
There is no guarantee that com.android.launcher exists on any Android device, let alone that it is "the default Android launcher" for the user's configuration.
Would anyone be able to shed any light on this for me?
There are dozens, perhaps hundreds, of launcher implementations that come preinstalled on devices. There are hundreds, perhaps thousands, of launcher implementations that users can download from places like the Play Store. None are required to provide any means for a third-party app to directly drive to "the apps screen". Heck, some will not even have an "apps screen".
You can see the source code to com.android.launcher here. This particular launcher is ancient, and there is no separate activity for the "apps screen", let alone one that is exported for third-party use. The same holds true for com.android.launcher2.
Related
I need to get a notification when the user long-presses my app's icon from the launcher screen.
After a lot of research - I encountered 'app shortcuts' and it seems the closest thing to the functionality I need, though I couldn't find any event or broadcast fired upon long pressing my app's icon.
I don't think this has been answered here before since I'm trying to find a solution for hours now.
I looked into all the tutorials under AD: https://developer.android.com/guide/topics/ui/shortcuts.html
I also tried googling any possible combination might give me some leads, but couldn't find anything.
The functionality in possible (saw another app uses it), though running
dumpsys activity broadcasts
I couldn't find any related broadcast.
Is there's any standard broadcasts fired by the launcher maybe?
Is there's any standard broadcasts fired by the launcher maybe?
Well, there are hundreds, if not thousands, of launcher implementations, both pre-installed and user-installed. There is no requirement for any of them to send a broadcast in any situation, let alone specifically a long-press on a launcher icon. There is no requirement that there even be a launcher icon — the launcher does not have to use icons.
So, no, there is nothing that you can do for this that will offer this on each of the ~2.5 billion Android devices.
Note a device manufacturer's own launcher can do things with that manufacturer's own apps that it might not do with arbitrary third-party apps like yours or mine.
The functionality in possible
Then you should see the broadcast in Logcat.
I want to make a widget but it should be uninstallable or undeletable from home screen (if possible) like "google search" widget on nexus & moto phones. I searched it already but didn't find anything related to this. Is it really impossible to built such widgets?
Is it really impossible to built such widgets?
Yes. The decision of what widgets to allow users to add and remove is up to the home screen implementation, not you. So, for example, if on "nexus & moto phones" you install a third-party home screen, the Google search widget may or may not be available at all, let alone non-removable.
If you want to force people to have certain things on their home screen, write a home screen, then use heavy weaponry to force people to use that home screen. Note that the use of heavy weaponry may be illegal in some jurisdictions.
I know about offsetChange function, but it doesn't work on such devices as Galaxy S4. I think it happens because of TouchWiz wrapper. So I need to find out another way to determine count of home screens.
Any help will be appreciated!
Android has main screen like desktop.
Android has a home screen. Whether it is "like desktop" or not depends upon the device and user.
There are several home screens, you can switch between them
It is unclear what you mean by this.
You might mean "an Android device can have multiple applications installed that each offer to be a home screen, and the user can choose which of those applications to use". In that case, creating an Intent for ACTION_MAIN and CATEGORY_HOME, then passing that to queryIntentActivities() on PackageManager, should give you the list of possible home screen implementations.
You might mean "all Android home screens offer some sort of swiping option to move to different portions of space". Some home screens offer this, and there is no standard way to find out. There is no requirement that a home screen offer the capability of swiping this way, let alone a requirement to supply an API for third-party apps to find out details about them.
I'm looking for some help from developers who are know android development. We have a client who wants to use an Android tablet as a means of collecting data when someone walks into their office. The problem is that they don't want any of the background functions or access to the net on the device (it's there to log people in so it should not move from that function with out some other credentials to "unlock" the device.)
With apple I know you can lock the screen on to a page/app but not sure about android? Can't find any thing online that would tell me it can be done on android.
With Android you can replace the launcher (home screen) app, and if that app doesn't give you access to launching other things, then you cannot do other things. The first time you press the home key after installing another launcher candidate, Android asks you which home screen application to run (the original or your new one) and allows you to set your answer as the default, eliminating the question in the future.
I need a screen control (possibly but not mandatory an app widget) that will seat
on Android's homescreen and will always be visible to the user - even when he scrolls the homescreen to the next page.
Please help me if any body have done this before.
I think the only way you will be able to do this is if you implement your own Launcher.
The functionality that you're looking for, being able to place a static widget on every screen of the launcher regardless of how many screens they have, isn't currently available in Android, nor any of the launcher apps out there (Go launcher, ADW, Launcher pro etc) nor any of the versions of Android which have been rewritten by the phone manufacturers (HTC's Sense, Samsungs Touch Wiz etc)
It's a big job to write a Launcher yourself, but the stock Android Launcher code is available to play about with from https://android.googlesource.com.