Amadou Touré

unread,
Mar 27, 2018, 10:27:16 AM3/27/18
to MIT App Inventor Forum
I would like to know how to make a database. Then when a user logs in, it directs him to a specific section from the database.
I'm using MIT App inventor so I can only use Firebase or TinyDB. Please help me out and answer here or personally. 
Thanks

Farzeen Harunani

unread,
Mar 27, 2018, 10:32:27 AM3/27/18
to MIT App Inventor Forum
Hi,
There's also CloudDB. You don't actually need to configure anything--once you drag in the component, you have a database. Using the operations provided by the component, you can manage what data is in that database. 
Farzeen

Amadou Touré

unread,
Mar 27, 2018, 10:36:25 AM3/27/18
to MIT App Inventor Forum
So if I login with an ID of 1904340 and 1904340 is in my database, it will show me the info?

Amadou Touré

unread,
Mar 27, 2018, 10:36:56 AM3/27/18
to MIT App Inventor Forum
Be more specific, how am I supposed to do that?

Farzeen Harunani

unread,
Mar 27, 2018, 11:11:42 AM3/27/18
to MIT App Inventor Forum
Here's a screenshot. Hope that helps. 
Capture.PNG

Amadou Touré

unread,
Mar 27, 2018, 1:16:13 PM3/27/18
to MIT App Inventor Forum
Alright. What I'm saying is that I made a login page. Now I want that if I put my ID and my password, it directs me to one portion out of thousands other in the database. In that portion, I'll see my schedule, name, last name, date of birth, stuff like that. How am I supposed to do that?

Farzeen Harunani

unread,
Mar 27, 2018, 2:36:15 PM3/27/18
to MIT App Inventor Forum
You can't access data without storing it first. Using the CloudDB's StoreValue function, you can store any data you need to store. So, perhaps, you store a username/password in CloudDB. Once you authenticate, you can ask for an entry from the database based on your user id/username/whatever you choose, and that's a list that is your schedule, name, last name, etc. Or a list of lists. 
Would that work?
Farzeen

Farzeen Harunani

unread,
Mar 27, 2018, 3:18:32 PM3/27/18
to MIT App Inventor Forum
Please respond in the forum and not as an email as others will be interested in the answer.

All of this assumes that you have already uploaded the other data (e.g., schedule, name, etc.) to CloudDB - you will have to have done this during account setup (which you will also have to design in a way similar to what I showed above with CloudDB1.StoreValue.

So once the user log in, you can make another call to CloudDB for the items you want to display.

I've made an example that would show you exactly how to create a specific user's profile, and how to access the person's name from the stored profile. 

Farzeen
Capture.PNG

Amadou Touré

unread,
Mar 27, 2018, 9:16:38 PM3/27/18
to MIT App Inventor Forum
Thanks, this is what I exactly needed

Amadou Touré

unread,
Mar 27, 2018, 9:22:43 PM3/27/18
to MIT App Inventor Forum
But first of all, how do I store data in CloudDB? Like I want to store a login and a password and then, if login username is 1904340 and password is 01072003, open the file of student 1904340. And do the same thing for other students. You know what I'm saying?

Amadou Touré

unread,
Mar 27, 2018, 11:28:41 PM3/27/18
to MIT App Inventor Forum
Can you explain what is button 1, button 2? And what the last block does?

SteveJG

unread,
Mar 28, 2018, 9:29:35 AM3/28/18
to MIT App Inventor Forum
Have you done any of the App Inventor tutorials Amadou?    Or, have you read the App Inventor's Manual (see below)?

Reading and doing the tutorials will help make the suggestions made by others easier to understand.

We want you to to be able to understand the code made with with App Inventor blocks, so here are some resources to help you learn to use the AI2 tools  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, make sure you read at least   
This article mainly describes a TinyDB, not the CloudDB, but TinyDB is similar.

The documentation for the CloudDB is here  http://ai2.appinventor.mit.edu/reference/components/experimental.html  

Here is a CloudDB tutorial  http://community.appybuilder.com/t/how-to-use-clouddb/4329    It is for a different compiler but AI2 works much the same way.

Read all that and you will be a CloudDB expert.

Regards,
Steve

Amadou Touré

unread,
Mar 28, 2018, 10:25:07 AM3/28/18
to MIT App Inventor Forum
Ok thanks Steve. I'll make sure to read all of those.
Reply all
Reply to author
Forward
0 new messages