Use LogCat to Debug for Android

To use LogCat you need to import the Log library in the java code import android.util.Log;

Then, where you would normally print something, replace “System.out.println(“HERE”);” with:

Log.d(“LOGCAT”, “HERE”);

Now when you run your app on the emulator or a device it'll print out to logcat, which can be viewed right in Eclipse (might need to go to Tools and click LogCat or something similar) or in the terminal in the directory where the android sdk has been installed, in the <sdk>/platform-tools/ folder.

Run adb logcat from that directory location to view the logs.

This prints out a log of everything that's happening, so if it's on the phone there's probably going to be a lot of stuff going on continuously, which is why it's helpful to use good tags so you can just browse or search for "LOGCAT" and you'll find what you're looking for.

Cow Tipping on the Steady Rise

Cow Tipping has been live on the Android Market for a month and a half now!  It's been pretty exciting to see it happen.  Granted, it's my first app and it's extremely simple, but I'm happy with it.  The app's making about a quarter a day now in admob ads and has almost 2500 downloads, 36% retention.  Trying to push out an update - possibly tonight - when I get to it.

Notes on some features to add:

  • Back button - from finished gameplay
  • Hint - for new users
  • Size Optimization - drop from 3.6 MB to under 2.0 MB
  • New finishing messages
  • Sheep - to distract from tipping the cows
  • Levels with different objectives, background, etc.

Any suggestions?  How can I make it something worth using?

ERROR: the user data image is used by another emulator. aborting

Got this error message after I restarted my system following an install prompt for another program (did not shut down the emulator first): "ERROR: the user data image is used by another emulator. aborting."  I fixed it, but had to try a couple different things.  Suggestions:

  1. If the Emulator is open, restart it
  2. If the Emulator is not opened (my case) try Run configurations > Target > Wipe user data > Run
  3. Another way to try "Wipe user data" is to click the Android SDK Manager icon in Eclipse, click the AVD you want to start, make sure you check wipe user data, then Launch.

Number 3 worked for me.