In my last post I mentioned that I was unable to retrieve the Bluetooth address of my GPS receiver, this wasn't entirely accurate. I stumbled across Benhui's Bluelet library that simplies Bluetooth device/service discovery. This worked like a charm but the problem turned out to be making a call for the first service record:
ServiceRecord r = bluelet.getFirstDiscoveredService();
kept returning null. Therefore I was unable to retrieve the connection URL for connecting to the device using the serial port profile. So what I had to do was build the URL manually from the device's Bluetooth address. So in the Bluelet code I created a variable that stores the device address and was able to access it my MIDlet using:
url = "btspp://" + bluelet.btaddr + ":1";
Notice the connection string built around the device address. I've successfully connected to the device and now it's time to write the parser to decode the NMEA 0183 sentences.
I've been working hard to move my BlueGPS application to J2ME. This will enable the application to run on millions of more devices than it's current Symbian implementation. The key will be getting past the technical hurdle that I'm currently faced with. I'm having problems with programmatically retrieving the device address of my Bluetooth receiver. Whenever I make the appropriate API call it continues to return null. I've read that some people have hardcoded the device address to get it to connect properly. In my opinion this doesn't scale so I'm looking to get device discovery working.
If worse comes to worse I'll have some sort of object that stores common Bluetooth device addresses. This will be something that needs to be updated continuously, but it will be much easier to maintain if the codebase in written in Java. This is just my personal preference here. I'm optimistic that I'll get the device discovery working in my spare time over the next week. Once I do this will be worked into photo uploading where you can upload a photo and GPS location to be displayed on a Google map. It should be pretty tight and I'm excited about the potential it has. Stay tuned!
I've been wanting to upload photos to my blog from my Nokia 6620. I first decided to tackle this using Symbian but realized that it would take me ten times longer than writing it using J2ME. Don't get me wrong, I love Symbian and the power it brings to development, but it's extremely complicated. I'm past the days of taking the most complicated approach to solve a problem. Luckily I found that the mobile media API is supported on my device. This was exciting news since I figured I could get a proof of concept working in a matter of nights. This past weekend I was able to get the device code to capture the photo and send it to my server via HTTP post. The next step was to then write a Java servlet to handle the input stream and write the image to disk.
I was able to bang out the servlet in a matter of a couple hours and was pretty pumped about this. It turned out that the servlet or device (not exactly sure) was unable to handle the stream property. So after some digging around I learned that I might need to Base64 encode the image before posting to the server and then let the servlet decode it. This was a mind numbing process that I finally got to work, definitely LONG overdue.
So I'm now able to take photos from anywhere and upload them to the server over my GPRS connection (I'm probably Cingular's #1 customer right now). The next piece was getting them integrated with my blog. On the blog index page you'll see the most recent photo taken with my device. I'm only sending them up at 320x240 res, but plan on publishing the app and making this user configurable. The photo is displayed via a simple ajax call since it integrates nicely with my blog. I'll be working on the Ruby on Rails piece to create a nice photo album to support the uploaded photos.
If you've read any of my previous posts you'll know that I'm literally all over the place. This is definitely the case but as I further my development and investigation of technologies I can see something start to formalize. Please stay tuned and I promise not to let you down!
One last note, I'll be working on getting my Bluetooth GPS integrated with the MoPhoto app so users will be able to upload photos as well as GPS coords. I think you know where I'm heading with this but I'll leave it up to your imagination. If you have any suggestions I would love to hear them.
If you've read anything about Ajax lately you've probably heard it's the next big thing. Everyone seems to interpret Ajax as this incredible framework for web development that should simplify our lives. The reality is there's no framework at all and it's simply a transport mechanism to send data to the server and back, all without a page refresh. It's all about the user experience here. Ajax enables developers to build applications that are extremely user-friendly and appear to behave similar to desktop applications. A good example of this is Google Maps.
Ajax has been around since 1998 and if you've done any Flash development you'll know that sending/loading data behind the scenes is old school. Flash gives us unlimited capabilities with LoadVariables, XML objects, Web Services, and Flash Remoting. All of these approaches enable developers to load data from a remote location without the need for a page refresh. This is HUGE because it minimizes the amount of data that is sent to and from the server and decreases the amount of time the user has to wait. As Ajax adoption grows I believe we'll start seeing some incredible UI components similar to what Flash offers. There's already some powerful technology becoming available in the server market and a great example is WebORB.
With all this being said I was blown away by the support for Ajax integrated into Ruby on Rails. It actually isolates the developer from having to write any low-level code such as dealing with XMLHTTPRequest directly. I'm fascinated by Ruby on Rails, but let me take a step back and give an example using ColdFusion. I've always loved ColdFusion because of the simplicity and it's where I started on this mad web journey back in '98!
This basic example demonstrates how to make a remote call to a .cfm that returns an IP address. The IP address is wrapped in a simple xml tag and returned to the client. The response looks like:
<result>127.0.0.1</result>
When the result handler receives the response it populates the text field with the client's ip address. This is all done asynchronously (can be made synchronous) which, in my opinion, improves the user experience. To sum it up this means the user does not have to wait for the response and can perform other operations while waiting. I encourage you to run the example and view the source to see how easy it is. Stay tuned for more Ajax adventures, but from an ROR perspective.
I spent a little time this evening updating my Google Maps app to support clicking on a location icon. I struggled with this a few weeks ago where clicking on an icon didn't do anything even though I had added the necessary code to display the info window. It turns out that I was missing one basic parameter:
infoWindowAnchor
This property requires a GPoint that tells it where to anchor the window in relation to the top left of the icon. So the code will ultimately look something like:
icon.infoWindowAnchor = new GPoint(5, 1);
So if you click on any of the icons on my Google Maps app then you should see a window display with the lat, lng, and date/time for that location. I'm working on adding support to display images uploaded from a mobile device or computer, which will hopefully tie into my Ruby on Rails app. Yes I'm highly optimistic I can get all this done within the next month, stay tuned!
I've been reading a great book called "Agile Web Development with Rails". I stumbled across Ruby on Rails a few weeks ago and was intrigued with all the hype. I come from a strong ColdFusion background with moderate experience working with JSP and PHP. ColdFusion has enabled me to rapidly prototype and develop applications in the past and has always been my weapon of choice.
ROR has enormous potential and provides a very object oriented framework that lends well to web development. Prior to ColdFusion CFCs everything was pretty much spaghetti code. CFCs enabled us to be more methodical in our approaches to web apps, but left us a bit short. ROR takes an MVC approach to web development. I've shunned the thought of MVC in web apps in the past, but believe it definitely has a place. I've often felt that MVC was an unnecessary complexity but ROR has proven me wrong. It provides a very clean approach and makes code maintenance and building new functionality a breeze.
I'll be posting more in the coming weeks and stay tuned for a public (possibly open source) ROR app that I'll be releasing in the near future. This is mainly an exercise to learn more about the technology as well as release a useful app into the community.
If you've ever used linux then this about sums it up:
http://mirror1.spikedhumor.com/1209/SwitchLinux.swf
My favorite line is when he mentions "patching your kernel" and throws up a nice salute. Despite this anecdotal Flash movie, Linux has become much more user friendly and if you decide to give it a go I would recommend Knoppix which runs from a CD. That way, you can try before you format or partition. Luckily we have a couple of solid alternatives to M$, although Vista looks very cool. I don't think it's going to be enough to sway me from the Tiger!
A good friend of mine emailed me early this week asking if my Golf Tips widget would run in Konfabulator. I was fairly optimistic that it would work with a few tweaks. I think he knew that if he planted the seed I would get around to porting it. So I got started this eve and made huge progress. I have to say that the Konfabulator dev environment is one of the easiest that I've worked with yet. They support all kinds of crazy JavaScript that lets you grab system information such as memory usage, battery level, cpu usage, etc. There's even a speak function that will do text-to-speech. This works like a champ on my Mac but haven't tried it on Win.
I'm posting a screen of the current working version which I plan on publishing here and the Konfabulator widget gallery this weekend. In my opinion, the user experience of Konfabulator blows the Mac OS X dashboard concept out of the water. It's even rumored that Mac stole the concept from Konfabulator which doesn't suprise me. Anyway, you can have certain widgets activated at all times that sit on top of your applications. On OS X you have to go to the Dashboard to view the widgets. There's a hack where you can select and hold a widget from the dock, hit F12, and actuallly drop it on your desktop. Yet this doesn't even come close to the Konfabulator experience. I could go on and on but you should download a copy (it's completely free) and use it. I'm currently running it on both my Mac and PC.
The most incredible thing about this whole "Dashboard" concept is that Konfabulator was recently purchased by Yahoo. Can you say three guys in a garage writing killer software?!? That's right.....THREE GUYS! I'm blown away by the quality of the product in terms of funtionality, easy of development, documentation, and gorgeous graphics. The CEO of Konfab, Arlo Rose, puts out some KILLER widgets. I'm not sure if he does the actual widget design himself, but there's some amazing talent coming from this team. So stay tuned for my Konfab Golf Tips widget and here's the preliminary screen:

Lately I've been doing a good amount of soul searching to find out what it is I really want to do in life. I won't go into detail about that here and promise to get back to it in a future post. It basically boils down to the fact that I need to be involved with technology. I have a huge passion for all things tech and that's why you've seen products such as BlueGPS, Daylite, and GolfTips from me. About the only thing these products have in common are the fact that they're somewhat tech related. While I continue to search for "the product" I like to fill the void with odds and ends.
With that being said I'd like to share my latest spare-time project: www.polkadachs.com. This concept was dreamed up by my wife and she truly has a creative talent for these types of projects. She's had every creative idea under the sun and I think she's found one that will keep her busy for years to come. I decided to build the site for her because it's been over a year since I've done any e-commerce work and I was up for the challenge. The most exciting part for me was doing the site design since I don't have many opportunities to do this kind of work anymore. Actually, this blog needs a serious facelift and maybe I'll make that my next project.
The key to the PolkaDachs site was keeping it simple and making the shopping experience as fun as possible. One product that enabled us to do this was a shopping cart system known as x-cart. A huge shout out to my buddy Brent Evans @ Holland Simpson for turning me on to this product. You would not believe the granularity you get when customizing the shopping cart and there are options for EVERYTHING. It's seriously one of the most affordable/functional shopping cart systems I've ever used. Let me also add that the out-of-the-box templates are butt ugly. So be sure to contact a true professional like Brent or myself to get you up and running ;) Customization of this system is definitely a lengthy process.
So please feel free to check it out and let me know what you think. Now that I've filled one void with this project I can get back to my next idea.....more on that later!