Change UI automatically according to the cell phone - android

I am designing a prank app for android in which i want to show as if someone has called and then when the user answers the call it should play the recorded file. I have finished most of the things apart from 1 issue which i am facing currently.
1) As we all know the UI of every phone is somewhat different when they get a call, so i want to make sure that when running the app it should use the phone's default UI, so as to make sure it looks like a real incoming call.
I am uploading a picture so you'll have a better idea regarding my query. So as we can see that the UI is different for every phone, how can i make sure that when my app makes a fake call it uses the same UI which is displayed while getting a real incoming call.
Any help on the problem would be highly appreciated.

What you're trying to do is start the Android Dialler app, and then to change the functionality/have it do nothing while you play an audio file.
While you could enable the loudspeaker and play audio, you can't make the dialler stay active without a live call. An invalid number would fail, and an actual call would cost money.
What you want to do is actually very hard to achieve and the only thing you could try to do is to create your own fake dialler activities with different themes (according to major brands), detect the device manufacturer and then display a relevant one.

Related

Is it possible to get screen content from an Android Service

I am trying to create a TV back light controller that runs on Android TV. To do this I want to use what is being displayed and adjust the back light colors accordingly. I am having trouble determining a good way to basically get a screenshot regularly through a service. Does anyone have any ideas?
On Android 5.0+, you can use the media projection APIs for this. However:
The user has to authorize this, by launching one of your activities which then displays a system-supplied authorization dialog
That authorization does not last forever, but only for however long your process is around (and possibly less than that, though so far in my testing it seems to last as long as the process does)
AFAIK, DRM-protected materials will be blocked from the screenshots, and so using those screenshots to try to detect foreground UI colors may prove unreliable

Is it possible to check in background if an android/iOS device is in use at the moment?

Is it possible to determine if a device (non-rooted) is in use at the moment, even if my app is not in the foreground? Precisely "in use" means the user made touch events in the last 5 seconds or display is on.
If so, what specific rights are required?
Thanks
AFAIK, android security model would not allow you to record touches if your app in not in the foreground.
There are some crude workarounds like overlaying a transparent screen to record touches. Not sure if these work now though.
"in use" means the user made touch events in the last 5 seconds
In Android, that's not practical, short of writing your own custom ROM.
or display is on
In Android, you can find out if the device is in an "interactive" mode or not. This does not strictly align with screen-on/screen-off, as the whole notion of screen-on/screen-off has pretty much fallen by the wayside.

Is it possible to do postprocessing on Android video output?

Is it possible to do some postprocessing on the video data that gets sent to the display driver in Android?
For context, what I would like to do would be to able to apply effects such as blurring, sharpening, increasing or decreasing constrast, on the entire screen output, regardless of what is running.
I would like to know if there is some way to grab the actual video data before it gets shown on screen, process it, and then send it to the screen, (a fairly low-level operation, which I don't believe is provided by the Android API - However, I am only a beginner and do not know how hard it would actually be) or if there is any way by which I would be able to simulate this kind of behavior.
It may work by software in theory. However, performance may be the big issue. It can not be done in Jave app layer. Normally, it's done by HW(in Qualcomm platform, there is a specific device called MDP, which is mostly for video postprocessing).

Get available audio sources

Is there a way to get a list of available audio sources implemented on the device running the application? I want this to allow the user to choose from these however the API does not seem to have anything for this. It just falls back to default if the specified audio source is not available. So it would be a waste to display them to the user when they might not even work.
Or is it guaranteed that all android devices implement a certain number of these sources?
Thanks in advance.

Android: Listen for a voice command (all the time)

I have a fairly popular application in Android market, which allows tens of thousands of its users to press a button and give it a voice command. Then I am able to do many different things, like give them current weather forecast, etc...
Anyhow, I came to a point where am getting asked almost every day by users of my app, that they don't want to be pressing a button all the time. They want my app to launch by a trigger word (some specific word command). In that way, app would wake up and ask them for a voice command, all hands free.
I understand that this would require a nonstop listening, it could be a battery eater, etc. But I want to give it a try. Anyhow, and this is why I am here.
I simply don't know how to go about it.
I know it's possible, these guys did it and not only that, they listen to a trigger word even when the phone is in the sleeping mode or behind a locked screen: http://www.youtube.com/watch?v=Dd2vo_9euOY
Any ideas on how this could be done? How did the guys above do it?
How? Any examples?
Thanks in advance.
NoiseAlert is an Application that launches when there is a loud ambient noise, it pays attention to the noise amplitude and also contains wakelocks.
You may use this as an reference. I think you have already implemented the Speeck recognition part.

Categories

Resources