Category Archives: Uncategorized

Part 2: Storing and accessing user interface components as variables

Part 1 showed how to reference and store user interface components as a variable. That tutorial used this method to easily change the background colors of six buttons on screen.

In Part 2, we use this technique to simplify a past tutorial about using a Bluetooth link between and Android device and two Arduino devices.

Continue reading Part 2: Storing and accessing user interface components as variables

Bluetooth and The Internet of Things #Bluetooth #Iot #Arduino #STEM #Programming

Yesterday I posted another item in a series of posts about using Bluetooth features in App Inventor. Bluetooth (together with low power wireless technologies such as Zigbee) are significant technologies that make “The Internet of Things” possible. These low power wireless technologies enable all kinds of devices to communicate with each other and with other devices such as Android phones and tablets.

Today, most Bluetooth devices run Bluetooth version 2.1 up through version 4.2, depending on the device. Bluetooth has undergone considerable enhancements and evolution over the years from providing a short range, lower speed serial data link suited for wireless earphones to providing high speed packet data communications over short distances while using very low power.

Bluetooth continues to evolve with Bluetooth version 5.

Bluetooth 5 adds more improvements including:

  • Up to 4x longer range
  • Faster data rates – on par with WiFi for some applications
  • Lower power

However – and this is important, most Bluetooth version upgrades require new hardware, and this is true for Bluetooth 5. To use version 5 features you will need version 5 compatible hardware – which is not yet generally available on Android phones and tablets.

Continue reading Bluetooth and The Internet of Things #Bluetooth #Iot #Arduino #STEM #Programming

Using Firebase in a real app – “Here I AM!” GPS Demo app

A previous post introduced the experimental Firebase component in MIT App Inventor. Firebase is a cloud-based database that may be used by App Inventor apps, and which makes exchanging data between users easy. Note: Firebase is experimental and may change in the future. At the present time, there is one Firebase database that is shared by all users. See comments in previous post for more information.

This post uses the GPS location sensors in phones to determine the phone’s position in latitude and longitude. Pressing a button labeled “Send GPS” sends the latitude and longitude coordinates to another phone, which then draws the position on a map. In this way, two phone users can wander about and transmit their location to each other, sending the data through the Firebase cloud database. I named this app “Here I AM!” – pressing the Send GPS tells another user that “I am here!”

User Interface

To use this app, the exact same app should be running on two separate phones. You can run it on a single phone but obviously, you will not be getting updates from anyone else!

The first time you run this app on Android 6, you will be asked to give permission to use location information. Also, be sure to set Location services to on, in Android Settings.

As you move about, press the Send GPS button.  Your latitude and longitude will be sent to Firebase, the other app will be alerted to an updated location, and your location will be displayed on the Google maps on their phone. If they press Send GPS, then their location will be updated on your phone.

The Lat/Long. textbox displays either the latitude, longitude or is prefixed with “THEM:”. “THEM:” means the textbox is showing the other phone’s location; if “THEM:” is not shown, then the textbox is showing your own latitude, longitude.

Screenshot_20160913-102744

Press Retrieve GPS to retrieve and display the latitude/longitude value currently stored in Firebase.

Press Show Map to display the  last retrieved location on the map.

Continue reading Using Firebase in a real app – “Here I AM!” GPS Demo app

How to Add Your App Inventor App to the Google Play App Store

Last fall, I created a tutorial on adding App Inventor apps to the Google Play Store. That tutorial is still worth reading and is available here.

But I heard from readers that they would like more information about the process of adding an App Inventor app to the Google Play Store. I have created this new tutorial to help with that!

Also – I will soon add videos to accompany these tutorials. Was hoping to have a couple posted today but I have run out of time until next week to get those done.

Sign Up for a Google Play Developer Account

To add apps to the Google Play store, you need a Google Developer Account. Sign up is easy but it does involve a one time (good for life) application fee of US $25.

Go to play.google.com/apps/publish to get started:

DevConsoleApp1

Follow the Google directions to set up your account.

Preparing Your App for the Google Play Store

Set the VersionNumber of Your App

In the Designer View, select the Screen1 component. At the bottom of Properties for Screen1, find the VersionCode and the VersionName items.

Continue reading How to Add Your App Inventor App to the Google Play App Store

Aligning the text that appears in ListPicker

Readers post questions on the FB page or the blog. Sometimes I can answer them but sometimes I cannot answer them right away. For those that I cannot answer, I add the question to a list of future tutorial ideas. If someone is not sure how to solve a problem, chances are that there are others who may need help with the same issue!

I am beginning to go through my list – watch for more tutorials based on reader questions. Note – I do not have time to solve specific or custom applications. I try to abstract the basic elements of the problem and create a generic solution that can apply to a wide variety of use cases.

ListPicker Text Alignment

A reader asked how to align the text that appears in the ListPicker box. The ListPicker displays a set of items on screen so that the user may select an item from the list. When the list appears on screen, all the items are “left justified” which means they appear on the left side of the screen.

To demonstrate, our ListPicker, below, displays a list of auto manufacturers:

Screenshot_20160502-115325Is there a way to center or right justify the items that appear in the ListPicker list like this? The first 4 items in this list are right justified and the last two are centered:

Screenshot_20160502-114442The answer to that question is basically “yes”, but it may not be perfect – as we will see.

Continue reading Aligning the text that appears in ListPicker