I'm developing an application for android 2.3.3. It contains a few EditView's to show an information for an incoming call: country, current time, phone number... I know how to get and show that information. The problem I faced is that I don't know how to show my activity instead of the standard screen for incoming calls.
Now it shows the information after the incoming calls.
How to do it?
It's not possible. According to the PhoneApp the intent used to start the InCallScreen is bound to the phoneapp, you have no chance to intercept this. So the screen will be shown every time.
What you may try to do is to be notified by the TelephonyManager when the phone goes into the CALL_STATE_RINGING state and then paint your UI just over the InCallScreen. It may be possible to do so but you woudn't be able to offhook the call (unsure, but I don't think so) from your UI. Also the state is not set immediately when the InCallScreen pops up, it's delayed by some milliseconds.
Take a look at the questions about showing popups over the incoming call screen:
Popup over incoming-call screen
android incoming call screen
If it isn't enough to show a popup over the incoming call UI, then you could make your popup cover the whole screen to hide it. At that point you'll need a way to accept the incoming call without showing the default incoming call screen (which you are now covering). A quick search found this answer that suggests a workaround to accept the incoming call. I'm not sure offhand if there is an official API to do it.
It's impossible to remove the default UI of the incoming call in android, unless you modify the Android OS codings. But instead you can use your own custom UI activity over the default one. It's attained by using the Thread concept(to make the custom designed UI come-over the default one)!!
Related
How can you register for certain system events and cancel the default action that the system would normally do when these events happen. e.g at certain times, the system shows an ugly native UI for when it detects new WIFI Access points. How can you kill that System UI and display something specific to your application in one of your fancy-looking activities.
Anyone care to share some knowledge on this.
If I understand correctly and you just want your ui changed check this application out
https://play.google.com/store/apps/details?id=jp.co.shekeen.WidgetHolder&hl=en
Cause you really don't need to kill the operation you just want to change how it looks/shows up.
Or maybe this if you want a widget
https://play.google.com/store/apps/details?id=in.vineetsirohi.customwidget&hl=en
I am new to android development and I did research on notifications using toast and status bar notification.
And I also managed to execute the code properly to make a notification work!!!
The problem is there are only methods like triggering a notification by clicking a button is available. Other wise I managed to directly call the codes within the method that is called by the button, to make it trigger automatically. But the problem is the view of the corresponding screen is showing up a tleast for a sec and then closing while this notification is triggered.
So how can i write a code that just triggers the notification without popping up the screen even for a second.
I need a result like the way the new SMS alert works...And I did a lot of research on this and all I got was about basic notification. So please help as I am new to this!!!
Using a Service would be the "right" way to do it - and if this is a professional app you are writing, then that's the way to go.
Bear in mind you still need some activities in your application, in order to trigger the service.
If you are just experimenting, then maybe what you need is a cheap hack...
Here's the cheap and nasty way to get your proof-of-concept done:
either - create a transparent Activity so that nothing is displayed when the activity code gets called.
or - create your notification from within the Activity.onCreate() method, and then call finish() at the end of that method. Your activity will never get shown to the user.
To me, it looks like you are just experimenting, and a transparent activity might get you further faster... ymmv
Legendary you need service and handler. Using service you can get data. and using handler you can modify the UI of your app.
here you can get more information on it.
http://developer.android.com/training/notify-user/display-progress.html
Working with handlers and threads in service, Thread.sleep makes the program to hang?
In my application, i want to implement the incoming call screen( which is fake).So user can get the fake call at scheduled time.Is there any way to implement the custom in call screen( which exactly looks like the real incoming call is made).
Please suggest any solution for this,I stuck with this problem from last week.
Call screens can be different on various devices, depending on manufacturer (i.e. HTC) or Android version, so you'd have to mimic them all if you want to make generic app.
How are things now
This has been discussed in many questions but neither one offers a good solution. Things look simple, after having a BroadcastReceiver is really easy to intercept and block a call. The main issue that appears is the default Android incoming call screen. You know, the one with sliders for answer/end call. Because i have some rules to block the call, there is a small delay before the call gets hangup. In all this time, the Incoming call screen is active.
How I want things to be
I want the user to not get notified by this call blocking, as in my application I have a clear Log of all blocks done. So, the main thing remains: how do I prevent the Incoming call screen from starting?
It is not possible to completely block the calls but you can achieve this by listening the call and then disconnecting it. It's behaviour may be different in different devices. It may show negligible flicker over some device but that's the only solution.
Here is the approach how you can do that:
Android: Taking complete control of phone(kiosk mode), is it possible? How?
You can use BroadcastReceiver but for alomost blocking experience you need to use Service.
so i was wondering if its possible to for an application that i would write to be constantly running in the background and alter regular phone operations. For example this could be something like as soon as you receive a text from anyone you forward it automatically to another number. Is something like this at all possible?
Just to be clear I don't want to solve that particular problem through some other means, just want to know if apps can accomplish that.
Also if that is possible is it possible for an app that i write to alter more immediate and instant things, like an incoming call.
thanks all for reading this, and hopefully a helpful response :)
It depends on how far you want to go, but I would expect that what you want to achieve probably isn't possible.
The Android OS does reserve some actions and prevent them from being doing programmatically. For example, you can display the Dialer with a number filled in but the user has to press the call button to make a call. Similarly, you can display the SMS app with a message already written but it is up to the user to send the message.
I don't know for sure, but I assume this is for security. For example, let's imagine you could write an application which could start a call with no user interaction. I would release my Super-Handy-Dialer application which makes quick calls for you making you life easier, but what it also would do is wait until 2am and call my premium rate phone line every night for 3 hours.