Category Archives: Tips

Blocks Editing Tip: Arranging and collapsing blocks in the editor

As you develop your App Inventor program using the Blocks editor, do you find your blocks overlapping and crashing in to one another on the screen? You know, like this:

AIBlockMess

You can drag the blocks on the screen so they no longer overlap, but dragging each block is tedious (time consuming). But there is an easy way to automatically re-arrange the blocks.

  • Move the mouse pointer to any part of the white space outside the blocks
  • On Windows, right-click the mouse button
  • On Mac OS X, press Ctrl and click the mouse button

Continue reading Blocks Editing Tip: Arranging and collapsing blocks in the editor

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.

How to install the Tip Calculator on your phone

You have probably run your App Inventor apps through AI Companion. The AI Companion is a great tool for quickly loading the app you are developing on to your phone for testing. However, the AI Companion does not install the app on to your phone, like a regular app.

To install the app on your phone, use the Build menu “App (provide QR code for .apk)”. You will see a progress bar appear on your screen as App Inventor prepares the app for installation on your phone. Behind the scenes, it is creating a “.apk” file which is the type of file used for all Android applications.

AppInventorBuildOnce the app build process is finished, you’ll see a QR code displayed on your screen:

QRCodeTC5

 

If you are not familiar with QR codes – a QR code is a method of encoding data into a matrix. A smart phone camera takes a snapshot of the QR code matrix and software on the phone extracts the encoded data. In this case, the data is the URL or web address where a temporary copy of your .apk file has been stored. You’ll need to install a QR code reading app (available for free in the Google Play store) and use it to scan the code.  Then, follow the on screen prompts and icon to download the .apk file to your phone and then install the app on to your phone. Once installed, it will appear in your list of apps just like any other app.

If you do not wish to use the QR code method, you can also build and download the .apk file directly to your computer. Once the .apk file is on your computer, you could email the .apk file as an attachment – such as email it to yourself! Then, on your phone, fetch your email and download and install the apk file on to your phone.

 

App Inventor Tip Calculator version 5: Fully automated!

What the App Does

This is the fifth version of 5 app versions that implement a tip calculator – and the final version is pretty cool! This app is useful – I was recently traveling and used it on my smart phone to calculate restaurant tips – I will post a short tutorial on how to install this app on your phone.

  • Version 1 introduced the basic app and the use of error checking to handle user data entry mistakes.
  • Version 2 introduced the Slider user interface component to select the tip amount. Using the Slider, the user selects a tip from 0% to 30%. Since there is no text entry, it is not possible for an incorrect tip value to be entered.
  • Version 3 introduced an improved user interface to eliminate user data entry errors.
  • Version 4 introduces “procedures” to clean up the code in preparation for version 5.
  • Version 5 revises Version 4 to make the calculation of the tip fully automatic plus fixes some minor oddities.

In Version 5, we eliminate the “Calculate tip and total amount” button by making the calculation automatic. Each time we enter a digit or adjust the slider, the tip is calculated immediately. There is no need to press a button to do the calculation.  Just enter a bill amount and optionally adjust the slider to select a tip percentage.

The Tip Calculator User Interface

The new user interface eliminates the Calculate button and adds a single “Clear All” button as a quick way to reset the calculator. This sets the bill amount back to zero and the tip amount to 20%.

Here is a view of the app in operation – the bill amount of 23.45 has been entered on the keypad and the tip amount is 20%. The tip and total bill are shown at the bottom of the screen.

Each time any digit is entered – or the tip is adjusted – the tip and total is automatically calculated.

TipCalc5-Screenshot_2014-11-12-17-43-32

 

Continue reading App Inventor Tip Calculator version 5: Fully automated!

How to change button colors in App Inventor

You can change the colors of buttons (and some other components) in your App Inventor apps. Using some programming tricks, buttons can be made to change color continuously!

Here is a very short demo of a button whose color is continuously changing on the screen:

I will soon post a tutorial on how to do simple color changes and also how to do “tricks” like that shown in this video.

Be sure to keep checking back, like us on Facebook, Google+ and Twitter for more updates! Thanks!