Home

Archives

Entries for month: August 2008

Aug 31 New UM Sites Launch

Today we launched the new set of Universal Mind websites:

www.universalmind.com

and

blog.universalmind.com

 

Adam has gone into a great deal about the technical specifics of the new www.universalmind.com, so I will go into the technical specifics of blog.universalmind.com, since I wrote it (skin by Nahuel and Laura).

Previously, the UM Blog Aggregator had been an experiment in combining Hibernate and ColdFusion with Mach-II.  This, over time, proved to be a bit unstable, to say the least.  About a month ago, I took on the initiative to re-write the entire aggregator using Java.  Under the hood, we're still using Hibernate, but we're also using Spring and SpringMVC to manage the transactions and Hibernate sessions a bit better.  One thing you'll probably not notice, but is the coolest to me, is that the post search is now powered by Hibernate Search.  What does this mean?  Well, every time a new post is aggregated and persisted, Hibernate transparently indexes the object and makes it searchable.   It's powerful stuff.  

Anyway, I hope you enjoy the site and please give us some feedback.

Posted by: Andrew Powell

Categories: Apache , Java , ColdFusion , Flex , General , Adobe , Mach-II , Universal Mind , Hibernate 12 comments

Aug 30 Activating GPS in Sprint Mobile Broadband Card

I have had a Sprint Mobile Broadband card for a long time.  I love it.  It gets me online wherever I am and whenever I need it.  One thing i noticed about it when I bought it was that it has a GPS receiver in it.  Up until now, Sprint has not been very forthcoming in how to get to the GPS to use it.  Well, it turns out you need to use their Activation & Location Tool.  This app must be running if you want access to the serial port that provides the GPS data (as NMEA sentences).  While in this mode, you can also use the device as a GPS inside of Google Earth.  Sounds like this little piece of hardware would be a good candidate for Merapi......

Posted by: Andrew Powell

Categories: Merapi , Flex , General , Google , Adobe , Universal Mind , Air 4 comments

Aug 28 RFID Enabled AIR Applications With Merapi

So, first there was GPS.  Then, there was Growl integration.  The next progression is to see what we can do with other hardware.  There is a great site called Phidgets that contains a bunch of different input devices and controllers that you can hook up to your computer.  The best part of their selection is that they offer a NATIVE Java API.  So leveraging this API, we can use Merapi to broadcast RFID events into AIR.  Pretty cool stuff, if I do say so myself.  This screencast is just demo of watching for events when a RFID tag enters the sensor area and exits the sensor area, but it conveys the general point.  Enjoy and, as always, comments are welcome!

Posted by: Andrew Powell

Categories: Merapi , Java , Flex , General , Adobe , Universal Mind , Air 0 comments

Aug 26 Sending Growl Notifications With Flex Via AIR & Merapi

The other day, I showed you how to talk to a Garmin GPS with Flex (AIR), Java, and Merapi. Well, today I'm back to talk to you about how to leverage the Java APIs to the growl notification service via Merapi and Flex. Growl is a notification service for OS X that a lot of applications are starting to make use of these days. They have a SDK which includes Java libraries. Using Merapi, you can leverage these libraries and send true Growl notifications directly from AIR applications. Enjoy the screencast below and feel free to drop me a line in the comments if you have any questions.

Posted by: Andrew Powell

Categories: Merapi , Java , Flex , General , Adobe , Universal Mind , Air 2 comments

Aug 23 Live GPS Visualizations With AIR & Merapi

So, my co-worked Adam Flater started up the Merapi Project a while back and asked me to contribute. Up until now, the only thing I've had time to contribute was the name. Well, after seeing the cool stuff that he and Jordan were doing at 360|Flex, I decided it was time to step up to the plate, get my shit together, and produce my own kick-ass Merapi demo.

Anyone who has been following the blogs knows that we at UM are real big into GIS and data visualization. Don't believe me? Take a look at SpatialKey to see what we can do with it.

I recorded a screencast where I walk you through the setups and the code of the application:

Java Code:

package com.universalmind.merapi;
import gnu.io.CommPort;
import gnu.io.CommPortIdentifier;
import gnu.io.NoSuchPortException;
import gnu.io.PortInUseException;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.IOException;
import com.diddlebits.gpslib4j.GPS;
import com.diddlebits.gpslib4j.IDate;
import com.diddlebits.gpslib4j.IGPSlistener;
import com.diddlebits.gpslib4j.IPosition;
import com.diddlebits.gpslib4j.ITime;
import com.diddlebits.gpslib4j.Position;
import com.diddlebits.gpslib4j.PositionRadians;
import com.diddlebits.gpslib4j.Garmin.GarminGPS;
import merapi.Bridge;
import merapi.MerapiObject;
import merapi.messages.Message;
public class GPSReader extends MerapiObject implements IGPSlistener{
   GPS gps;      
   Position position = null;
   IPosition current = null;
   BufferedInputStream input;
   BufferedOutputStream output;
   
   public Bridge bridge;
   
   public static void main( String[] args )
   {
      
      new GPSReader();
   }
   
   public GPSReader()
   {
      super();
      
      bridge = Bridge.getInstance();
      
      CommPort port;
      
      try {
         port = CommPortIdentifier.getPortIdentifier("/dev/tty.USA19H1d1P1.1").open("GPSReader", 3000);
      } catch (NoSuchPortException e) {
         System.out.println("/dev/tty.USA19H1d1P1.1 not found!");
         return;
      } catch (PortInUseException e) {
         System.out.println("Port already in use by " + e.currentOwner);
         return;
      }
      
      try {
         input = new BufferedInputStream(port.getInputStream());
         output = new BufferedOutputStream(port.getOutputStream());         
      } catch (IOException e) {
         System.out.println("Error opening /dev/tty.USA19H1d1P1.1");
         return;
      }      
            
      gps = new GarminGPS(input, output);
      gps.setAutoTransmit(true);
      gps.addGPSlistener(this);
      
   }
   
public double getLat() {return __lat;}
   public void setLat(double lat) {
      this.__lat = lat;
   }
   public double getLon() {return __lon;}
   public void setLon(double lon) {
      this.__lon = lon;
   }
   public String getTime() {return __time;}
   public void setTime(String time) {
      this.__time = time;
   }
   public String getDate() {return __date;}
   public void setDate(String date) {
      this.__date = date;
   }
   
   public void dateReceived(IDate d) {
      String dateString = d.getMonth() + "/" + d.getDay() + "/" + d.getYear();
      System.out.println(dateString);
      this.setDate(dateString);
   }
   public void positionReceived(IPosition pos) {
      current = pos;
      this.setLat(toDecimalDegrees(current.getLatitude()));
      this.setLon(toDecimalDegrees(current.getLongitude()));
      Message message = new Message();
      GPSPoint point = new GPSPoint();
      point.lat = this.getLat();
      point.lon = this.getLon();
      point.date = this.getDate();
      point.time = this.getTime();
      message.setData(point);
      try {
         bridge.sendMessage(message);
      } catch (Exception e) {
         
         System.out.println(e.getMessage());
      }
      
   }
   public void timeReceived(ITime t) {
      String timeString = t.getHours() + ":" + t.getMinutes() + ":" + t.getSeconds();
      this.setTime(timeString);
      System.out.println(timeString);
   }
   
   private double toDecimalDegrees(PositionRadians rads){
      return Math.toDegrees(rads.getRadians());
   }
   
   private double __lat = 0;
private double __lon = 0;
private String __time = "";
private String   __date = "";
}

Posted by: Andrew Powell

Categories: Merapi , MapQuest , Java , Flex , General , Adobe , Universal Mind , MapMyPix , Air 5 comments