Current status for Android TV apps? (What to use instead of the notification bar on Android)

My own app, the VPN app, is currently relaying its own VPN status symbol for Android to the notification bar to notify users of its status.

In Android TV, the user does not have the opportunity to find out if he is connected to the VPN or not. This is also a small security issue (for malicious VPN applications).

The only thing I found is the behavior that now plays in media applications.

My question is: is there a way to change my own launch icon or dynamically change some other way to present the current background state to the user without forcing the user to open the application?

+5
source share
1 answer

You can use the notification, although it is considered a recommendation on the Android TV system. Changing the start icon is not supported.

Here is an example notification that works on Android TV.

Notification notification = new NotificationCompat.BigPictureStyle( new NotificationCompat.Builder(mContext) .setContentTitle(video.getString("title")) .setContentText(mDescription) .setPriority(mPriority) .setLocalOnly(true) .setOngoing(true) .setColor(mContext.getResources().getColor(android.R.color.holo_green_dark)) .setCategory(Notification.CATEGORY_RECOMMENDATION) .setLargeIcon(thumbnail) .setSmallIcon(R.drawable.ic_note) .setContentIntent(launchApp(mContext)) .setExtras(null)) .build(); return notification; 
+1
source

Source: https://habr.com/ru/post/1240093/


All Articles