Monday, April 21, 2014

A simple Chrome Web App for creating animated GIF files

Recently, it seems animated GIFs have been making a come back and used on social networks like Google+. I thought of making a simple Chrome Web App for creating the animated GIF files (using only Javascript, HTML5 and the gif.js library) without having to upload to a server for processing, i.e. the processing takes place within the web browser only. The resultant WebApp is available here on http://dominoc925-pages.appspot.com/webapp/gifanim/default.html.


Using the WebApp is easy. The following steps show how to create an animated GIF with the default settings.

  1. Simply drag and drop the image frames into the box provided. Or click the Add Image button.

    The Open dialog box appears.

  2. Select one or more image files. Click Open.

    The thumbnails of the selected files appear in the box.

  3. Click Generate GIF.

    The animated GIF file is created.

  4. To save the animated GIF file, mouse right click on the animation. Select Save Image As.



    The Save As dialog appears.
  5. Type in a file name. Click Save.

    The animated GIF file is saved.
Delete or change the order of the image frames
  1. If you want to change the order of the images, simply click on the image thumbnail.

    The Move previous, delete, and Move next icons appear below the thumbnail.

  2. Click Move previous to move the selected image before the previous image frame.
  3. Click Move next to move the selected image after the next image frame.
  4. Click Delete to delete the selected image.
Changing the default settings
  1. If you want to change the default settings, click on Settings on the right pane.


  2. In the Quality field, choose another value.
  3. In the Animation speed field, choose another value.
  4. In the Repeat field, choose another value.
  5. In the Canvas size field, choose another value.
  6. Click Generate GIF to see the effects. 

Monday, April 14, 2014

Create features using precision key-ins in QGIS

Given some MH370 satellite imagery debris coordinates, I wanted to enter them in QGIS to see the precise locations on a map; but I could not find a precision key-in function. That is until I found out that there is a plug-in - NumericalDigitize but it must be installed from the Plug-in dialog.


If the plug-in is installed, then the highlighted icon is available in the Digitize tool bar.


Using NumericalDigitize to precisely enter feature coordinates is easy, as shown below.

  1. In QGIS, create a new layer, or load in a new layer, e.g. pointlayer.shp.
  2. Toggle on Editing.


  3. Click on the NumericalDigitize icon.

    The Add numerical feature dialog box appears.

  4. Optional. Toggle on the appropriate coordinate CRS, e.g. in the CRS of the Project.
  5. In the X field, type in a coordinate value, e.g. 90.3.
  6. In the Y field, type in a coordinate value, e.g. -44.5.


  7. Repeat steps 5 and 6 for more coordinates.
  8. Click OK.

    The feature(s) are created at the precise coordinates.


Monday, April 7, 2014

Enable the Nexus 7 to be recognized by the Android Development Toolkit ADT

After connecting a Nexus 7 running stock Android Jelly Bean 4.2.2 to a Windows 7 computer, I assumed that the Android Development Toolkit's ADB utility would be able to detect the connected Nexus 7 device. But it wasn't so. I learned later that the Developer's Options on the Nexus 7 is not enabled by default. It needs to be exposed first.

The following steps show how to expose the Developer's Options.

  1. On the Nexus 7, open up the Settings screen. Expand About Tablet.

    Information about the tablet appears.
  2. Touch the Build Number several times.

    The message "Congratulations, you are a developer" or something similar appear.
  3. Close and reopen the Settings screen.

    The setting {} Developer options should be displayed.
  4. Touch the Developer options.
  5. Toggle on USB debugging.

    The Nexus 7 should be recognized by the ADB.

Monday, March 31, 2014

Identifying digital elevation model files with erroneous elevations in batch

A DEM file
Recently I had to identify ESRI ArcGrid ASCII files of digital elevation models with very low elevation values (below zero). If I had one or two files, then I could easily open up the file in Global Mapper or Saga GIS. But there were several hundred DEMs, which made that impractical. Luckily the free open source software GDAL has a utility gdalinfo that can generate statistics about a DEM in batch. The following example shows how to use gdalinfo to look for extreme low (or high) spikes in elevation.




  1. Open up a Windows Command Prompt.
  2. Type in the following:

    C:> gdalinfo -stats inputDEM.asc > output.txt

    Note: to append to an output file, use double ">" as below.

    C:> gdalinfo -stats inputDEM.asc >> output.txt



    Note II: For hundreds of files, simply put these commands into a batch script.
  3. Open up the output file e.g. output.txt in a text editor. Find the statistical values - minimum, maximum that are above or below the valid elevation ranges to identify the DEM files with erroneous values.

Monday, March 24, 2014

Make copies of Android apps already installed on devices

I was curious whether it was possible to copy out from mobile phones or tablets the Android apps I installed from the Google Play store. It didn't long to figure out how to do it. There are a lot of apps that can do the job including a popular file manager app: ES File Explorer which can be used to easily select the apps and either back up the Android APK file(s) to an SD card, shared or sent out. If you have the ES File Explorer app installed on the device, simply do the following to copy out the app(s).

  1. Launch the ES File Explorer app. Touch the top left blue icon as shown below.

    A menu slides from the left.

  2. Touch App Manager.

    A grid of app icons appear.

  3. Long press one or more app icons.

    The app(s) are selected.

  4. Touch one of the commands at the bottom, e.g. Backup to copy the APK's to the SD card, Share to share out to Dropbox, Google Drive, etc.
  5. If Backup was selected, then the APK's will be copied out to the folder /sdcard/backup/apps/.

    The Android apps APK files are extracted out.

Monday, March 17, 2014

Android App for monitoring 911 call incidents in Seattle, Washington

With this Android app, users can monitor the City of Seattle's Fire Department's real time 911 dispatches (which is updated every 5 minutes), the Police Department's 911 Dispatch Incident responses (only non-confidential and updated every 4 hours) and Report Incidents (updated within 6 to 12 hours). The incidents can be viewed as a text list or on a map as marker icons or as a heat map. Examples of incidents include burglary, accident, fire, assault, drugs, death, and many more. Incident details can be viewed by touching an item on the list or a marker icon on the map display. A function is available to easily filter away unwanted incidents from the list or map by text. The app allows the user to send the location  to Google Maps and/or Street View for better visualization of the 911 call incident environment.

Upon launching the app, the list of incidents will be downloaded and displayed with associated icons as shown below.

The list of incidents can be filtered by using the Filter command, which is activated by selecting the Filter icon on the Action Bar or menu item. This will toggle the display of the filter text entry field. As you type in any text e.g. traffic, the incident list is dynamically updated.


To view all the incidents on a map, simply select the Map option item in the Action Bar menu. The filter (if any) remains in effect util it is cleared. Touching any incident icon will pop up a snippet of information about the incident. Touching the snippet will display the incident details.


Instead of visualizing the incidents as marker icons, choosing the Heat map option item in the Action Bar menu will render the incidents as a heat map, as shown below. To display as marker icons again, just choose the Markers option item in the Action Bar menu.


Long pressing any item in the incident list will pop up a menu, as shown below, where the selected incident can be shared, located on a map, or sent to the Google Maps or Street View app.


To refresh the call incidents or select a different incident feed, touch the Refresh option item in the Action Bar menu.
 
The app can be downloaded from Google Play.

Android app on Google Play

Monday, March 10, 2014

Handling the Android compilation error "Unable to execute dex: Multiple dex files define" in Eclipse

I have spent a lot of time trying to get an Android project using the Google Play Services and the Google Maps Android Utility libraries to compile successfully. A typical error message is shown in the screenshot below.

Eclipse was complaining about multiple dex files; eventually I found out that I was exporting out multiple jar files with the same classes and I had to toggle off the duplicate jar files in Eclipse. The following steps ensure that my project could compile successfully with the two libraries.

Add the Google Play Services and Google Maps Android Utility libraries

  1. In Eclipse, select the Android project in the Package Explorer. Right click and choose Properties.

    The Properties for xxx project appears.
  2. Choose Android. Click Add.

    The Project Selection dialog appears.

  3. Choose Google Play Services library. Click OK.

    The library is added.
  4. Repeat steps 2 and 3 to add the Google Maps Android Utility library.

    The library is added.
Check for Duplicate JARs
  1. Click Java Build Path.

    The Java Build Path page appears.
  2. Click the Libraries tab.


  3. In the JARS and class folders tree, expand the top level nodes.
  4. Make a note of any duplicate JAR files.

    Note: In this example, the android-support-v4.jar is duplicated. There is a copy in my Android project and there is another copy in the Google Maps Android Utility library.

  5. Click the Order and Export tab.


  6. Toggle off one the items that contain the duplicate JAR files e.g. the android-support-v4.jar file in my Android project.
  7. Click OK.

    The Properties for XXXX project is closed.

  8. If necessary, select Project | Clean to clean up the previous compilation temporary files and compile/run the project again.

    The project should now compile successfully.

Related Posts with Thumbnails