pinning shortcut widget for lower api - android

Is there any way to use this feature on android devices with api lower than Nougat

ShortcutInfo is only available since API 25, and unless they release a support library for that, then I'm afraid it is not possible.
If your app targets Android 7.1 (API level 25) or higher, you can define shortcuts to specific actions in your app. These shortcuts can be displayed in a supported launcher.
Keywords on the page are a supported launcher, so the one on the Google Pixel might work, for example, but don't expect an LG or Samsung device to also allow the same feature
The current action for long clicking an icon exists, though. It allows you delete or move apps on your home pages, but, again, that's up to the launcher to implement and support that action.

This feature is supported in launcher. Long press on app icon is implemented in API 25 or higher, If the user doesn't allow the shortcut to be pinned to the launcher, your app won't receive a callback.

Related

Disable recent apps button as device owner

This subject has been beat to death, but I'd like to give it one more shot. Every query I do from this site or basically google give several hint/tips on handling when the button is pressed, but from what I understand the Samsung Knox has the ability to disable the button, and I'm wondering if that's a custom implementation baked into knox or just something i'm completely missing.
My application will be set as the device owner application for other reasons, but I do not see any low level items regarding the recent apps button.
I am currently targeting Android 21 (5.0). We currently use commercial (non root, multiple manufacturer and OS level) phones that we provide with one of our apps being mapped to the home button and monitors accessibility, and the primary application we attempt to keep in the foreground.
A few things...
I'm not interested in making my application a kiosk application so that is not an option for mean at this time.
I can monitor for the Intent.ACTION_CLOSE_SYSTEM_DIALOGS and bring my application to the front (or handle differently), but this still allows for the button to be pressed and the screen to load for a bit.
I've attempted all of the options for getWindow().getDecorView() and setting the flags of SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_IMMERSIVE_STICKY, SYSTEM_UI_FLAG_IMMERSIVE (different combinations of the flags) during the OnResume, OnWindowFocusChanged, and as a callback listener on the 'setOnSystemUiVisibilityChangeListener'. This works OK for a while but after several pull down attempts on my Pixel 2 the navigation is stuck open.
I'm not very well versed in the capabilities of an application that is the device owner, but I cannot find this lower level configuration option available.
Any help is appreciated

how can I add lock screen interacting widgets in android pie

I want to access my apps functions directly from the lock screen but I can't, it is only showing the app icon without the ability to click it unless screen unlocked,i am using my mobile with android 9 as emulator .
is there any way to solve it,thanks
as I found from Android developer website,it is not possible after version 5 as below
"The widget Category attribute declares whether your App Widget can be displayed on the home screen (home_screen), the lock screen (key guard), or both. Only Android versions lower than 5.0 support lock-screen widgets. For Android 5.0 and higher, only home_screen is valid."

what is different in Android 5.0 (LOLLIPOP) notification?

I have bunch of apps that use notifications work for Android 4.4 and lower. Are these notifications going to work in android 5.0? If not, how to set notifications in Android 5.0?
You do not have to change anything, only functionality is added.
Android Lollipop - Notifications:
Notifications in Android 5.0 are more visible, accessible, and
configurable.
Varying notification details may appear on the lock screen if desired
by the user. Users may elect to allow none, some, or all notification
content to be shown on a secure lock screen.
Key notification alerts such as incoming calls appear in a heads-up
notification—a small floating window that allows the user to respond
or dismiss without leaving the current app.
You can now add new metadata to notifications to collect associated
contacts (for ranking), category, and priority.
A new media notification template provides consistent media controls
for notifications with up to 6 action buttons, including custom
controls such as "thumbs up"—no more need for RemoteViews!
In android 5.0 (Lollipop) only functionality has increased.So Lollipop will support all lower API apps without fail.
Read more about Lollipop here - Android Lollipop

How to automatically add widget to the lock screen 4.2

I want my music widget to be shown on the screen in a similar way that RemoteControlClient works. I don't want the users to be needed to have the widget added to the lock screen beforehand. The samsung music app on thier 4.2 devices have this behaviour.
AFAIK, this isn't possible in the public SDK. Samsung's apps may be able to do it on their device because they are developed by Samsung for their own devices and have greater access as preinstalled system apps.
No API that I am aware of does this as of now.

Android menu forward-compatibility

I created an app with minimum SDK 7 in order to get maximum compatibility with circulating devices. On Android phones (GB2.3), pressimng Menu button pops up a menu strip on the bottom of the screen, and that is correct.
However on HC3.2 tablets, where no menu hardware key is present, I expected a soft-menu key on the bottom of the screen, but it didn't appear, so I can't open my menu.
I don't know where to investigate and which portion of my code to share, so could you please show me where do I have to look for menu softbutton?
After reading that menus are deprecated in most recent Android versions, I don't know if ICS4 has a soft-menu button or not. I never tested my app on such a device. Can you give me advices?
Thanks
The link you provide tells you how to correctly provide action bars in your app so that the presence or otherwise of a physical menu button is irrelevant, so that's a good start.
Now, you need to combine that with a little runtime detection of the SDK version (just check the Build.VERSION.SDK_INT constant for Android 1.5 or above), along with some appropriate reflection to enable the same APK to run on any Android version starting with your minSDK version.

Categories

Resources