Embedded Systems

Building an Automotive Dashboard on Android

Setting up the code for the second screen is relatively straightforward. Note that I opted to capture a map for the whole Midwest rather than maps based on my GPS. I opted for approach. Since I rarely drive more than 100 miles away from my home, submitting map coordinates to get the same data within a 500 mile radius would unnecessarily slow my query since the GPS coordinates would first need to be acquired, then a geospatial comparison of which coordinates matched the appropriate weather map would have to be calculated and submitted. If I were regularly traveling cross-country in my car or wanted to share this app on the Asteroid Market, then the inclusion of this routine would make more sense. So rather than spend the extra processing power (not to mention the time it would take to code and debug the routine), I went for the lazy approach of grabbing the map as noted in the code here:

I quickly tested the application in the Android emulator. By the way, one of the changes that was made in the recent Android ADK is that Google no longer supports skinning Android emulators. According to Xavier Ducrohet, Android SDK Tech Lead at Google, he said in this post that "We are kind of going away from custom skins. Generally they aren't that useful." While it makes sense why Google removed this eye candy, its generic skin fails to put you in a mindset of developing for a specific targeted device like the Asteroid Smart. That said, it works just as well even without the graphic skin that Parrot created for the AVD before Google put the kibosh on custom virtual device skins.

Up and Running

Deploying the compiled APK to the Asteroid Smart was a simple affair. I copied the APK to an SD card, placed the card in Asteroid Smart's SD card slot, pulled up the Install Applications from SD card screen and installed the program without incident. Because my program polls the GPS and requires network access, these permissions came up on screen during the installation process, asking me to accept and continue.

With the application installed, I found its icon (actually two icons, one for the main program and one for the Weather Screen intent) in the Applications folder. With a network and GPS connection verified, loading up the application only took a second for it to capture the GPS readings and submit them to the Dark Sky web service.

I then selected the Weather Map option from the program's menu and it up popped the doppler radar map for the area. Nice. I exited the application and launched just the Weather Map app (thanks to the fact that I registered this screen earlier as an Intent) and the data displayed as expected.

Figure 4: The Weather Map screen displayed on the Asteroid Smart.

Lessons Learned

The most important lesson I learned from my experience portent applications to the Asteroid is to do away with menus. Even though Asteroid supports them, the touch targets for the menu icon and the menu items themselves are too small to accurately select while driving. A redesign of the application is in the works that will feature a large weather map icon in the upper right corner.

Along with replacing menu choices with on-screen icons is the need to feature the most important information on the screen at once instead of forcing drivers to scroll through a list view or read several lines of data. So rather than listing out the temperature, current and forecasted weather conditions, my redesign will highlight the current temperature in a dedicated area with a large font, and the next hour forecast in a smaller but still easily readable font size. The screen will also feature an icon next to the weather map icon for more forecast details. Selecting the button will display another screen as notably designed to allow for maximum information transfer to the driver shooting a quick glance at the screen.

I intend to continue to refine the application to make it as driver friendly and non-obtrusive as possible while still conveying the pertinent details in the split-second it takes to glance at the display. And who knows, if it gets really well polished, I may even submit it for considering via Parrot's Asteroid app store validation process.

Conclusion

While the Android Smart market is rather small at the moment, the potential for Parrot's first-mover advantage in this dedicated Android-based in-car computing market is huge. The Asteroid Smart is a major step forward compared to Parrot's initial Asteroid entry, and it final brings into focus a dream that Parrot and car computing enthusiasts like myself have been wishing to come true for decades.

If you are an Android developer who spends a good deal of time in your car commuting and you want to get in on a rapidly expanding market for your Android coding skills, I highly recommend the the Asteroid Smart as a great place to start.

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task.
However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Video

This month's Dr. Dobb's Journal

This month,
Dr. Dobb's Journal is devoted to mobile programming. We introduce you to Apple's new Swift programming language, discuss the perils of being the third-most-popular mobile platform, revisit SQLite on Android
, and much more!