Data Data Everywhere
If you are used to developing for other databases, you are also probably used to having tools to inspect and manipulate the contents of the database, beyond merely the database's API. With Android's emulator, you have two main options for this. First, the emulator is supposed to bundle in the sqlite3 console program and makes it available from the adb shell command. Once you are in the emulator's shell, just execute sqlite3, providing it the path to your database file. Your database file can be...
Following the Script
Unlike other mobile-device operating systems, Android has no restrictions on what you can run on it, so long as you can do it in Java using the Dalvik VM. This includes incorporating your own scripting language into your application, something that is expressly prohibited on some other devices. One possible Java scripting language is BeanShell.1 BeanShell gives you Java-compatible syntax with implicit typing and no compilation required. So, to add BeanShell scripting, you need to put the...
My Myself and MyLocationOverlay
Android has a built-in overlay to handle two common scenarios Showing where you are on the map, based on GPS or other location-providing logic Showing where you are pointed, based on the built-in compass sensor, where available All you need to do is create a MyLocationOverlay instance, add it to your MapView's list of overlays, and enable and disable the desired features at appropriate times. The at appropriate times notion is for maximizing battery life. There is no sense in updating locations...
Flipping Them Off
Sometimes, you want the overall effect of tabs only some Views visible at a time , but you do not want the actual UI implementation of tabs. Maybe the tabs take up too much screen space. Maybe you want to switch between perspectives based on a gesture or a device shake. Or maybe you just like being different. The good news is that the guts of the view-flipping logic from tabs can be found in the ViewFlipper container, which can be used in other ways than the traditional tab. ViewFlipper...
Readin n Writin
Reading and writing your own, application-specific data files is nearly identical to what you might do in a desktop Java application. The key is to use openFileInput and openFileOutput on your Activity or other Context to get an InputStream and OutputStream, respectively. From that point forward, the process is not much different from using regular Java I O logic Wrap those streams as needed, such as using an InputStreamReader or OutputStreamWriter for text-based I O. Use close to release the...


