Exploration Guides

We're all explorers. You just need the right guide.

EGMaps – Compile and Test Your App

You’re finally there!  It’s time to see if all your hard work actually results in an app that really works.

Before you get too excited, a word of caution.  Any programmer will tell you that the likelihood of any program working right the first time is just about zero.  The good news, though, is that there aren’t many places where you’ll need to look to fix problems.

  1. In Eclipse, click the Java button in the upper-right to go back to the normal programming screen
  2. Find your app in the Package Explorer window, and open it, if it’s not already open.
  3. Plug in your Android, changing to whatever mode you found worked on it (probably Media Device).
  4. Is there a red X on your app?  A red X indicates that there’s an error somewhere you need to fix before you can proceed.  No red X?  Skip down to step 5
    1. Under the name of your app, you’ll also have a red X on one or more of the files or folders.  Assuming you only edited the files described in these instructions, it shouldn’t be too hard to fix.
    2. If the red X is on the src folder:
      1. Double-click on src
      2. Double-click on the java name of your app below src
      3. Double-click on Main.java to open it, if it’s not already open.
      4. In Main.java, there will be one or more lines with a red X.
        1. If the red X is on a line near the top that starts off Import and ends in .R, just delete that line.
        2. If the red X is on the top package line, the name of the package here, in the Package Explorer window, and in your AndroidManifest.xml file.  Just make sure they all match, including case.
      5. Click File/Save All and the error should go away.
    3. If the red X is on the res folder:
      1. Double click res
      2. If the red X is on the drawable folder
        1. You probably have a bad file name.  These files should all be lower-case, no spaces or symbols, and end in .png
        2. When you’ve fixed the problem, right-click on drawable and click Refresh.
        3. Click File/Save All.
      3. If the red X is on the values folder
        1. Double-click values
        2. If strings.xml isn’t already open, double-click to open it.
        3. One or more lines will be marked with an X in the left margin.  Chances are, you put in an illegal character in one of your strings, or maybe missed a quote.
        4. When you’ve fixed the problem, click File/Save All.
      4. If the red X is on the layout folder
        1. This means you probably didn’t put a logo.png file into the drawable folder.
        2. Copy your logo.png file into the drawable folder
        3. Right-click drawable, then click Refresh.
        4. Click File/Save All.
    4. If the red X on on Android Manifest.xml
      1. If the red X is on the package line at the top, the package name here doesn’t match the package name listed under src,  The package names must match everywhere.  Fix this, then click File/Save All.
      2. If the red X is on the android:icon line, your probably didn’t put a file named icon.png into the drawable folder.
        1. Put your icon file into that folder
        2. Right-click on drawable and click Refresh.
        3. Click File/Save All.
  5. If Main.java is already open, click in that file.  Otherwise, open it under src/<your app package name>.
  6. Make sure your Android is plugged in, that the screen saver is off and that you’re on the home screen.
  7. The first time you try to run your app:
    1. In Eclipse, click Run/Run Configurations
    2. Click on the Target tab
    3. Check Always prompt to pick device, then click the Run button.
  8. If you’ve already run your app at least once, just click Run/Run.
  9. Your device should show up in the top window.  Don’t worry if it has a red X under Target, that just means you’re running an older Android. It should be listed as Online.
  10. Click on your device, then click OK.
  11. You should receive the initial animation splash screen, then you should launch EGMaps.  As long as EGMaps launches into the update screen, that means your code is probably good, and now you need to test your data.

 

No comments yet.

Leave a Comment