Custom expanded notification implementation on wear os - android

What I need
I need a wear notification that shows some summary text (which is formatted - so a custom layout here is needed), and when expanded a list of formatted text (another seperate custom layout) will show with actions at the bottom of the screen. I don't want to use any deprecated methods and it should be decorated similarly styling to android.
What I've tried:
Remoteviews and decoratedCustomViewStyle
This lead to no results, not showing the layout or text that i specified (I later found that this is stated by android too"
Notifications using RemoteViews
are stripped of custom layouts and the wearable only displays the text and icons. However, you can create custom notifications that use custom card layouts by creating a wearable app that runs on the watch.
Found here
setDisplayIntent
This follows the developer guidelines for custom notifications on wear. This looks fine and all but I found out it is deprecated in API level 29. A combination of setDisplayIntent and addPages would have been perfect.
setContentIntent
This allows for a seperate activity to be launched on expand, and this is the kind of functionality I want, however, this is launching the app, and not baked into the android notification itself.
I'm really running out of ideas here, and was wondering if anyone has any up to date ways of making custom notifications like this, as there doesn't seem to be any updated guides.

Related

Different filters for Palette on Android O notifications

The new Android O notifications for MediaStyle will now use the content big picture art and use it for the letters and background of the entire notification.
The end result looks great sometimes, and sometimes it is a bit over the top in regards to color contrast. Since the Palette API has filters that allow to configure the behavior (https://developer.android.com/training/material/palette-colors.html), is it possible to set those filters when building a notification with MediaStyle? I know that if I build my own notification with RemoteView I can set those things manually, but that would imply a lot of overhead just for this 1 thing. Suggestions welcome.
No, there is no API for controlling the colorations chosen for MediaStyle notifications. Just like all built in styles for notifications, they are templates that manufacturers can customize to their liking (although many stick closely to the AOSP style).
Given that users will be expecting the new style (including the 'bit over the top' colors) and for consistency across all apps, you should continue to use MediaStyle.

Titanium PushNotification How to display in one group?

I am facing a problem with development a application.
I am using a Cloud Push Notification with Titanium Appcelerator.
I have need display push Notification in Group.
How display this is display in single particular particular tab?
I am sharing 2 images
Currently looking like this.
I have need look like this. How do?
You have to use a Big View Notification Style but it is only available in 4.1 or newer
quote from here:
A notification's big view appears only when the notification is expanded, which happens when the notification is at the top of the notification drawer, or when the user expands the notification with a gesture. Expanded notifications are available starting with Android 4.1.
in the same document, you can find a sample how to use this. there are also som tips/hints how to maintain compatibility with older devices (not only regarded to the big view)
you must put the following code in your TiApp.xml
<property name="acs-grouped-notification-message-" type="string">You have $number$ unread messages.</property>

How to display unread count to the android app icon?

I want to display the unread count to the application icon. I refer the lots of stack overflow answers for achieving that. All the links are saying that it is not possible. But android Mail, Message application displays the unread count at the top of the icon and in some links says that use widget instead of icons. But I don't know how to use the widget instead of icon displays in android application.
Like the above image I want to display unread count in my application icon.
Unfortunately, You can't do that on application icon. Android doesn't allow that.
But you can do that using widget.
There are many question related this, check it first.
Question 1
Question 2
Question 3
Widget Example
Widget Link
Update : 24/04/2015
Now this is possible for some launcher app.
Check this ShortcutBadger and BadgeUtils
Update
Android allow Modify a Notification Badge from Android 8.0 (PI level 26).
Showing Badge in application icon is not allowed by default in Android. We can do this in some of the customized devices available in android:
Below are the links how we can show on some Device like Sony,Samsung etc.
https://github.com/leolin310148/ShortcutBadger
Utility Class I found on git:- will be helpful also
https://gist.github.com/Tadas44/cdae2f5995f21bf1c27f
And for rest of the Non customized devices we can create a custom widget to reflect this same behaviour.
See How to create Widget:
https://looksok.wordpress.com/2012/12/15/android-complete-widget-tutorial-including-source-code/

Android: Replace Notification Bar

currently I'm working on an UI Replacement of Android, currently achived by writing a different launcher and different-styled apps. All's good so far, BUT: there is still the notification bar missing, means, I have no idea how to replace the notification bar.
The "new" notification bar shall show only generic informations like the clock and network state, similar to windows phone and ios, without NotificationManager-binding.
How can I achive this? I know that there are several notification bar replacement apps out there, like omega statusbar or statusbar+.
My idea was to make every app of my UI fullscreen and having its own NotificationBar-Instance, fed by a ContentProvider or Service. But if the user decides to use classic android apps, he also will see the generic notification bar, which isn't what I want.
Also it might be an idea to create a window on top the notification bar, but I have no clue either this is "the right way", nor if it is even possible to achive this in this way.

Dynamic notification icons (large) in Android, targeting 2.2

This question has been asked before, but has not been properly answered yet. I know this is possible but we're feeling a little confused.
We need to display custom/dynamic images in the status bar when push notifications are received. We're concerned with the larger image seen in the pull-down, not the small image in the actual status bar. Because they need to be dynamic, the images can not be packaged with the apk and we are trying to target Android 2.2
What we're trying to achieve is similar to how Facebook displays the profile image of the user who initiated the notification in the notification bar. It's also similar to how whatsApp shows the group image in the notification bar when a new push notification arrives.
From what we've read, this is possible only in Android 3+, sdk 11. But that can't be true.
We've installed both Facebook and WhatsApp on an Android phone running 2.3.4 and sure enough, custom icons display in the notification bar.
So what's the secret? How do they do it? How can we do it?
so what you are trying to do is set the setLargeIcon(Bitmap icon) in the notification builder. This is available in APi 11 and above (honeycomb). The notification builder in the compatibility package v9 can set it for you, but it will only appear on api 11 and above.
To achieve the same effect in 2.3 and below you must create a custom notification layout and set it with setContent(RemoteViews views) in Notification.Builder to generate a custom layout. This can be styled with a large icon on the left side to imitate the > API 11 styles.
Creating custom layouts is tricky and many things have to be taken into account, such as available screen size on other devices to display the notification, and themed text colors (especially as notifications used to be dark text on white bg, now they are light text on dark bg) There plenty of guides and even SO posts that can help you out (such as this one)
In regards to getting a dynamic image, when the phone receives the message (push notification or whatever) and your app goes to build the notification, you can do a small http request to pull a dynamic image before building the notification. This will delay the posting a few seconds, but it doesn't really matter. Then you can get the resulting image and use it in the notification. The specific image can be chosen by sending some data with the (im assuming push notification) that identifies what photo, such as a url, or an id that you can append onto an already existing url in your notification building part of the app.
Hope this helps, any followups just ask :)
You can't use anything but prepackaged drawables as your notification icon as seen on status bar. And no, you did not see anything like you look for in FB app (or you talk about notification area seen when you pull it down).

Categories

Resources