Android Question Replace default dialer APP

rcla

Member
I want to create an application that overrides the default dialer.

I have searched the forum, in the tests, when making a phone call,
it always keeps showing the dialer.

I found this information very useful:
replace-default-phone-app

I tested the application of the author arekolek and it works great.

Source Code:
Kotlin version: Simple Phone
Java version: simple phone dialer

I have already changed the manifest with some of those lines:
B4X:
AddActivityText(Main,
            <intent-filter>
                <!-- Handle links from other applications -->
                <action android:name="android.intent.action.VIEW" />
                <action android:name="android.intent.action.DIAL" />
                <!-- Populate the system chooser -->
                <category android:name="android.intent.category.DEFAULT" />
                <!-- Handle links in browsers -->
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="tel" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.DIAL" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>)


To make a phone call I have used:

B4X:
    Dim MPhones As PhoneCalls
    StartActivity(MPhones.Call("123456789"))

or

B4X:
    Dim Pha As Intent
    Pha.Initialize(Pha.ACTION_CALL, "tel:123456789")
    StartActivity(Pha)
or

B4X:
    Dim in As Intent
    in.Initialize("android.intent.action.CALL","tel:123456789")
    StartActivity(in)

But all that concerns "InCallService", I don't know how to translate it to B4A.

I appreciate if someone can help me.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0
Top