How to replace the dialer

NeoTechni

Well-Known Member
Licensed User
Longtime User
I've just been using startactivity to pop my app up when it gets a call, but the stock dialer tends to take over.

Is there some XML or whatever to let my app take over as dialer?
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
Im currently intercepting both, but half the time the stock dialer pops up instead of mine
 
Upvote 0

NeoTechni

Well-Known Member
Licensed User
Longtime User
B4X:
AddReceiverText(stimer, 
<intent-filter>
    <action android:name="android.intent.action.NEW_OUTGOING_CALL" />
</intent-filter>)

I dont want to replace the icon itself. I just want my program to pop up after the call was placed, to show a screen like this:

yIxSKWRL_eF8EwvdEtxiqWzwC8MtHRWJACelhuPAi5O2WYUflkhHQum5k5ebDGLetMA


It pops up some times, others the stock dialer does. Is there some XML code or whatever to give my app the priority?
 
Upvote 0

corsaro

Member
Licensed User
Longtime User
try this code in manifest, and let me know

B4X:
AddReceiverText(stimer, 
<intent-filter android:priority="2147483647">
    <action android:name="android.intent.action.NEW_OUTGOING_CALL" />
    <category android:name="android.intent.category.DEFAULT" />
</intent-filter>)
 
Upvote 0

bsnqt

Active Member
Licensed User
Longtime User
B4X:
AddReceiverText(stimer, 
<intent-filter>
    <action android:name="android.intent.action.NEW_OUTGOING_CALL" />
</intent-filter>)

I dont want to replace the icon itself. I just want my program to pop up after the call was placed, to show a screen like this:

yIxSKWRL_eF8EwvdEtxiqWzwC8MtHRWJACelhuPAi5O2WYUflkhHQum5k5ebDGLetMA


It pops up some times, others the stock dialer does. Is there some XML code or whatever to give my app the priority?

@NeoTechni

I am currently working on my app which also needs to display itself on top of the calling screen for both cases of incoming and outgoing calls, i.e. the user will see only my app not the calling screen. What I do is to intercept the call - by using PhoneStateListener for incoming and intent for outgoing - and have a timer, then every time when there is a call it will enable the timer, which in its turn will trigger the kiosk mode of my app (look at "kiosk mode" sample by Erel) by calling StartActivity. When the call ends (or is stopped by the user), the timer will be disabled. By doing so, I can display my app for 100% of cases and the user can interact with my app instead of seeing the calling screen.

In other words, the calling screen is still there but it is "hidden" by my app which is on top of the screen. Just to make sure that once your app pop up it is in full screen mode.

I am not sure I understand correctly your question, but hope my case can help you.
 
Last edited:
Upvote 0

corsaro

Member
Licensed User
Longtime User
Try this and let the forum know:

On a Service, that we can call "S1", put this code:

B4X:
Sub Process_Globals
Dim PE As PhoneEvents

End Sub




Sub PE_PhoneStateChanged (State As String, IncomingNumber As String, Intent As Intent)
Dim PhoneFlag
If State = "RINGING" AND IncomingNumber<>"" Then 'incoming call 
PhoneFlag = 1
End If
 

If State = "OFFHOOK" AND PhoneFlag = 1 Then 'answering to incoming call
PhoneFlag = 2
End If 

 If State = "OFFHOOK" AND IncomingNumber="" AND PhoneFlag <> 2 Then 'out call

StartActivity(youractivityname) ' here you launch your screen

End If

End Sub

on manifest, add this:

B4X:
AddPermission(android.permission.READ_PHONE_STATE)
AddPermission(android.permission.PROCESS_OUTGOING_CALLS)
AddPermission(android.permission.CALL_PHONE)

AddReceiverText(S1, <intent-filter>
            <action android:name="android.intent.action.NEW_OUTGOING_CALL" /> 
            <category android:name="android.intent.category.DEFAULT" /> 
        </intent-filter>)
 
Last edited:
Upvote 0

CapReed

Member
Licensed User
Longtime User
Good afternoon,

Would it be possible to you to send a small complete example that worked?

I have a couple of hours testing the example of @corsaro but I can not display a screen when you make a call.

Thank you very much.
 
Upvote 0

CapReed

Member
Licensed User
Longtime User
Ok, as I understand it, the trick is to use Kiosk Mode Erel with Corsair's approach.

Thank you very much anyway. :D
 
Upvote 0

NeoTechni

Well-Known Member
Licensed User
Longtime User
Has anyone figured out how to dial inside a call instead of placing a new one?
ie: Press 1 to speak to an operator, press 2 to...
 
Upvote 0

viljemto

Member
Licensed User
Longtime User
maybe you can use something like this...
if you know you will have to press 2...
you can dial number like this: "number,2"
"," - mean pause
you can add "," more than just one...like "number,,2" to wait a little more
or even "number,1,1"
 
Upvote 0

NeoTechni

Well-Known Member
Licensed User
Longtime User
That'd keep dialing from the start of the call though. I want to dial after that point/any point during a call
 
Upvote 0
Top