B4A Library fgContacts (Contacts-Library)

Hi,

this is my first Android Library.

fgContacts Members:
GetPhoneNumberByID(String id) As String

GetContactPhotoByID(String id) As Bitmap

DeleteAllContacts() As Boolean

DeleteContactById(String id) As Boolean

GetContactsById(String id) As fgContact
Returns a single fgContact

fgContact Members:
Id As String
DisplayName As String
PhoneNumber As String
FamilyName As String
GivenName As String
Photo As Bitmap


Change in version 1.03

Function changed:
GetAllContacts(Boolean IncludePhoto, Boolean OnlyContactWhitePhone) As List
Returns a List of fgContact objects with all the contacts.

GetAllPhoneNumberByID(String id) As List
Returns a List of all Phone-Number.
The first entry in the List is always the Primary

The list looks like this:
01|+49 10001 (01= HOME)
02|+49 10002 (02= MOBILE)
03|+49 10003 (03= WORK)
04|+49 10004 (04= Work Fax)
05|+49 10005 (05= Home Fax)
06|+49 10006 (06= PAGER)
07|+49 10007 (07= Other)
08|+49 10008 (08= Callback)
09|+49 10009 (09= Car)
10|+49 10010 (10= Company Main)
11|+49 10011 (11= ISDN)
12|+49 10012 (12= Main)
13|+49 10013 (13= Other Fax)
14|+49 10014 (14= Radio)
15|+49 10015 (15= Telex)
16|+49 10016 (16= TTY/TDD)
17|+49 10017 (17= Mobile(work))
18|+49 10018 (18= Pager(work))
19|+49 10019 (19= Assistant)
20|+49 10020 (20= MMS)


New function:
GetNoteByID(String id) As List

GetPostalAddressByID(String id) As Map

GetAllEmailByID(String id) As List


Change in version 1.04
New function:
GetCompanyByID(String id) As List


Ciao,
Filippo
 

Attachments

  • fgContacts_v1.04.zip
    7.5 KB · Views: 1,095
  • fgContact.jpg
    fgContact.jpg
    55.4 KB · Views: 668
  • fgContact-Example.zip
    14 KB · Views: 809
Last edited by a moderator:

Amalkotey

Active Member
Licensed User
Longtime User
Moin Filippo,

vielen Dank für die fgContacts library. Das erspart mir jetzt Arbeit.

Amalkotey
 

peacemaker

Expert
Licensed User
Longtime User
What are minimal requirements to Android to use it ?

GetAll returns about 250 contacts also during 12 seconds on a real device, similar to Contacts2 of Erel.
 
Last edited:

peacemaker

Expert
Licensed User
Longtime User
Is there possibility to EDIT the contact ?
I mean save changing some field, say Notes.
 
D

Deleted member 103

Guest
Hi peacemaker,

What are minimal requirements to Android to use it ?
Same as Contacts2.

GetAll returns about 250 contacts also during 12 seconds on a real device, similar to Contacts2 of Erel.
Unfortunately, my library does not work with even faster.:(

Is there possibility to EDIT the contact ?
Perhaps in future.


Ciao,
Filippo
 

peacemaker

Expert
Licensed User
Longtime User
Filippo, if you are ready to improve your lib - contact update is very needed. I mean update only of SOME fields, saving all others the same especially.

I see that UPDATE is CREATE + DELETE ALL OLD ones.
DeleteContactById works OK, after contact creation by miscUtil.
 
Last edited:

peacemaker

Expert
Licensed User
Longtime User
Thanks.
Hopefully waiting any updating contact possibility :)
 

cheese

Member
Licensed User
Longtime User
Search for contact using phone number

I understand I could do a linear search through all contacts and examine the corresponding phone number.

Is there a fast way in B4A to find a contact using a phone number? If not, what would it take to include this functionality?

Thanks
 

cheese

Member
Licensed User
Longtime User
That would be faster than linear, thanks.

Seems a shame to store all that info in memory though. I will give your idea a try and see how it goes.

Cheers!
 

peacemaker

Expert
Licensed User
Longtime User
Filippo, sorry again - but any chance to get help for this ?
 

ashinkar

New Member
Licensed User
Longtime User
Contact Details (Company Name)

Hi,
I'm checking to see if there is a way to use these libraries in order to retrieve the contact's company name and Title
Thank you
Alex
 

Shay

Well-Known Member
Licensed User
Longtime User
I am getting
java.lang.SecurityException: Permission Denial: reading com.android.providers.contacts.ContactsProvider2 uri content://com.android.contacts/data/phones from pid=9787, uid=10123 requires android.permission.READ_CONTACTS

this is what i am doing - can you post some code example

Sub Globals
Dim fg As fgContact
Dim fgs As fgContacts
Dim list1 As List

End Sub

Sub Activity_Create(FirstTime As Boolean)

list1.Initialize
fgs.Initialize
list1=fgs.GetAllContacts(False,False)
 

Shay

Well-Known Member
Licensed User
Longtime User
Got indication from my user that the demo code I sent him, did not manage to get any information
I will try to connect my decide to exchange server and try myself
 

Gary Miyakawa

Active Member
Licensed User
Longtime User
Filippo,

Is there any way to get to the "Notes" field or the "Internet Call" field ? I'm wanting to use a field for video contact information.

Thanks,

Gary M
 
Top