Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
How to build your own chat app in MIT app inventor 2
Play lesson

MIT App Inventor Full Course for beginners 2020 - How to build your own chat app in MIT app inventor 2

5.0 (0)
19 learners

What you'll learn

This course includes

  • 85 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

New One To One Chat App -: https://www.youtube.com/watch?v=QSZKIu8m4SU&pp=ygUcY2hhdCBhcHAgaW4gbWl0IGFwcCBpbnZlbnRvcg%3D%3D In this video, we will create Online Forum app in MIT app inventor 2, This app is a simple app that uses the CloudDB component to store data in the cloud and allows multiple users of the app to communicate over multiple devices. Download Code-: https://thecodingbus.info/how-to-build-your-own-chat-app-in-mit-app-inventor-2/ Go to ai2.appinventor.mit.edu and start a new project. Initialize one variables, as follows: chatList: stores all chat messages in a list Drag out a SubmitButton.Click event block, You will be saving those messages to CloudDB, the "Cloud Database". You will append the new message to the chat list already stored in CloudDB. For a tag, simply use "chat", and join the userName, a colon, and the message so it will appear that way when displayed. And finally, for either situation, clear the TextBox. When the app first starts, you need to check if there are already chat message other users may have sent, and you need to display them. Add a Screen1.Initialize block, and in it, call CloudDB1.GetValue to get any existing chat messages from CloudDB. If no value is found, return an empty list, since your chat messages are kept in a list. When you call CloudDB1.GetValue, it asks CloudDB for that tag’s current value. So there is a callback event, CloudDB1.GotValue, that is triggered when CloudDB responds to GetValue. First check whether the tag is the correct one ("chat") using an if-then block. If so, then save the value, which should be the list of messages, into the global variable chatList.. Then set ListView1.Elements to the list of messages, so they will be displayed in the ListView. The CloudDB1.DataChanged event is triggered whenever anyone using the app updates CloudDB, so this event is triggered whenever any new message by anyone is sent. This block should essentially do the same thing as the GotValue block, so you can right-click and Duplicate then inner blocks from GotValue, and snap them into DataChanged. That is it! Now it's time to test! The best way to test an app using CloudDB and multiple users, is to use multiple devices. The MIT AI2 Companion does not always allow for mutiple users to connect at the same time, so the better option is to build the apk, and install your app on more than one mobile device. From the Build menu, choose "App (provide QR code for .apk)". Once the apk is built, scan the generated QR code, and install the apk on multiple devices. Then send a message from each device. All messages should appear on all devices. You can also close the app, and restart it, and you should see the history of messages. How cool is that? Expand your App Here are some ideas to enhance your Chat app! Reverse the order of the chat messages displayed so that the latest message is always displayed at the top. Hint: use reverse list block Indicate when a person has joined the chat such as “Selim has joined the Chat” in case they decide not to send any messages for a while. Add a timestamp to each message. Add a Clear button to clear out previous messages. Add chat rooms, where users must specify a room they want to join. thunkable mit app inventor ideas .................................................................................................... Follow Us On Social Media For More Updates -: Facebook -: facebook.com/TheCodingBus/ Website-: https://thecodingbus.info/ Instagram-: https://www.instagram.com/sourabhdubey007/ Reddit-: https://www.reddit.com/user/sourabhdubey007 Subscribe TCB -: http://bit.ly/TheCodingBus ........................................................................................................ app inventor 2 教學 tinydb app inventor 2 ai2 app inventor app inventor game app inventor calculadora tutorial app inventor app inventor projects apps #TheCodingBus #TCB #unitedstates #us MIT App Inventor Premium Course (2025 Edition) – Learn with the Newest Features https://www.udemy.com/course/mitappinventorcourse/?referralCode=9723BA5EDD8E5C7A64BE

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere