Displaying contacts phone number and name in a list

976 views
Skip to first unread message

Cory Pickett

unread,
Feb 23, 2016, 9:33:14 PM2/23/16
to MIT App Inventor Forum
I have my app up and running thanks to the help from several users here. Now I'm in the process of fine tuning it. Currently my app lets a user select a list from their contacts, the app stores this list, then with the press of a button sends a text message to everyone on the list. I also have my app set to display the list as it's modified. However, my list currently just displays the phone number of the contact, which is confusing because nobody remembers phone numbers anymore. I want my app to also display the name of the contact I honestly dont even know where to start on this one. Can someone point me in the right direction? I'm hoping it doesn't require changing everything in my app. I've attached a picture of what I have so far. I'm hoping with a couple of tweaks I can include the contact name as well. I did somehow with dumb luck manage to get this kind of working before but it did not display the number and contact name on the same line. it listed them with phone number on one line and the contact name below. Thanks in advance!
blocks.PNG

Taifun

unread,
Feb 24, 2016, 9:34:35 AM2/24/16
to MIT App Inventor Forum
add a second list to store the names and use that list in the listpicker or procedure displayMembers 


A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook   http://www.appinventor.org/book2 ... the links are at the bottom of the Web page.  The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro  and the aia files for the projects in the book are here:  http://www.appinventor.org/bookFiles  
How to do a lot of basic things with App Inventor are described here:  http://www.appinventor.org/content/howDoYou/eventHandling  .

Also do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.html to learn the basics of App Inventor, then try something and follow the
 Top 5 Tips: How to learn  App Inventor

You will not find a tutorial, which does exactly what you are looking for. But doing the tutorials (not only reading a little bit) help you to understand, how things are working. This is important and this is the first step to do.

Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by  Taifun.         



Ghica

unread,
Feb 24, 2016, 9:40:59 AM2/24/16
to MIT App Inventor Forum
What you should do, is not just store phone numbers, but a list of name and number for each contact. Basically, you will get a list of lists stored in your TinyDB.
To set your listpicker, you would have to present each entry into a readable form, how to do that is shown here:
So, you do not have to start over, but at every step you have to do something to work with a list (of name, number) instead of just an element (number).
Cheers, Ghica.

Reply all
Reply to author
Forward
0 new messages