Using the Spinner Control for Selecting Items

When your app needs the user to select an item from a list of choices, use the Spinner control.

Suppose we have a really simple restaurant menu that provides a choice of tacos and drinks. Our customer may select a Chicken, Beef or Vegan taco from an interface that looks like this:

Spinner-Screen

Touching the Chicken Taco item on the screen displays a set of options – select a desired item from the list:

SpinnerScreenshotThe Designer View

Continue reading Using the Spinner Control for Selecting Items

Updated: Writing and Reading Text Files Using App Inventor

This post is a major update to a previous post on reading and writing text files using App Inventor. This revision includes information on how to locate the text files you create in your App Inventor apps, plus how to transfer those files from your smart phone or tablet to your computer.

An earlier blog post described how to store data using TinyDB so that an app’s data can persist between uses of the program, or even to share data between screens in a program.

Another way to save data is to write the data to a file on your Android device. App Inventor has introduced a File control that lets us write text data to a file and then read it back, later. As we will see, the File control is not the easiest thing to use but with some work, the control can be used to store data from our program into a file.

Once data is in a file, you could, hypothetically, transfer the file from an Android to device to another computer. Because Android stores the files in a way that they may not be readily accessible – or even visible – we need to use some simple tricks to find the file and transfer the file to a computer.

Update: To learn more about text files and transferring data in the CSV file format, check out Volume 3 of “App Inventor 2 Databases and Files” – thanks!

Continue reading Updated: Writing and Reading Text Files Using App Inventor

Update: Reading and writing text files with App Inventor

I previously posted a short tutorial on writing to and reading from text files stored on an Android device, using an App Inventor app.

Unfortunately, as some comments noted, the file being created seems to disappear – the data is written and can be read back – but the file is no where to be found on the phone!

After some research, I now know where the file is – and also how to copy the file from the phone (or tablet) to your personal computer.  While the solution to finding and saving the file to your computer is ultimately easy, I need to update the tutorial and explain some things about the Android file system. You will also need to install a free app on your phone in order to copy the file to your computer.

I have posted an updated tutorial that explains the details and shows how to store your files in the right location, how to find them (they are hidden from most views), and how to copy them to your personal computer.