Phone Number Tools

Okay i will try :wink:

3 Likes

@Mohamed_Tamer I am waiting… :flushed: :flushed: :flushed:

2 Likes

@Mohamed_Tamer I have found something regarding this it might help you…

Follow the link below.

http://android2011dev.blogspot.com/2011/08/get-android-phone-call-historylog.html

2 Likes

please add get dual sim number option…

2 Likes

Nice extension.
But there are some minor bugs:

See also here:

2 Likes

Thanks :grin:

Thanks for reporting , the permission and the ContactImage bugs got solved.

But i didn’t quite understand the problem with isValidNumber and isGlobalNumber :sweat_smile:But the isGlobalNumber ( AndroidDocs ) checks if the phone number matches this pattern ( Source) :

[\\+]?[0-9.-]+

If yes, then it returns true.

2 Likes

Yes, but the phone number starts with a space and therefore the result is false.
You need trim to remove this space.

3 Likes

Thanks, i’ve fixed it for both isValid and isGlobal blocks.Also the getNumberList block, will return the number trimmed.

4 Likes

Untit15led
Hi @Mohamed_Tamer
see this pic
get contacts name block return a value ( the number was saved by name رقمي )
but if use (is in a list ) block with (get phone number list ) retune false
:thinking:

2 Likes

Hi @sherif :grinning:

I think this is due to that the extension may return your number with a space at the start or the end of your number, which will cause isInList block to return false. As “my number” isn’t equal to " my number" with a space at the beginning. However , it has been fixed in the next update :grin: A work around for now is to trim any space at the beginning or the end of the phone number list the extension returns,ex:
IMG_20201108_210910_390
And continue using the TrimmedPhoneNumberList.

2 Likes

@Mohamed_Tamer
I think the reason is not due to the space added at the beginning or the end of the number
Because there are many numbers that give the true value if i used block (is in list ) with phone number list

what about using Do it to find out, what is going on?
Unbenannt
use Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools

Taifun

4 Likes

@Taifun how r u?
I think I used (do it ), but I will try again :slightly_smiling_face:

do it result for get contact image list block return error

2 Likes


@Mohamed_Tamer
@Taifun
Both of these numbers are saved in contacts

what about enlarging the Do it result window, so we can see that number you are looking for?
most probably you added some spaces or the internaltional dialing code as you did for the number which starts with +20…

Taifun

1 Like


@Taifun
@Mohamed_Tamer
Two numbers are saved in one contact as shown
no spaces no country code
How is the second number return false with (GetPhoneNumberList )
and also return a value with GetContactName block ???

Do you see your second phone number ( which is in list block returns false with it ) in the phone number list, the extension returns?


@Mohamed_Tamer yes it returns a value

@Mohamed_Tamer
I have tried it many times, many of saved numbers are returning false with using GetPhonNumberList block