In my Android app I need to show the counter on launcher app icon.
Before Android Oreo I used ShortcutBager library. But this one doesn't work anymore in the newer Android versions.
As far as I understand, native Android Oreo bagdes are showing only when app receives notifications. Is there any way to set the counter value manually?
Related
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."
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.
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
In the application,I am trying to a make activity show when user opens the screen lock (screen unlock) and when activity finish user open screen lock activity run back.I am trying
Intent.ACTION_SCREEN_ON
but it is not working properly. And I also used
USER_PRESENT
but I am not able get expected answer
I tried to find on google but was unsuccessful ,so I am confused how to make this type please tell me fast.
What version of Android are you targeting?
I have been able to get USER_PRESENT working fine on 2.x devices, by declaring it in the manifest.
On 3.x & 4.x I was unable to get it working at first. On these later versions you need to run the activity at least once before the system will allow you to register for the event. This is not needed in 2.x.
Intent.ACTION_USER_PRESENT not received on HoneyComb or ICS (Samsung) devices
android app with service only
I have succeeded with this on 2.x, 3.x and 4.x devices and it works. A simple option for an activity to run, if your app is a background app, is a welcome screen with configuration options on it. This would not be out of place in a background app, and satisfies the conditions.
I have an Android app that uses the NotificationManager to inform the user of certain events. When I call .notify(), the icon I specify is shown in the status bar. It works fine on various Android 2.2 and 2.3 phones. But on a Galaxy Tab 10.1 running Android 3.1 the notification icon on the status bar is so dim it can barely be seen. I've seen one other app that has a similar problem, but all the other apps I'm using that do notifications look OK. I've followed the Guidelines at http://developer.android.com/guide/practices/ui_guidelines/icon_design_status_bar.html, including creating Android 2.3+ style icons and putting them in the drawable-hdpi-v9, drawable-mdpi-v9, etc. folders. The icons all look OK when I look at them on my development machine; they are the right colors and are not dim. What could I be doing wrong that is causing my notification icon to be shown so dim on the Honeycomb status bar?
As of today there is updated documentation available at the android developers web site:
http://developer.android.com/guide/practices/ui_guidelines/icon_design_status_bar.html