Monday 22 June 2020

How to connect Firebase with MIT App Inventor 2 [ Firebase ]

How to connect Firebase with MIT App Inventor 2 [ Firebase ]
How to connect firebaes with MIT App Inventor 2 MIT App Inventor has played a big role in bringing programming to a wide range of audience, primarily high school students. One of the challenges that I have faced while teaching this to a young audience has been that once you progress beyond a certain set of features in App Inventor applications, you get to a tricky situation where you need to explain persistence of data. App Inventor 2 has good support for local persistence of data via TinyDB and TinyWebDB. The former is a local persistence solution and the later is a managed database solution in the cloud. While TinyDB is good, it is time to look at Firebase, the hosted real-time database in the cloud from Google. irebase Setup The first step for us is to setup the Firebase database in the cloud. The instructions are given below: Visit https://ift.tt/1OK0qH9 and login with your Google account. You will see the welcome screen with two buttons as shown below: Click on Create New Project button. This will bring up the Create a project screen as shown below, where you will need to provide a project name. Note that you will need to provide a unique name for your project. Select a Country/region where you would like your database to be hosted. Click on Create Project. Be patient. This will create a Firebase database under the Spark Plan. This plan is free and is good enough for our scenario. As an example of what the Spark plan gives us, take a look at this table. To iterate again, we are only going to look at the Database feature of Firebase and not other services for now. Click on the Database link on the left. This will show up some details about your database as shown below: Click on the Rules tab. You will notice that it has the following rules by default as shown below. Let’s not get too much into rules for now but it is sufficient to understand that why the magic text indicates is that to do database reads and writes, you will need to be authenticated. Firebase supports multiple authentication mechanisms, but we will keep it simple for now and not use any authentication. Note that what we are going to do is not good practice but it is ok for our tutorial here. What we are going to do is open up access to this Firebase database to allow anyone (everyone) to both read and write. To do that, simply start editing the text to the one that is shown below: Click on Publish. This will publish (associate) the rules with your database. It also indicates clearly (and which is good by the way) that we have defined our database to be accessed by the public (read and write). Boys and Girls, don’t try this at home (sorry … don’t try this in a live database). That’s it. We have a Firebase database in the cloud, all ready for read and write. Now, all we need is to write this to our Android application. Enter App Inventor 2 now for completing our Android application. thunkable firebase authentication firebase cloud functions
via YouTube https://www.youtube.com/watch?v=ES26E4r_uEU

No comments:

Post a Comment

😍Developer on Weekends #shorts #officememes #developermemes

😍Developer on Weekends #shorts #officememes #developermemes Welcome to the latest viral YouTube shorts meme for developers! 😍Developer on...