AppInventor: Membuat Daftar / List

From OnnoWiki
Jump to navigation Jump to search

Sumber: https://docs.google.com/document/d/1KhtOZLB-2b-PeRNCeMwwBLNI81Asa8uTaCpqO-31w20/edit

Iterating through a List of Information

Appinventor-list2.png

Objectives

Learn how to build a slideshow app. The concepts you learn can be used to build a quiz app, a study guide, a “Meet your Classmates” app, basically any app in which user navigates through information. Learn a fundamental concept: how to iterate through a list of information with an index variable

1. An Incomplete Slideshow App


Appinventor-list1.png

This app is 90% there but has some bugs. Do you know what the bugs are?

2. Trace the app

On paper, trace the app. Start by showing the values of the global variable index and the Image1.Picture property. Then show how they change as the NextButton is clicked.

3. Fix the app.

Fix the app so that it loops back to the first picture after reaching the last picture. You can begin by importing the starter app: http://appinventor.org/starterApps/SlideshowIncomplete.aia. Hint: you’ll need an if block.

Try to code this on your own. If you get stuck, check out the following learning nugget: http://www.appinventor.org/UserListNav

4. Create a “Meet My Classmates” app.

Take some pictures of your classmates (or friends), upload them into the Media section of your app, then modify your slideshow app so that it steps through the pictures you just took.

Challenge: Add a label for the person’s name and another global variable NameList that has a list of names corresponding to the pictures. Then code it so the right name appears with each picture.

Challenge 2: Can you make this into a game for helping people learn the names of their classmates?




Referensi