Intercepting Android Notifications based on associated audio file? - android

Basically what the title is saying. I'm trying to make a small app that can determine what audio file was just played for a notification, and react based on that. Is there a way to monitor all incoming notifications on android to get this effect?

I ended up going with the "Accessibility Service" as a way to read all incoming system notifications, and then handled them appropriately depending on what type of even was happening. I discovered that this is also how applications like Tasker handle similar functionality.
More information is available here:
http://developer.android.com/reference/android/accessibilityservice/AccessibilityService.html

No, the stream of notifications is not available to applications. (It would be a security hole, allowing any installed app to read your email, for example.)

Related

Disable notifications in Android

I have a live streaming app where you can be recording for hours and when the user receives a text message or a phone call, the vibration is trnaslated into sound and rippling video on the streaming.
Is it possible to somehow programmatically disable all notifications or do I have to ask the user to do so by himself?
You cannot control notifications from other apps. There is indeed a solution for rooted devices.
'Standards' part in this guide says:
One of the unfortunate problems Android users face is that there is no
centralized control for how notifications work. This means that if
there is an application prompting you with a notification, short of
uninstalling the application, there isn’t much you can do. Starting in
Android 4.1, users received a buried binary setting to 'Turn off
notifications’ for a specific app.
No, unfortunately not. Perhaps on rooted devices, but ¯_(ツ)_/¯. Best way seems to navigate the user to the related setting to disable all notifications, as you have also mentioned.

Is it possible to intercept an incoming call via an APP (IOS and Android)

Hey does anyone know if it's possible to intercept incoming calls via an app for both IOS and Android (no jailbreak) then based on certain criteria the phone takes action?
Have already read a few posts saying it's not possible however they are quite old, anyone know of anything new?
Thanks!
The short answer:
On Android: You can do this, but this may require special treatment for different vendors and/or OS versions. It won't be simple to support all (or at least most) devices, but with a lot of manual trial and error, it can be done.
On iOS: It's not possible locally, as Apple sees it as an invasion to the user's privacy.
The (slightly) longer explanation:
What is possible, for both iOS and Android, but will probably require a lot more work and external support than you originally planned, is to divert the calls via a server. This way, when someone calls you, the call is "stolen" by the server (which the user has to manually allow when installing the app) and the call is received on your device as a VOIP call, allowing the app (on the server side) full control over the call (which ones are actually received on the device, what's played, how long, recording, etc). You can see this app for an example of how it works: https://yallo.com/.
I hope this helps. Good Luck.

Android - Get event for Android Message application whenever opened

In Android, I want to know if I can receive the event whenever I open Android Message Application?
I tried get task in foreground but that didn't work in service as for that service has to continuously poll
Kindly guide
The only way you can achieve this is by polling. No other way :(
I can receive the event whenever I open Android Message Application?
No.
First, there are thousands of Android device models, spanning hundreds of manufacturers. There are dozens upon dozens of "Android Message Application" pre-installed across the device models, as manufacturers often provide their own. There are also hundreds of "Android Message Applications" available on the Play Store and elsewhere. You have no great way to know what apps are and are not "Android Messaging Applications", though you could try to examine <intent-filter> structures and deduce which ones might meet your requirements.
Second, there are no events posted to ordinary Android SDK apps when other apps or their activities start. Even some of the polling techniques that you mention will not work on Android 5.0+, and any that still do work represent bugs that should get fixed. Google is locking down this information for privacy and security reasons, such as to help prevent OAuth hijacking attacks like this one.

Sony SmartWatch 2 Control & Notification for the same app possible?

I was trying to port my existing app from SW 1 to SW 2 and stumbled upon the limitation that it is not allowed to have notifications and a control for the same app (even when setting LAUNCH_MODE to CONTROL).
As a workaround I tried to register 2 services, one for the notification and one for the control. As they share the same app package name, this didn't work and only the first that registered was available.
Is there a better workaround?
Or will this limitation be addressed in a future update? My app really depends on both, the notifications and the control.
A distant workaround may be to use only the Control, and build some sort of a notification mechanism as part of the Control. I did exactly that in my Log app: https://play.google.com/store/apps/details?id=eir.log
The notification mechanism is triggered by a different event, in the same BroadcastReceiver. Works wonderfully for me.
I believe this is indeed not possible today. One option for you would be to start up your control extension from a notification list item. So from where you read your notification you can enable a menu and then in that option start up your control. Have a look at the SMS app to get an idea.
Not possible and no workaround available. We have to wait for Sony to fix this issue though they haven't mentioned when they will address it.
We have posted a blog on Sony Developer World regarding this topic:
http://developer.sonymobile.com/2013/12/26/using-both-the-control-notification-apis-for-customised-uis-in-your-smartwatch-2-extension-code/

Android UI Automation: Subscribe to Android Events

Is there a way to subscribe to events from an installed app on a AVD? What I would like to do is, e.g., when I enter any text on a EditText field in the app, I want to automatically receive a notification in my program, with the details (entered value). Is there any way I can subscribe to the android app events from any installed apk ? If there are frameworks or any Android native drivers which can do this, please mention them.
It looks like you might be able to do something similar via Android's accessibility API. You'd need to write an Accessibility Service which would need to be installed and then explicitly enabled via the control panel (this is a security precaution to prevent arbitrary apps getting access to potentially sensitive contents of UI of other apps). Your service can listen to AccessibilityEvents - looks like TYPE_VIEW_TEXT_CHANGED event - "Represents the event of changing the text of an EditText" - is the one you want.
What you need is Google Analytics for Android

Categories

Resources