Phone Number Tools Extension

Sir, it works fine but it show in listview only mobile number. I beg your pardon if it wast your time, please send me bolcks which show name and number of contacts in list view.

1 Like

Hello @Sirajul_Haque,
Here's an example that uses the GetName block to get the contact names and shows them in a list view, that could have been more simpler if the GetName block was returning the result directly instead of calling an event, unfortunately, that's not possible because it needs to ask for permission first..

IOJ9.aia (31.3 KB) ( sorry for the AIA strange name )
Edit: here is an example that expands the ContactNamesAndPhones to two lists:

IOJ9 (4).aia (31.4 KB)
Update: reset the list before getting contacts.


But , Sir Its show only one contact in list view.

Sir your block works fine but it show only one contact (number:name) in list view. pls. reply to help.

Yes, that was happening with an old version of the second aia, can you try the updated aia?

1 Like

Many thanks for your help.

1 Like

sir I try the aia but it returns only one contact (number:name) in list view.
I can't solve the problem. I may disturbed you.

Are you sure you used the latest AIA, and used the right group name ? It's working for me:

Can you export the AIA you are testing with here?

1 Like

Does your extension consider android version? If so from which version it works? Thanks.

My extension should work starting from API 5 ( Android 2 Eclair )

1 Like

When I run the blocks with MTAI2 companion in my mobile then it shows only one contact (number:name). But when I made apk with the blocks and run after installation by pressing "Get Group Contacts" (of course entered valid group name) then it shows "run time error". I used your AIA file directly by importing aia file in my project. I can't solve the problem. Sorry to take your time again and again. Thanks.

I assume that you are using the old AIA, since you said it gets the phone numbers correctly, I will post here another AIA that should work :grinning:

I think I identified the reason of this error, I will do a fix shortly.

1 Like

Version 2.1

Bugs Fixed

1- The extension wasn't working in the compiled APK, since the extension wasn't properly declaring the READ_CONTACTS permission in the app's manifest, and therefore, the permission wasn't requested. (Thanks to @Sirajul_Haque )

New Blocks

1- image
Strips separators from a phone number string.

Returns a list of all of the phone numbers in the string given.
3- component_event (29)
Called when an error occurs, with the error and its message, instead of showing an undefined runtime error. It's also called when an empty or invalid input is given.
The updated AIX can be found in the first post :smiley:

1 Like

Many thanks.

1 Like

Your welcome, here's an AIA to test it:
GetGroupContacts.aia (34.5 KB)

1 Like

5 posts were merged into an existing topic: Insert contacts into android contacts

"GetContactId" block returns same ID for two different contacts.

Will you tell the reason please?

I apologize. Still about getting a phone number. please help, how can i get my own phone number using this extension?

Hello @Ayun_Challymalang,
This functionality isn't implemented in this extension, you might want to try the TelephonyManager extension by @Taifun


@MohamedTamer, Thank you for the help.

1 Like