Compose, not call, a number

fabero

Member
Licensed User
Longtime User
I need to compose and not call a number. For example the imei code *#06# but without send the call.

With

Dim P As PhoneCalls
StartActivity(P.Call("*#06#"))


I start the call and give errors.. There is a way to do that?

Tnx in advance
 

DKCERT

Member
Licensed User
Longtime User
Hi, You can get the IMEI like this:

B4X:
Sub GetDeviceIMEI As String
   Dim ph1 As PhoneId
   Return ph1.GetDeviceId
End Sub

EDIT: Ahh... my bad... you just used that as an example. Sry :)
 
Upvote 0

fabero

Member
Licensed User
Longtime User
What do you mean by that? That the number has been entered and is ready to call if you press a button?

Yes.

Imagine to compose *#06#

This "code" is interpreted by phone and show your imei.

In my case I need something like that for my purpose..
 
Upvote 0

bluejay

Active Member
Licensed User
Longtime User
fabero,

I have done this in AnyCut using intents, should be able to do the same by sending intents from B4A. Note you need to use escape codes for the URI formatted phone number.

SERVICEMENU

Action: android.intent.action.DIAL
Data: tel:*%23*%230011%23*%23

Dials (but does not actually initiate the call) the number given (or the stored voicemail on the phone).

bluejay
 
Upvote 0

RandomCoder

Well-Known Member
Licensed User
Longtime User
Can this be done in B4A?

I need to dial *#10# to display the remaining minutes of credit left on the phone. If I try and call the number I get a message that say's "Rejected.".

I'm guessing that I need a solution as proposed by Bluejay, but is this possible in B4A?

Thanks,
RandomCoder
 
Upvote 0

RandomCoder

Well-Known Member
Licensed User
Longtime User
Adjusting my search term in the forum has opened up a few new leads such as this post http://www.b4x.com/forum/basic4android-updates-questions/11051-action_dial.html#post61748 but even so I'm still unable to retreive the remaining credit left on the phone.

If I try the suggested code....
B4X:
    Dim in As Intent
    in.Initialize(in.ACTION_VIEW, "tell:*#10#")
    StartActivity(in)
It opens the phone call menu but with only an astrix entered in the phone number.
I adjusted my code to ...
B4X:
    Dim in As Intent
    in.Initialize(in.ACTION_VIEW, "tell:" & Chr(42) & Chr(35) & "10" & Chr(35))
    StartActivity(in)
But still the same thing happens.

Has anyone managed to acheive this yet? In principle it is just the same as calling the voice mail or getting the phones IMEI from the inbuilt phone codes.

Regards,
RandomCoder
 
Upvote 0

RandomCoder

Well-Known Member
Licensed User
Longtime User
Problem SOLVED!

You can create such an Intent:
B4X:
   Dim in As Intent
   in.Initialize("android.intent.action.DIAL", "tel:*%23*%230011%23*%23")
   StartActivity(in)

Thanks Erel, I'd just found a post suggesting the use of %23 and had managed to get the full number in the phone so that all the user had to do was press dial.
May I ask what is the meaning of %23?

Many thanks,
RandomCoder
 
Upvote 0
Top