Lawnchair: Quickshortcuts for android 6 & 7.0

Created on 17 Jul 2017  路  32Comments  路  Source: LawnchairLauncher/lawnchair

Is it possible? Please make it happen. Sorry if this feature has been asked before.

_Sent from my Sony F3211 using FastHub_

Most helpful comment

Yes but currently disabled because it isn't optimized yet.

All 32 comments

Can you elaborate?
You mean app shortcuts?

App shortcuts are functional.

@RWOne Yes on android 7.1.1 or higher. I mean app shortcuts for the no supporting OS like android 6 & 7.

_Sent from my Sony F3211 using FastHub_

@AxiK101 They're working, if you are not seeing them, set the Lawnchair launcher as the default.
Settings -> Search for home, select home app and select.

No shortcuts

_Sent from my Sony F3211 using FastHub_

See above, set launcher as the default, then retry.

I am not retard dude. I know what i am doing and saying. I run android 7.0, i have Lawnchair as my default luncher, no shortcuts working. Sony Xperia XA Ultra device.

_Sent from my Sony F3211 using FastHub_

No one's calling you anything. Lose the attitude at the door, or let it close behind you when you leave.
May be a device specific thing then, stock 7.1.1 working here.

There is no attitude. You said on 7.1.1 is working. I know that. The point is to make it work on 7.0.0. I am realy clear to what i ask. If you don't have a proper solution, plz do not mention the obvious

_Sent from my Sony F3211 using FastHub_

There may not be one, app shortcuts were introduced in 7.1.X, may not be backportable.

Well maybe you are right. But some launchers like nova, action, evie do support quickshortcuts for older OS. I just hope that devs could make them work for Lawnchair too

_Sent from my Sony F3211 using FastHub_

@RWOne

He's right. I had an issue asking about this and the dev said that there are not available on 7.0 or lower. The app shortcuts got introduced on 7.1.1 but some launchers made them work on 7.0/6.0.

Well those launchers use the old UI for App Shortcuts from Pixel Launcher Nougat version. So or the dev didn't look into this or the code for shortcuts also have been changed and for now there's no way to bring this feature on 7.0 or lower.

Wish the devs would try this out

_Sent from my Sony F3211 using FastHub_

It is absolutely possible to get the _static_ shortcuts on

For each of the packages on the device:

  • Load the APK's absolute location using ApplicationInfo.publicSourceDir (you MUST use the GET_META_DATA and GET_SHARED_LIBRARY_FILES flags when using getInstalledApplications)
  • Use this location along with ZipFile to load the APK as a zip (you can do this, strangely)
  • Load the manifest file using ZipFile.getEntry("AndroidManifest.xml"), and get the byte representation from the file as you would any other
  • Decompress the XML. This is a bit difficult, I based my code off this: https://stackoverflow.com/a/4761689/1088334
  • Parse the XML as you would any other, searching for a meta-data tag with the android:name of "android.app.shortcuts". In the case of Lawnchair, you would need to store the activity component too obviously, but that wasn't required for CQS
  • The android:resource attribute is what you want here, it will be in the form of a resource ID (use Integer.parseInt(..., 16)). That's the hard bit done.
  • Use PackageManager.getResourcesForApplication to get the resources for the package, and use PackageManager.getXml to get the XML file for reading. The XML is in a standard format, like this: https://developer.android.com/samples/AppShortcuts/res/xml/shortcuts.html. Parse that, and use your resources for application to load the icons and labels.

That's it! I do recommend storing this data in the case of a launcher though, as it's quite a slow process to do every relaunch, but _please_ only do so on <7.1, it's not a great idea to store shortcuts on >=7.1 because they change often with dynamic shortcuts

@KieronQuinn You should apply in the developing group dude. Nice!

_Sent from my Sony F3211 using FastHub_

@AxiK101 I'm busy with my own projects right now so am not taking on any others but will consider it in the future

Good to know. 馃槈

_Sent from my Sony F3211 using FastHub_

@deletescape Could you try what KieronQuinn said above?

Hey, no one mentioned Android 5.0. What's up with that?

@KieronQuinn After some searching, I found a hidden method that allows AssetManager to load the manifest file. So the first four hard steps is not required anymore.

Hey @paphonbth, on latest beta it says that app shortcuts backported but are inactive. Does this meen you found a way to make them work for <7.1 devices?

Yes but currently disabled because it isn't optimized yet.

Hoping this feature can run on lolipop...

Bro, same here Mr Steve

I can't see why it wouldn't (assuming Lawnchair does, I've never checked), it works fine on 5.x for Custom Quick Settings

Sesame shortcuts app gave Nova launcher a boost. Now almost all shortcuts work, even the ones that was only for 7.1.+

_Sent from my Sony F3211 using FastHub_

Sesame uses an app-specific approach with "hard coded" methods. Basically on API25 apps, they can define custom methods to dynamically generate the shortcuts (the part we can't do on API<25), and can also define static links (which we can, and do display). What Sesame does is basically extracting the former methods and moving it to a common library, so that the apps don't have to define it. It is practically a huge database of functions that define shortcuts for certain apps, nothing more. We can't do that.

Sesame appears to mostly make use of deeplink URIs, if you install it and check the config file it produces (needs root), you can see what it's linking to.

A good example of this is FB Messenger, where you can simply do:
am start -d fb-messenger://groupthreadfbid/<id>
where ID is the numeric ID of a group thread (check messenger.com's URLs) and it will open the thread

Messenger has loads of these, as does Facebook, Instagram, and loads of other apps. Hell, you can even use normal URLs in some cases, like for Discord:
am start -d https://discordapp.com/channels/<id>

The reason I'm so for app shortcuts is I'm actually in the process of making Custom App Shortcuts, which edits the system shortcuts.xml file (API 25+) and has similar results to Sesame, but has more possibilities for launch (for example Sesame can't open links to group chats in some messenger clients, CAS can, as it has more privileges), as well as supporting any launcher that supports app shortcuts (except Action launcher, because that uses a strange caching method - hence why I was against caching for Lawnchair on API 25+)

@KieronQuinn is there a usable app in development to test? What you suggest is awesome

_Sent from my Sony F3211 using FastHub_

Hi,
I just installed latest release (v1.0.1063), and using LineageOS 14.1 build of 08/08/2017 for Nexus 5 (so Android 7.1.2), and app shortcuts are not working : I only get edit, widget and app information instead of application shortcuts.
Lawnchair is set as default launcher and all permissions have been granted (Location, Storage and Phone).
How could I get you some debug logs/information to help investigate ?
Thanks.

@jackmort37 please open a new issue for your problem, this is not related

How come some shortcuts to appear in the bubble but when taping no action happens, just they open the app..? Fr example Hangout's doesn't work

@AxiK101 this is probably an issue with the app, Shortcuts aren't made to work on older APIs so we can't grant you that all of them will work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AxiK101 picture AxiK101  路  5Comments

ACHOKAMAN picture ACHOKAMAN  路  3Comments

zilexa picture zilexa  路  3Comments

Pau1ey picture Pau1ey  路  5Comments

tstackhouse picture tstackhouse  路  6Comments