Automatic update of notifications when system language is changed - android

My questions are basically for AOSP code (Android version 4.3).
Questions:
1) When we change system language, already generated notifications are not updated to new language. Is it a bug in Android. If yes, why they are not supporting it(any major problem as such).
Is there any plan for supporting this?
2) If automatic updates are not supported by android, what is the best possible way of doing it?
Awaiting for positive reply on this.
Thanks,
Mayank

Updated answer.
No, it is not a bug and is working as intended I suppose.
Notification text is dynamic and there is no way the OS will know how to translate it automatically. The best thing to do is let the app handle it. I don't think it will be supported.. No at least anytime soon.
Best way is to override the onConfigurationChanged method and update all your notifications from within the method.

Related

NotificationManager getActiveNotifications() for older devices

I want to be able to get active notifications from my Android app on demand. (actually I just need to know if there are any)
I've been searching for this behavior and it seems, like I have only two options: NotificationManager.getActiveNotifications() which is exactly what I need, but is only available from SDK 23 or using a NotificationService but I really dislike this solution as I have to provide the permission to my app to read all notifications which is definitely an overkill.
Does anybody know about any solution which would behave like NotificationManager.getActiveNotifications() and not require SDK >= 23?
Thanks in advance!
You know which notifications you raised, because your code raised them.
In theory, you can know which notifications were removed, by using setDeleteIntent() to register a PendingIntent to find out when the user clears that notification. I have not used this in quite some time, so it is possible that this does not work as well as it used to.
But, if you know which notifications you raised, and you know which notifications were cleared, knowing which notifications are still outstanding is a matter of bookkeeping.
To be honest, "what are the active notifications?" feels like a code smell. There may be very good reasons for asking that question. If we were teammates, and this was part of code review, I would be asking why we care whether any given notification is active or not.
And, at this point, API Level 23 (Android 6.0) is six years old. You really should be reconsidering whether you should be supporting older versions of Android than that, given all the security problems that would remain on Android 5.x and older devices.
In my project, I used a static array to save all pending notifications.
This array will be cleared when the app come onto foreground.
Thanks.

Best way to determine to current foreground application, Android

This question has been answered elsewhere but all solutions use ".getRunningTask()", which has been depreciated in the most recent API. I am trying to make an app that allows people to monitor their phone use and need to know when an app come to the foreground and when the foreground app changes.
I think if you have a look at this answer you will find what you are looking for:
https://stackoverflow.com/a/27304318/1173391

Android ASR multi locutors

I'm looking for an Automatic Speech Recognition solution for Android that can handle many locutors at the same time. I need a solution that can understand who is speaking what.
For example, if I have two users in front of my app, and if they are speaking at the same time, I need to know who said "YES" and who said "NO". My grammar is very simple, if it helps...
I've already tested both Android Recognizer Intent and implemented SpeechRecognizer, so I can already recognize the words, but I cannot associate them to specific locutors.
By the way, If you know this kind of solution for other platforms such as iOS or web-based app, I'll take it as well :).
Thank you.

With root access, how do I access the OS-level notification system?

I am using a phone without LED notifications. I would like to dev an app to simulate that, however first, with root, I would like to get access to the notifications system on the OS level (so it can be app-agnostic), to get the notifications.
How can I do so, or where can I read up more about this?
Thank you!
Despite this being old and already having an answer accepted, I want to offer an alternative solution since I think the end goal can be achieved. With all due respect to Mark, I think the direction the question is a little misleading, but the end goal is attainable.
If you are looking for something that would allow you to make an app that listens for notifications and then performs some action based on them regardless of the source app (or could be tailored to specific apps), then I think you can do this without writing firmware or rooting using an Accessibility Service. Accessibility Services would allow access to notifications as they come in, allowing your app to do something with them. You would be able to filter by the source package, get the notification contents, and a lot of other things.
There is a lot I could say on it, but it is still rather new to me, so I'll provide a couple of links to get started.
Accessibility Services page: http://developer.android.com/guide/topics/ui/accessibility/services.html
I would also recommend trying it out for yourself. I came across a small project file that I was able to copy and run on my own as a proof-of-concept. If you run this, you'll be able to see in the log that you really can read notifications: https://gist.github.com/qihnus/1909616
Don't forget to enable the accessibility feature for the app after you install it in your phone's accessibility settings.
You have to write your own firmware. This is not possible from an SDK application, rooted or not.

how can i get all the system notifications that are shown now?

how can i get all the system notifications that are shown now?i want to write a programe that can intercept the notifications that other apps notified.
You cannot interfere with another appliactions notifications so it will not be possible to write such application.
This thread from the Android Beginners Google group answers the question with a solid "No." Quoting a user from the thread:
No, sorry. Intercepting notifications,
in particular, would be quite the
security loophole. In general, on
Android, one application cannot see or
mess with another application's
stuff. So, while your desired features
would be interesting for the OS
itself, they aren't going to be very
practical to implement in an
application written to the SDK.

Categories

Resources