FAQ

Contents

  1. 1 G1 Phone
    1. 1.1 Why did we have to jump through so many hoops to start using our phone?
    2. 1.2 How do I run the tutorial that we skipped over in class?
    3. 1.3 Can I buy my phone at the end of the semester?
    4. 1.4 Where can I get more information about the phone?
  2. 2 Phone service
    1. 2.1 What is a SIM card?
    2. 2.2 Where does a SIM card go on the G1?
    3. 2.3 Can I use the SIM card from my other cell phone in the G1?
    4. 2.4 Are the phones unlocked?
    5. 2.5 Can I buy phone service on the G1?
    6. 2.6 Can I get phone service over the free wireless connection?
  3. 3 Android
    1. 3.1 How do I get to the Settings screen?
    2. 3.2 How do I uninstall an app?
  4. 4 General
    1. 4.1 How do I take a screenshot?
    2. 4.2 How can I create a 2D-barcode?
  5. 5 App Inventor for Android
    1. 5.1 How do I run App Inventor for Android?
    2. 5.2 How can I tell if a computer meets the minimum requirements?
    3. 5.3 How can I install the software so my computer can run AIA?
    4. 5.4 Where can I find a computer that can run AIA?
    5. 5.5 Where can I find the official AIA documentation?
    6. 5.6 Why can't I log in to AIA anymore?
    7. 5.7 How can I install apps if I don't have a wireless connection for my phone to use?
    8. 5.8 Why am I getting the error "java.lang.NoSuchMethodError: java.lang.String.isEmpty()Z"?
    9. 5.9 Why isn't my sound/video/image file working?
    10. 5.10 How do I convert a sound file to a supported format?
    11. 5.11 Why did packaging/building my app fail?
    12. 5.12 How do I send someone my source code?
    13. 5.13 Why did my app crash when running on my phone?
    14. 5.14 How can I get the log file from my phone?
    15. 5.15 Why can't I install my app?  I was able to install it before.
    16. 5.16 Why won't the Blocks Editor save and work properly on my Mac?
    17. 5.17 Is there a way to get the Google account name for a phone?
    18. 5.18 Is there a way to get a unique id identifying a phone?
    19. 5.19 How can I use TextToSpeech?
    20. 5.20 How do I upgrade to a newer version of Android?
    21. 5.21 Can one app have multiple screens?
    22. 5.22 How can I make one AIA app launch a second AIA app?
    23. 5.23 How can I make an AIA app launch a different program?
      1. 5.23.1 Camera
      2. 5.23.2 Web search
      3. 5.23.3 Open browser to web page
      4. 5.23.4 Open map to location
      5. 5.23.5 Other applications
    24. 5.24 Can I trigger an ActivityStarter without having the user press its visual representation (button)?
    25. 5.25 Can I modify the list displayed by a ListPicker?

See also the official AIA troubleshooting FAQ.

G1 Phone

Why did we have to jump through so many hoops to start using our phone?

The phones are meant to be set up using SIM cards.  Using a wireless network requires some hacks.  (There were more steps I did on each phone before class.)

How do I run the tutorial that we skipped over in class?

  1. Go to the Settings menu by going to the Home screen and either (a) pressing the menu button or (b) scroll through the applications and click on "Settings".
  2. Select "About phone", which should be the last item.  (You might want to also check out some of the other options, like "Date & time" if your phone isn't showing the proper values.)
  3. Select "System Tutorial".
Please let me know if you have any trouble.

Can I buy my phone at the end of the semester?

No, but you can buy the same type (an unlocked G1 developer phone) from Google for $399 (plus $25 to register as a Google developer).  If you don't care about having a developer phone, you can buy an unlocked G1 for about $200 on craigslist.  Phones locked to t-mobile may be available for less.  You'll have to do some research to determine which type of phone best meets your needs.  We can discuss this.

Where can I get more information about the phone?


Phone service

What is a SIM card?

A SIM card is a small piece of plastic and silicon used to identify a mobile phone service subscriber.  You get one from your cellular service provider (e.g., AT&T or Verizon).

Where does a SIM card go on the G1?

Your phone does not have a SIM card, something normally gotten from a cellular service provider, such as t-mobile or AT&T.  This video shows how to insert a SIM card.  Removing the back cover can be scary, so let me know if you'd like me to do it for you.

Can I use the SIM card from my other cell phone in the G1?

Quite possibly.  You might try putting your SIM card in the G1 and seeing if you can make a phone call, but I wouldn't try using a data connection (e.g., going to a web page or the Android Market) without checking with your carrier what the charges would be.

Are the phones unlocked?

Yes.  That means you can use them with any cellular provider that supports the technology

Can I buy phone service on the G1?

Yes.  Here are the plans I am aware of.  The below summaries are my interpretation of them.  You should get full information from the provider before signing up.

T-Mobile offers a prepaid plan that costs $1/day that you use the phone, provides free calling from 7 PM to 7 AM, and charges $0.10/minute for other calls.  Text messages cost $0.10 to send and $0.05 to receive.  I did not see information about data charges. 

AT&T offers three prepaid plans worth considering:
  • $3/day unlimited calling, paying only on days when you use the phone
  • $1/day + $0.10/minute, paying only on days when you use the phone
  • $0.25/minute
Text messages are $0.20 each, and data charges are $0.01/KB.  (I recommend getting your data through the WIFI connection instead, which is free.)

Can I get phone service over the free wireless connection?

I will discuss this in class on Tuesday, September 8.  Email if you would like information sooner.

Android

How do I get to the Settings screen?

First, go to the Home screen.  Then, you can either: (1) press the "menu" button, then touch "Settings" or (2) scroll down and launch the "Settings" app.

How do I uninstall an app?

There are two methods.  The one I recommend is downloading Quick Uninstall by David Blackman from the Android Market.  You can use it to easily delete any app (except for the built-in ones).

The other method is to go to the Settings screen, then choose "Applications", then "Manage applications", then click on the application you wish to delete, then click on "Uninstall".

General

How do I take a screenshot?

Here are directions for taking a screenshot in Windows or taking a screenshot in Macintosh OS X.

How can I create a 2D-barcode?

Here is a QR code generator.

App Inventor for Android

App Inventor for Android (AIA) is the name of the software we use to create programs.

How do I run App Inventor for Android?

From a computer meeting the minimum requirements (having Firefox 3+ and Java 1.6), go to http://androidblocks.googlelabs.com.

How can I tell if a computer meets the minimum requirements?

See Setting up your computer to run App Inventor for Android.

How can I install the software so my computer can run AIA?

See Setting up your computer to run App Inventor for Android.

Where can I find a computer that can run AIA?

You can go to the Mathematics and Computer Science lab in CPM 200 (the building behind the bell tower).  I believe your card key will let you in until midnight.  (I will check the exact limitations.)

If you try running AIA from computers in any other Mills lab, please report back whether it worked.

Where can I find the official AIA documentation?

Visit http://sites.google.com/site/appinventorhelp/ or click on the "Help" link at the top right of the AIA designer screen.

Why can't I log in to AIA anymore?

First, check which version of Firefox you're using, which you can do by selecting "Help" > "About Mozilla Firefox" from the menu bar.  If the version number is less than 3, that's your problem.  Otherwise, clearing your browser's history and restarting it usually fixes this problem.  Here's how to do it:

If your Firefox version is less than 3.5:
  1. Select "Tools" > "Clear Private Data..."
  2. Check "Cookies" and "Authenticated Sessions".
  3. Click on "Clear Private Data Now".
  4. Close all Firefox windows (including this one), and restart Firefox. 
If your Firefox version is 3.5 or greater:
  1. Select "Tools" > "Options..." > "Privacy".
  2. Check "Clear history when Firefox closes", and click on the "Settings..." button to the right, which will open a Settings window.
  3. Make sure all of the checkboxes in the History section of the Settings window are set.
  4. Click on "OK" to close the Setting window.
  5. Click on "OK" to close the "Privacy" window.
  6. Close all Firefox windows (including this one), and restart Firefox. 

How can I install apps if I don't have a wireless connection for my phone to use?

See Setting up your Computer to Communicate with your Phone at the official help site.  (I welcome feedback on those instructions because I wrote them.)

Why am I getting the error "java.lang.NoSuchMethodError: java.lang.String.isEmpty()Z"?

You are almost certainly using Java 1.5 instead of Java 1.6.  See Setting up your computer to run App Inventor for Android.

Why isn't my sound/video/image file working?

Android only supports certain media formats.  Images should be JPEG, GIF, PNG, or BMP.  Supported sound files include PCM-encoded WAV files and MP3 files encoded at 44.1 Kb/s.  (For more details, see http://developer.android.com/guide/appendix/media-formats.html.)  If your sound file doesn't work, try converting it to a supported format.

To check if your media file was uploaded to the AIA server correctly:
  1. Download the source code for your app.  It will be a zip file.
  2. Within the zip file, the "assets" directory should hold all of your media files.  Make sure none have size 0.  Try opening the misbehaving file and see if you can do so.
  3. Capture the log file from your phone.
Report the results of the above steps, and send them to your instructor with the source code to your instructor.

How do I convert a sound file to a supported format?

I was able to do this under Windows by downloading and installing Free Mp3 Wma Converter.  Let me know if you need help installing it.

Once you've installed it, here are the steps to convert a file:
  1. Launch Free Mp3 Wma Converter.
  2. To specify a file to convert, either drag it into the "Files to convert" pane, or add it by selecting File > Add Files.
  3. Leave the default values in the "Output configuration" pane unless you know what you're doing.  The defaults are:
    • "Save in the file's directory" is checked.
    • Output format is "Mp3".
    • Format parameter is "MP3 44,100 kHz; Stereo;  128 kbps;".
  4. Press the "Convert!" button on the bottom right.
You should then be able to find the new file with a "mp3" suffix in the same directory as the original file (which is unchanged).

If anyone knows how to do this on Mac OS X, let me know.

Why did packaging/building my app fail?

  1. Make sure that your media files (sound, video, and images) do not have a total size larger than 5 MB.
  2. You may be able to find some clues under the "Debugging" tab.  Send any messages to your instructor along with the source code.  You should ignore messages that include "no accessible method 'Initialize' in java.lang.Object".

How do I send someone my source code?

Go to the Projects tab in the Designer, check the project, choose More Actions, and choose Download Source.  (If it fails, make sure that you're using an appropriate version of Firefox.)  That will download a zip file that you can email to someone else as an attachment.

Why did my app crash when running on my phone?

Good question.  For clues, send the log file from your phone to your instructor, along with the source code.  If your phone has wireless access, you can access the phone's log file with the application android-log-collector, available through this bar code.  If your phone doesn't have wireless access, you can get the log file from through the USB cable after setting up your computer to use adb.

How can I get the log file from my phone?

Your phone has a log file that contains useful debugging information.  If your phone has wireless access, you can access the phone's log file with the application android-log-collector, available through this bar code.  If your phone doesn't have wireless access, you can get the log file from through the USB cable after setting up your computer to use adb.

Why can't I install my app?  I was able to install it before.

Sometimes, people have problems installing an app over an earlier version with the same name.  Try uninstalling the app on your phone before installing the new version.

Why won't the Blocks Editor save and work properly on my Mac?

We're trying to figure that out. To help us understand the problem, go to the Applications directory of your Mac and then to "Utilities > Java Java Preferences" and launch "Java Preferences". Select the "Advanced" tab, then select "Show console" under "Java console". When you next launch the Blocks Editor, a console window will be open that displays debugging information. Send your instructor that information if you have the problem again.

Is there a way to get the Google account name for a phone?

Yes. The Voting and GameClient components both have a read-only UserEmailAddress property that stores the Gmail account of the person currently logged in on the Android phone.

Is there a way to get a unique id identifying a phone?

No, but there is a way to get the Google account name.

How can I use TextToSpeech?

It is recommended that you upgrade to version 1.6 (Donut) of Android.  Then, you should install Text-To-Speech Extended from the Market.

How do I upgrade to a newer version of Android?

First, you shouldn't do so unless you have a good reason.  App Inventor has not been tested with any versions except for 1.5 (Cupcake) and 1.6 (Donut).  The only current reason to upgrade is for improved TextToSpeech.

The easiest way to upgrade is to bring in your phone and ask Ellen to do it, since she has everything loaded.  If you can't want and want to do it yourself, follow these instructions.  This probably won't uninstall your apps from your phone, but you should be prepared for the possibility that it might.

Can one app have multiple screens?

No, but you can have apps launch other apps.

How can I make one AIA app launch a second AIA app?

First, you will need to find out the Java package and class names of the second app.  One way to do this is to:
  1. Download the source code to a desktop/laptop computer.
  2. Using a file explorer or unzip, utility, find the file youngandroidproject/project.properties.
  3. The first line will start with "main=".  Everything after that is the package and class name. 
For example, I saw "main=com.gmail.Spertus.Ellen.HelloPurr.Screen1".  To make an AIA app that would launch HelloPurr, I created a new app (which I called Launcher) with an ActivityStarter component with the following properties:
ActivityPackage: com.gmail.Spertus.Ellen.HelloPurr
ActivityClass: com.gmail.Spertus.Ellen.HelloPurr.Screen1

When I ran the new Launcher app and pressed the ActivityStarter (which looks like a button), HelloPurr started.

I was able to get back to my Launcher app by pressing the back arrow button.

The source code to Launcher (which has additional functionality, described in the next FAQ entry), is attached.  To see it launch another application, you will also need to install my version of HelloPurr or modify Launcher's source code to launch one of your apps.

How can I make an AIA app launch a different program?

The application Launcher illustrates these features and is attached.

Camera

To launch the camera, create an ActivityStarter with the following properties:

Action: android.intent.action.MAIN
ActivityPackage: com.android.camera
ActivityClass: com.android.camera.Camera

The camera application will be launched when the user touches the visual representation of the ActivityStarter (which looks like the button).

Web search

To launch a web search for some text determined at compile-time, create an ActivityStarter with the following properties:

Action: android.intent.action.WEB_SEARCH
ExtraKey: query
ExtraValue: some text
ActivityPackage: com.google.android.providers.enhancedgooglesearch
ActivityClass: com.google.android.providers.enhancedgooglesearch.Launcher

To set the query text from a program, I created a textbox QueryTextBox and an Activity Starter WebSearch and connected them like this:

Open browser to web page

Here are the ActivityStarter settings for opening a web page:

Action: android.intent.action.VIEW
DataUri: http://some.url.com/path

The ActivityStarter's DataUri property can also be set from within the program.

Open map to location

If you have the latitude and longitude of a location (e.g., 37.8 and -122.23, respectively), you can set the ActivityStarter properties to:
Action: android.intent.action.VIEW
DataUri: geo:37.8,-122.23?z=23

The z (zoom) value of 23 indicates that the highest zoom value should be used. Zoom values range from 1 (the entire Earth) to 23 and may be omitted from queries.

If you have the zip code (e.g., 94043), you can set the ActivityStarter properties to:

Action: android.intent.action.VIEW
DataUri: geo:0,0&q=94043

If you have an address (e.g., 5000 MacArthur Blvd Oakland, CA), you can create a DataUri with the URL encoded address:

Action: android.intent.action.VIEW
DataUri: geo:0,0&q=5000%20MacArthurBlvd%20Oakland%2CCA

Generally, the only characters you have to replace are spaces (%20) and punctuation, such as comma (%2C) and period (%2E).

Other applications

For hints on starting other applications, see the Android API and OpenIntent's list of Intents.

Can I trigger an ActivityStarter without having the user press its visual representation (button)?

Unfortunately, not yet.

Can I modify the list displayed by a ListPicker?

Yes.  See the attached program ListPickerTest, noting the comments.
Č
ċ
ď
HelloPurr.zip
(45k)
Ellen Spertus,
Nov 22, 2009, 11:24 PM
ċ
ď
Launcher.zip
(4k)
Ellen Spertus,
Nov 22, 2009, 11:24 PM
ċ
ď
ListPickerTest.zip
(4k)
Ellen Spertus,
Nov 30, 2009, 12:37 PM
Comments