If the selected JPG file have Exif with GPS tag, the converted location in degree format and a extra MapView button will be shown. Click on the MapView button will start a MapView locate the GPS location of a photo.

Thursday, January 21, 2010

In my own case; I have no digital camera with GPS, but I have a GPS logger. The GPS info can be added into JPG file using GPicSync. But it's in the format of degree, minute, second, not GeoPoint form, as I used in my Mapper exercise. So I have to convert it by myself.

Here I create a class geoDegree to handle the conversion from degree, minute, second form to GeoPoint form.

Wednesday, January 13, 2010

Google announced SDK component for Android 2.1, so that developers can take advantage of the new features introduced in Android 2.1. Please read the Android 2.1 release notes for more details. You can download the Android 2.1 component through the SDK Manager.

In addition to the new SDK, a new USB driver that supports Nexus One is also available today through the SDK Manager. The USB driver page contains more information.

A new dialog, jpgdialog.xml, will be created if a JPG is clicked. It's used to show the Exif and photo of the clicked item. Please note here; onCreateDialog() is only called the very first time a dialog is opened. If we display Exif and photo inside onCreateDialog(), it will always show the first photo when it is created. So the actual code to display the Exif and photo should be placed inside onPrepareDialog().

Thursday, January 7, 2010

To display a JPG on ImageView, BitmapFactory.decodeFile() can be used.

But, in my experience, if I try to display a original photo in 10.0 million pixels by Nikon D80, the application will be stopped unexpectedly. So I have to use options.inSampleSize to reduce sample size.

In this exercise, the source (myJpgPath) of the JPG file is fixed, "/sdcard/DSC_3509.JPG". You have to modify to suit your own case.

Modify main.xml to have a TextView and ImageView to display files name and the photo.

Wednesday, January 6, 2010

The Android Scripting Environment (ASE) brings scripting languages to Android by allowing you to edit and execute scripts and interactive interpreters directly on the Android device. These scripts have access to many of the APIs available to full-fledged Android applications, but with a greatly simplified interface.

Saturday, January 2, 2010

The files information can be read using java.io.File, using the code:
File f = new File(dirPath);
File[] files = f.listFiles();

The name of the files/folders will be added in a ArrayList. If it's not the root, two more elements (the root and the parent) will be added in the front of the ArrayList.

Then, the ArrayList will be adapted to a ArrayAdapter, and also set to be displayed on screen.

In case any item is clicked; if it's a file, the name will be display in a dialog; if it's a directory (isDirectory) and can be read (canRead), will open the selected directory; if it's a directory and CANNOT be read, a message will be prompt.

Create a layout file /res/layout/row.xml, which is the layout of each row the the list.