Category Archives: Android

Spring Semester Remarks

It’s hard to believe the semester is almost over.  It still feels like it’s just beginning.  If you want the quick version of my semester, “overwhelmed”.  For the long version, read on.

Before we left for last semester, we made a schedule for a release in early February.  So over winter break, I spent a great deal of time working on the UI for the Wine Agent.  While we tried our best to stay on schedule, unexpected complications pushed the project back.

As the semester started, I was quickly drawn away from UI to other aspects of the project, specifically the distributed reasoner.  I began investigating wireless Bluetooth communications.  While I had some initial early success, I ran into many obstacles.  One of the issues was with the phone’s firmware having deprecated Bluetooth functionality.  There is still a bug that I have yet to determine that’s preventing sending communication (I can establish a connected socket but it’s always closed when I try sending or receiving from it).

I believe it was somewhere during this period the article A Semantic Sommelier was eaten by the internet robots (and I’m just adding to it by linking to it now).  The article gives a general overview of the Wine Agent, but it was picked up, linked to, and reposted on several news sites, and hundreds of sites linked to those.  Actually, just today I classified 100 articles.

I was pulled away from Bluetooth to work on translating some of the server communication code.  This began my career in Objective C translation.  It started innocently enough with the CommDelegate classes.  But those classes required the OWL Classes, which was an incredible undertaking.  Translating the OWL Classes was like fighting the Hydra, every class I translated referenced two (or more) classes that needed to be translated.  I’m still working on this, but I hope I’m nearing the end.

Unfortunately for me, Objective C has a steep learning curve.  The syntax of Objective C did not seem intuitive to me.  The really challenging part was translating someone else’s (largely uncommented) code in an unfamiliar language to Java.  There obviously doesn’t exist a 1-1 mapping between Objective C and Java.  This hurdle was overcome with lots and lots of practice and guidance from Evan.

Somewhere in the middle of this translation madness, I got a chance to RDF encode restaurant menus.  This was one of the most interesting parts of this semester.  Every once and a while, Evan would send out an email  for odd jobs like this that needed to be done.

So why did I describe this semester as overwhelming?  Well that’s because there is just so much that needed to be done to catch up the Android Wine Agent to the iOS Wine Agent.  Philip and Yu were both dedicated to just the iOS version and Evan (understandably) has limited time to work on the Wine Agent, so has had to prioritize to work on the iOS version (not that he has ignored the Android version).  Even so, if this was the only thing I had to do this semester, it might not have been so bad but unfortunately this was coupled with what could possibly be described as my most demanding semester.

Overall, it has been a great semester.  I’d like to thank everyone at TWC for being so supportive and providing such a great research experience.


Leave a comment

Filed under Android, Tetherless World Constellation, Wine Agent

Status Update

So this past month, I’ve been continuing work on the Android Wine Agent.  Specifically, I’ve been working on Bluetooth communication between Android devices as part of the reasoner and translating the CommDelegate classes from the IOS version.

From the Android standpoint, Bluetooth is separated into two main parts, device detection and connection management.  The Android application must handle device discovery/detection because the Android Bluetooth API is closely linked to the application activity.  However, connection management is not so restrictive, so I’m working on incorporating this into the reasoning library we’re building.

I was able to create a quick test application that was capable finding devices, connecting to a device, and sending the bytes of  “Hello!” from one device to another.  This was a great start for a proof of concept but did not fit into the framework for building the reasoner library, because connection management was not separated enough from the application activity.  So I’ve been working on abstracting the Bluetooth connection management to fit into the framework of the reasoner.  In the process of adapting it to fit into this framework, I seem to have broken something.  Currently, device discovery, pairing devices, and creation of an RFCOMM channel are working, but when I go to read or write from the communication channel, the socket is always closed.

All the Wine Agent projects have started utilizing trac, which I feel is a huge step forward.  Our goal is to do ~1 trac item per week,  which is a manageable goal that ensures that progress continues to be made in all aspects of the Wine Agent.

Recently, I’ve been asked to translate the IOS classes that deal with server communication.  I have a previous blog post about my first experience with Objective C, but to reiterate, Objective C syntax was needlessly complicated and confusing (especially for method invocation), but after a couple of days and countless Google searches, I was able to translate almost all of the completely uncommented Comm Delegate classes.

As for next (this?) month, I plan to keep working on the trac items to continue moving the Android Wine Agent closer to a release.  I’m also going to work on making the Bluetooth communications work within the reasoner.

Leave a comment

Filed under Android, Tetherless World Constellation, Wine Agent

Bluetooth Update

So recently I discovered an issue with Android Bluetooth.  Android runs on many different phones from many different manufacturers and it’s up to the manufacturer to maintain the firmware for their hardware.  Not all phones have Bluetooth, which is fine since it is easy to detect if the phone is capable of Bluetooth communication.  The issue arises when the phone has a Bluetooth chip but the Bluetooth drivers are incomplete and do not implement all Bluetooth 2.0 features like in the HTC Desire.  For these phones, the unfinished Bluetooth implementations is satisfactory for communicating with a Bluetooth headset but not communicating over an RFCOMM channel with other devices.

Evan was able to direct me today to the custom firmware project CyanogenMod.  The firmware was very easy to install thanks to the program unrevoked.  CyanogenMod fixed the communication issue because the Bluetooth drivers are much better.

Now that the Nexus One and the HTC Desire can communicate via Bluetooth, I can begin testing and rewriting the Bluetooth communications for the remote reasoner.

Leave a comment

Filed under Android, Tetherless World Constellation, Wine Agent

Updating Fun

So I just spent the last hour updating to the newest version of the Android SDK and it didn’t go as smoothly as I had expected.

So with the update to the SDK, the Android Debug Bridge (adb) moved from /tools to /platform-tools.  The adb is necessary for such important things as installing and uninstalling packages onto the phone or virtual device so it’s a real issue when it disappears from Eclipse.  I tried to rectify this through the preferences, there was nothing I could do.  I tried restarting Eclipse and adb to no avail.  I tried including the /platform-tools in my PATH variable but sadly that did not help either.

Finally, I remembered that the plugin for Eclipse was a separate entity from the Android SDK.  I was able to update the Android Development Tools (ADT) plugin for Eclipse (after only 1 fatal error) which remedied the problem.

Leave a comment

Filed under Android


So after a brief discussion with the Wine Agent group, things are looking good.  It sounds like Evan has a lot of code he’ll be pushing soon so I can start integrating real data into the mock UI.  It also seems that the iPhone/iPad/iPod version also is fairing well.  And soon, we’ll be having weekly meetings, which I feel will benefit the project greatly.

The next big step will be the linking of devices in a local setting so that multiple users can be working on the same description, but receive personalized recommendations based on his or her individual preferences.

This page will soon be my new best friend.

Leave a comment

Filed under Android, Tetherless World Constellation, Wine Agent

Nexus One

So for the past few weeks, I’ve been working on and off between the holidays on laying out the basic framework for the recommendation UI for Wine Agent.  I’ve been trying to ensure I can display and pass all the data I need between intents.

But today, I made a 200 mile trip to pick up the Nexus One to develop on.  It took only a few easy steps to get it ready for development.  I’ve only just set it up and already I’ve noticed outstanding improvements to using the virtual device.  First and foremost, it’s fast.  I didn’t realize how truly slow the Android emulator was until I started using the phone.  The other important improvement with the phone is the screen.  Having the touch screen to develop on and seeing the application in the phone’s true resolution will help influence the design choices.

Leave a comment

Filed under Android, Tetherless World Constellation, Wine Agent

Semester Remarks

Reflecting back on the semester…

My semester with the TWC can really be broken up into three parts: getting up to speed,  the Talk Tracker, and the Wine Agent.

The first part of the semester was really all about getting accustomed to the Tetherless World Constellation, the technology, and research in general.  After getting past the sea of paperwork, I had to find my niche within the TWC.  As we all know, the TWC covers such a wide range of areas, so I was of course overwhelmed with the amount of projects and new technology that was thrown at me.  Eventually, an email looking for someone to develop the user interface for the Android Wine Agent caught my attention.

I began working with Evan, who kindly helped me start to make sense of it all.  He pointed me in the right direction to some useful readings such as the Mobile Wine Agent journal paper, RDF PrimerOWL guide, Ontology Development 101, and he also told me about the Android Development Website to get acquainted  with creating Android applications.

I spent the next few weeks setting up the Eclipse IDE, Android SDK, and the Android Development Toolkit (ADT) plugin for Eclipse and creating some sample projects to become accustomed to creating Android Applications.  These sample projects introduced me to the the Eclipse IDE (which I had never worked with before) and Android development principles such as Activities and Intents, the Android Manifest, Views, Google Maps APIs, Android Virtual Devices, debugging, and countless other concepts.

After experimenting with sample projects, I finally began attempting to recreate the Mobile Wine Agent.  I began by creating a tabbed structure similar to the iPhone/iPod touch version.  The first tab I began to pursue was the Restaurant tab.  The Restaurant feature of the Wine Agent entails a map with locations of restaurants with data available for those restaurants.  I implemented a Map View and I learned how to create interactive map markers from geological coordinates.  When a user clicks on one of these map markers, an HTTP query is made to get some data about the restaurant and it is shown in the dialog box.  This was implemented as a temporary test until actual data could be made available.

It was at this point when Evan introduced me to the Google barcode library zXing (pronounced “Zebra Crossing”).  The zXing library uses the Android’s camera to get barcode information.  The idea was to use this to scan the barcodes of bottles of wine to either get or add information about wine.  I was unable to compile the library and since it was not a priority, it’ll have to wait.  This is a feature that could be easily added later on and I look forward to working with this library more in the future.

The next step was to start exploring Social integration.  I first started with Facebook.  Facebook actually has an Android Facebook SDK which after obtaining the correct API keys I was able to utilize to login and post and request data.

It was at this point in the semester that I was presented with what seemed like a simple side project.  Evan and I began working on a new Android/iPhone application known as the Talk Tracker intended for the International Semantic Web Conference (ISWC).  The application’s purpose was to use the available Semantic data to aid in creating a schedule of events and to provide information about papers and events at the ISWC.  There were going to be three main components: a map of the building, a search for events (workshops, presentations, etc.), and a scheduling feature.

I first began to work on the map feature.  Initially, the feature was supposed show you where you were in the building and verify your room location.  We had a map of the building and the geological coordinates for the venue and the individual rooms (although the actual accuracy of the coordinates was not able to be tested beforehand).  I was able to get the GPS coordinates from the phone which was a good start.  I was initially hoping that I could overlay a picture of the venue onto the Map View, but unfortunately after many lost hours of trying, this was not possible.  Evan was able to find some open source code to interact with an image similar to the interaction style of the Map View.  Another unforeseen challenge was determining the bounds of the rooms.  The room coordinates were given as four points and the bounding box could easily become a bounding hourglass without the proper checking.

The next step I began working on was searching searching for Events.  SPARQL queries and asynchronous callbacks were used to retrieve the conference information.  There were two ways to search: by keyword or by a date range.  Searching by date range brought you to a tabbed view between Workshops and Conferences within that range.  Selecting a Workshop would present more information about that Workshop.  Selecting a conference would bring up a list of presentations.  Selecting a presentation would display the title, list of authors, abstract, and the list of keywords for that presentation.  Selecting the author would display more information about the author and selecting the keyword would do a search for other events that share that keyword.

Creating that interface was not easy.  As seen in a past blog post, there was an issue with passing objects (which had to implement Serializable) between intents.  Also, there were a few bugs in the SPARQL queries that were either causing fields to be missing or no results.

The scheduling feature was not even started due to a lack of time.  Ideally, the scheduling feature would keep track of the events the user would like to attend.

Since we only had ~2-3 weeks to develop it, the project was unfinished.  Although not complete, Talk Tracker was far from a failure and it has great potential to be adapted for future talks.  If nothing else, I gained a lot of experience and learned some useful concepts that will be utilized for the Mobile Wine Agent.  One of the planned features that was not implemented due to time constraints was a hybrid data service.  The hybrid data service would act the same but would incorporate caching.  A major issue at conferences is the lack of internet connectivity/bandwidth so trying to make queries to a database from a mobile device would be too slow to be useful.  Having a cached version would allow users to still be able to use the application without internet connectivity.

Research really should continue on this project.  Not only does this project make use of semantic technology, it’s also a practical tool (even if its just for internal use within the TWC).  Professors, faculty, and students in the TWC go to conferences often to present research throughout the year and an application to aid in creating a schedule of events would be very valuable for getting the most out of these conferences.

So after the conference, I began to resume my work on social integration into the Wine Agent by investigating Twitter.  I decided to use the java Twitter library Twitter4J because of its support for Android.  Twitter4J also requires an oAuth library as well, so I decided to use the recommended SignPost-Oauth library.  I am currently having some issues retrieving the access token but hopefully I can clear this issue up soon.

Recently, we’ve received some exciting news regarding the Mobile Wine Agent.  There’s a possibility that it will be gaining some national recognition in a few months with some of the wine enthusiast magazines.  Evan has assembled a team of students to make sure that the three versions (Android, iPad, and iPhone/iPod Touch) of the Mobile Wine Agent will be ready.  Over this Winter break and into the beginning of next semester, we will all be working hard to meet the deadlines we’ve established to get the Mobile Wine Agent.  Evan will be working on reasoning, Philip will be working on porting the iPhone/iPod Touch version to the iPad, Yu will be investigating GPS in the context of Semantic Web, and I will be working on creating the Android version of the application.

Overall, my first semester with the TWC Undergraduate lab has been excellent.  Patrick and John have done an amazing job keeping the lab organized and informed.  I’ve really learned a lot about Semantic technology over the past few months.  My biggest criticism (besides not having enough pizza meetings) is the lack of common projects between the undergrads.  I know Cameron and Philip worked on a few demos at the beginning of the semester, and now Phillip is part of the Wine Agent effort.  By not working on common problems, we’re losing a great opportunity to collaborate, talk through ideas, share backgrounds, learn from each other, and brainstorm.  Maybe next semester, there could be a collaborative semester long project that all the undergrads work on together, or hopefully more collaboration will just occur naturally when the Xbox arrives and the space becomes occupied with students.

I look forward to working on the Wine Agent for Android over the next few months.  I will do my best to keep this blog regularly updated on the status of the project.

If you’re reading this, it must mean you either had a lot of time or you skipped to the end…


Filed under Android, TalkTracker, Tetherless World Constellation, Wine Agent