I'm programming an app which disable sometimes data (&wifi). But i don't want to do that if the user is using "streaming apps" (f. ex : soundcloud, spotify, deezer, etc).
I suppose I have to check bandwidth, and so i looked for TrafficStats (http://developer.android.com/reference/android/net/TrafficStats.html). But it doesn't for me because i just want to know if at time t, the device is connected and downloading something.
Like that : if (!isUserStreaming()) disableData();
An other possibility would be to check if a "streaming app" is launched and used. For example, determine if Soundcloud is launched and playing some music but I have no idea of how to do that. I suppose i have to check if the background service is running.
Anyway, do you have ideas to help me with that ?
Thanks.
Related
Here is my problem, I've done an app to configure an IoT home device and saves this device properties on a simple SharedPreferences file, that's already done, but the other goal is to give this app the capability of "Invite" another user using this app so that this user can control this ALREADY configured device...I'm having trouble finding the specific name of this "Feature",
At this moment I've been thinking of simply adding the capabily of Sharing this file to the other app, like "Share my Devices", and pair the phones so that the other receives the file with the already configured devices. But I imagine more appropriate the scenario of "Invite User" to control the devices, and when doing it, the app receives a notification for accepting, but...what must happen after this on the underground?, I'm I little confused for "What to search", to start doing this, for example, when I didn't knew what was the concept of refreshing a webpage in real time I got the keyword for "polling", and just with that I was able to do the work, So, I don't know If you could just give a direction of what to search for the feature I'm looking, or at leats example of tecnologies using something close to this.
in an android application :
Is there an interface defined in android to support this query ?
I've searched a lot on this, but was unable to find more info.
This seems like a fairly reasonable query(provided user permission is granted)
Not possible do to many restrictions - if you were to write an application that managed the user channel changes then you could access the Channel Lineup on the GTV and then it would be possible to know what channel they are on. If however you want to just arbitrarily know what the user has currently tuned to this is not possible - mainly because the user could have used their cable box remote to change the channel and as such the data is not available to the GTV unit.
I've been fiddling around with Tasker recently and I think it would be cool to be able to pass Google music a string input from the user that Google Music would use to generate a radio station that could be played. I know there's no official api at this point, and I'm even surer I wouldn't know what to do with it were that not the case.
I Can access a bunch of gmusic activities thru the "Secure Settings" Tasker plugin--there's a particularly interesting activity called 'CreateMixActivity,' but I can't find any info on it--and have between playing around with Intents, but don't really know how or where I should start experimenting.
Any input/questions would be greatly appreciated (first post btw)
Chucksef
This is as close as you are gonna get o an API, this is using Python but you are welcome to go through the code and write your a fork using Java/Android.
https://github.com/simon-weber/Unofficial-Google-Music-API
I'm writing an Android app that the user can run in the background to detect when the camera is turned on(by the user, or by other apps). This should also detect even in the scenario where other apps (like facebook, instagram) do not use the default android camera app.
I've been searching but haven't seen any broadcasts that are sent whenever the camera is activated. So far, I've seen that there's Camera.open() that throws a RuntimeException if the camera is already in use by another app. So one way is to keep polling Camera.open(), but it's really expensive. Is there a better alternative?
Thanks
Edit: Sorry i didn't mention it clearly but what I want to do is to create some kind of camera usage log: what time it was turned on/off, how long was the duration, etc..
What happens internally is Camera API talks to CameraService and CameraService has mBusy variable which tracks whether camera is busy or not. And there is no API to get this mBusy flag out of service (without calling open())
I may be wrong, because I just glanced over it.
You can download Android source code (http://source.android.com/) and take a closer look yourself.
Files which could be interesting for you are:
\frameworks\base\services\camera\libcameraservice\CameraService.cpp
\frameworks\base\libs\camera\Camera.cpp
\frameworks\base\core\java\android\hardware\Camera.java
\frameworks\base\core\jni\android_hardware_Camera.cpp
One other idea. Try to look in the logs. In the case, if logs aren't turned off for Camera services/API, you can parse the logs to check when the camera was turned on or off. However, it may not work in OS 4.1, because Google limited reading of system logs.
I'd like to create an app that allow you to filter incoming call to various answering message with :
"this number is not available" for black listed phone numbers
A formal message for strangers
A informative message about what your doing for friends
I don't know how you can get automatically a call, play a recorded message then wait for the answer and record it. Or maybe there is just a way to interact with the actual answering system so I just have to plugin.
Any clue strongly appreciated. A human sacrifice for any code snippet :-)
Access to the internal telephony is not possible or planned for future releases of Android:
http://groups.google.com/group/android-developers/browse_thread/thread/e8904c82a2c4a333
This would present a security risk as app developers could intercept and hijack sensitive calls (eg. telephone banking)
This is not possible on the tmobile G1 at this time. There is no way for an android SDK application to access the call input or output on this hardware/firmware combination.
http://groups.google.com/group/android-developers/browse_thread/thread/d04c307973345fef/a628e578900b3dce?lnk=gst&q=dave+sparks+play+audio#a628e578900b3dce
and
http://groups.google.com/group/android-developers/browse_thread/thread/185e33a3f420d1ac/e14e1dc84bb6dd24?lnk=gst&q=play+sound+call#e14e1dc84bb6dd24
I'm not sure this answers the question, but it is somewhat related I think.
You can install Ultimate Voice Recorder which can record your conversations (very useful when calling customer 'service'). Since it can record it, it must have some way to access the conversation.
Also, the capabilities you have to give the app are quite scary (translated from dutch: full internet access, intercept outgoing calls, change preferences, call phone numbers directly, record audio/take pictures, update contacts, auto startup). It seems to me there must be something in there that can help you?
However, I don't think it can inject audio into the stream. The symbian version had an option to insert beeps into the conversation, but I don't think the android version has it.
http://www.fingertip-access.com/
I have found out att for this use of your Phone Android or ISO, so far they ar decades behinde symbian and an inferior alternativ sadly, if you don't install a custom kernel/jailbreak it's not possible to record incoming calls and screen them. "Ultimate Voice Record ned you to use the phone in speaker mode."
it is possible to record voice calls with automatic answer. An update on this issue would be very helpful...
It is possible to have a resource that answers the calls. Enter a message and record the call. And together don't activate the microphone...
In short, an answering machine...