[Opensource/Testing] QuickShortcuts - Make dynamic and pinned shortcuts

QuickShortcuts

Backwards compatible with versions < Android 8 (SDK 26). Features will only work when the user’s device is Android => 8 (SDK 26)

This is a extension that lets you add dynamic shortcuts as well as request user to pin shortcuts to the home screen.

Suggestions and bug reports are suggested as this is my second time dealing with Java and I might not be very experienced at it yet

This is a test release and the blocks included might change before release. If you plan to use it frequently, please think twice before using.

Gallery

Block Documentation

CreateDynamicShortcut

Creates dynamic shortcuts on the app. Users can then access it by holding down your app icon

  • shortcuts - list (with BuildDynamicShortcut inside of list)

BuildDynamicShortcut

BuildDynamicShortcut

Builds the shortcut information into a list

  • id - String
  • shortName - String
  • longName - String
  • icon - String (Images from app assets only | Might change in the future)
  • screen - String
  • startValue - String

CreatePinnedShortcut

CreatePinnedShortcut

Creates a pinned shortcut on the app and requests the user to place it on the home screen.

  • id - String
  • shortName - String
  • longName - String
  • icon - String (Images from app assets only | Might change in the future)
  • screen - String
  • startValue - String

RemoveShortcut

RemoveShortcut

Removes a dynamic shortcut by id

  • id - String

DisableShortcut

DisableShortcut

Disables a shortcut by id

  • id - String

EnableShortcut

EnableShortcut

Enables a shortcut by id

  • id - String

RemoveAllDynamicShortcuts

RemoveAllDynamicShortcuts

Removes all dynamic shortcuts. Does not apply to pinned shortcuts or dynamic shortcuts that has been pinned to the home screen

IsDynamicShortcutExist

IsDynamicShortcutExist

Checks if a dynamic shortcut exist or not

  • id - String
  • Returns - Boolean

IsPinnedShortcutExist

IsPinnedShortcutExist

Checks if a pinned shortcut exist or not

  • id - String
  • Returns - Boolean

IsRateLimited

IsRateLimited

Checks whether the user’s device is blocking the app from creating shortcuts due to spam

  • Returns - Boolean

IsShortcutsSupported

IsShortcutsSupported

Checks whether the the device is supported by the extension (Use this to disable any button if shortcuts is not supported on the user’s device.)

  • Returns - Boolean

IsPinnedShortcutsSupported

IsPinnedShortcutsSupported

Checks whether the user’s device launcher supports pinning shortcuts (Recommend use before CreatePinnedShortcut)

  • Returns - Boolean

Download & Source Code

Test AIA Project File

testing.aia (16.0 KB)

39 Likes

Great Extension! :+1:

2 Likes

Version 0.2.0 Beta

This release breaks blocks created in 0.1.0. Please re-implement after update

New blocks:

  • IsShortcutsSupported - Checks whether the the device is supported by the extension (Use this to disable any button if shortcuts is not supported on the user’s device.)

Changes:

  • Extension is now backwards compatible below Android 7.1, the extension will simply not work on older devices but the app still can be installed
  • CreateShortcutCreateDynamicShortcut (Renamed block)
  • RemoveAllShortcutsRemoveAllDynamicShortcuts (Renamed block)
  • SupportsPinnedShortcutsIsPinnedShortcutsSupported (Renamed block for consistency)

aia please

Thanks for the suggestion, the AIA has been added to the first post

1 Like

Version 0.2.1 Beta

Changes:

  • Increase SDK requirement to API 26 (Android 8) as app shortcuts and not fully implemented on API 25 (Android 7.1)
1 Like

I was looking for a way to add the icon of the app in the home screen (because the icon is nont automatically creaated if the app is not installed from playstore) and I ended up finding this extension.
It is not what I wanted but I liked it very much. Too bad that it won’t work at older devices, in my country they are about 60% I guess. But still, it is a very nice extension. I am gonna implement in my app very soon.
Congratulations for your work and for making it open source.

The app does not work on phones with api level less than 26 due to this extension. So it would be great if a solution could be found.

Did you read that? You can’t use this extension with API Versions under 26.

@Ded_Sec_00, @Meokkoma just simply told to fix that thing even if extension does not works for that android version the extension developer should find ways to make it work or maybe wait for his reply if he says that its not possible then its ok.

1 Like

I know and I answer that post. The SDK is not compatible with that Android version and it will not able to fix it because of Android.

maybe there are other libs that works in those android version? you are not the one to answer this? let the dev come and answer it.

Sorry for the late reply, dynamic shortcuts and requesting pinned shortcuts are only implemented in Android 8 there it is not compatible with any Android version below 8.

Edit: You can still use the extension even if your minimum sdk level is set below Android 8, the extension will just not run the functions if it detects the user’s device is below Android 8

1 Like

My cell phone is a Samsung S9 PLUS

Testing in my app and I get this error:

When I test your aia, this error returns me:

android version?

are you setting the icon from a custom path or from assets?

Android 10

Assets

Hi, I will test this tomorrow on a Android 10 device. Thanks for the feedback

1 Like

Could you add a procedure so that we can do something once the pinned shortcut is added to the Desktop? I want to hide the button if it’s been added so they can’t add multiple identical shortcuts.

I want to use this extension in my app, but my app is from version 5.0 and up.
My question is: Can I use the extension in my application? I say this because I think it will appear to those who will have android => 8, but to those who will not have this version they will simply not appear.
Can work?