How do I get contacts from the phone book of the smartphone?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Gille
Posts: 17
Joined: Fri Jan 19, 2018 8:52 pm

How do I get contacts from the phone book of the smartphone?

Post by Gille » Sat Feb 03, 2018 11:39 am

I would like to read from a contact from the phone book (Android Phone).
I can not get on with "mobileGetContactData".

Can someone show me a snippet how it works?

Thank you and best regards

Gille
:shock:

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: How do I get contacts from the phone book of the smartphone?

Post by jacque » Sat Feb 03, 2018 11:10 pm

Try this:

Code: Select all

mobilePickContact -- let user choose a contact
put the result into tID -- LC returns an ID number
put mobileGetContactData(tID) into tData -- store the array in a variable
put tData["firstname"] into msg -- or any other key
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: How do I get contacts from the phone book of the smartphone?

Post by [-hh] » Sun Feb 04, 2018 12:08 am

@Gille.
Trying to read contacts without permission is a violation of privacy.
This forum is not the right place for such ... (cheese).

Edit. Because the OP was offended by the word I used to name such a trial (the german word would have been much harder) I changed it.
Last edited by [-hh] on Wed Feb 21, 2018 1:54 am, edited 3 times in total.
shiftLock happens

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: How do I get contacts from the phone book of the smartphone?

Post by jacque » Sun Feb 04, 2018 1:47 am

It's a normal part of mobile interaction. The user must acknowledge and accept the permission before the app will download, and the script above requires the user to select a contact manually. They can cancel if they don't want to do that.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Gille
Posts: 17
Joined: Fri Jan 19, 2018 8:52 pm

Re: How do I get contacts from the phone book of the smartphone?

Post by Gille » Sun Feb 04, 2018 11:49 am

hi jacque,

vielen Dank für Deine Hilfe / Thank you for your help!

happy weekend!

Gille

@hh - sehr nett was Du von Dir gibst - ich habe nicht vor, Information zu missbrauchen.
Cool wäre es, wenn man Dir ein PN senden könnte.

@hh - very nice what you give from you - I do not intend to abuse information.
Cool it would be if you could send you a PN.
:shock:

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: How do I get contacts from the phone book of the smartphone?

Post by Klaus » Sun Feb 04, 2018 12:30 pm

Hermann, Hermann... :shock:

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”