Sorry for the delays in getting more tutorials up!

I have been busy with other projects.

But I have a big list of ideas for more tutorials and App Inventor projects! As time becomes available (which should be soon!) I will be posting more items here.

I am also beginning to study the Internet of Things market and technologies. App Inventor may play a role in this exciting new technology where everything is potentially able to communicate with other objects and the Internet.

Ed

Rounding a number to a specific number of decimal places

I was working on a small app that needed to round some numeric values. For example, given a number such as 123.456789, I wanted to round this off to two decimal places such as 123.46. Why .46 instead of .45? Because the value is rounded at the n-th decimal place (.456 rounds up to .46).

MIT App Inventor does not have a function to do this sort of round off – well, not exactly. Actually, it has a formatting function that can accomplish the same thing but it is intended for converting numeric values to text strings.

I created a simple little program to demonstrate how this works, plus a couple of other methods to implement this feature.

Update: This post has been updated with thanks to Taifun for noting that App Inventor does have a “raise to a power function”. See below for more details and a link to his great web site!

User Interface View

The user interface prompts for a number, and the number of decimal places to which it should be rounded. Press the Round off number button to see the result.

RoundOffUIHere you can see that 123.4567 has been rounded to 123.457.

Continue reading Rounding a number to a specific number of decimal places

Appinventor.pevest.com usage

This web site is now receiving 25,000 unique visitors each month! I am very pleased that these tutorials are helpful to so many people all over the world!

Web site access is nearly the same every hour around the clock, implying a global readership (update: 145 countries!)

Operating System Used

  • 82% of the visitors use Windows
  • 7% use Linux
  • 4.4% use Mac OS X
  • 1% use iOS (iPhone/iPad)
  • A very tiny number have accessed the web site via Java Mobile, Blackberry and … the Nintendo Wii plus a few miscellaneous devices.

Bandwidth

The web server output an average of about 800 kbytes per minute delivered to those viewing the web site. That is nearly 1 megabyte per minute.

Browser Used

  • Internet Explorer 42%
  • Chrome 32%
  • Firefox 12%
  • Opera 5%
  • Safari 2%
  • Android browser on smart phone 1/2%

Countries

I do not yet have a count of countries. I am working on that.

UPDATE: 145 countries!

How Do People Find appinventor.pevest.com?

  • 67% come directly to the web site by typing the address or using a bookmark
  • About 1% come from a link on another web site
  • About 32% come from an online search, and almost all of those come from Google searches.

The most common search is for information about App Inventor (duh!), followed by information about Bluetooth! High in the search list are also searches for information on Android or App Inventor and Arduino and searches related to App Inventor sensors (such as orientation sensor) and TinyDB.

How Do We Know This?

When you visit any web site, your browser sends information about the operating system used, screen size, browser used, and so on, to the web site so the server can optionally deliver a web page customized to your configuration. When you search for something online, the search service (such as Google) passes the search text to the web server so web developers can optimize their content or learn what content is most desired by users.

The web server does not know who you are.

Using Location Information and GPS for finding your position

This tutorial introduces location services features available in App Inventor.

A future tutorial will demonstrate these features applied to specific applications.

About Android Device Location and GPS Features

Your Android device probably has built-in features to identify the device’s location. These features may include:

  • Global Positioning Satellite receiver (GPS)
  • Cellular network location information
  • Wi-Fi network location information

The GPS receiver interprets special (and very weak!) timing signals from satellites and uses those signals to compute latitude, longitude and altitude of your device. GPS has fairly good accuracy – correctly identifying the device’s position within as little as 5 meters (but which may at times be much wider such as within a 30 meter diameter circle accuracy). GPS accuracy is affected by the device’s ability to see the sky and may be blocked by buildings, trees and weather, and signals may suffer from ionospheric effects.

Cell phones can obtain information about the cellular network tower to which they are connected, including location information from the cellular tower.

Wi-Fi networks have a unique identifier associated with them (not the SSID public address). Google has built a map of wi-fi access point network locations using a combination of their Google mapping cars as well as everyone’s Android-powered cellular phone to build a huge database of wi-fi access points and their location. Your Android device can use a combination of location data and fetch a postal mailing address from Google for a given location.

Android phones have options as to which type of location information to use.

  • Cellular network information may be the least accurate, but it also uses the least amount of battery power.
  • Wi-fi network position information also uses little battery power, and can provide reasonably accurate location information when your phone is indoors and unable to hear signals from GPS satellites.
  • GPS provides the best accuracy but receiving and processing the signals uses the most battery power.

Your Android phone has options to select High accuracy, Battery saving and Device only.

  • High accuracy – Android will automatically select GPS, cellular or wi-fi to obtain a high accuracy position reading. This is likely the default setting on your phone.
  • Battery saving – Android will use cellular or Wi-fi networks to obtain position information.
  • Device only – Android will use the GPS receiver (greatest battery drain)

To select Location services, go to Settings | Location and set this feature to “On”.

Touch the item labeled “Mode” at the top of the screen to select “Location mode” options. This is where you may choose High accuracy, Battery saving or Device only.

Screenshot_20160516-175035To use any location features, you must turn Location to “On” in Android Settings!

MIT App Inventor has a component named LocationSensor providing access to latitude, longitude, altitude and even the postal mailing address associated with the location.

This tutorial introduces the LocationSensor and the basic properties and features. A future tutorial will go in to more depth.

Continue reading Using Location Information and GPS for finding your position

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

Learn to program with App Inventor