Bluetooth and GPS: Part 2 - Parsing GPS Data and Rendering a Map

By Bruce Hopkins

This article shows how easy it is to use the JSR-82 (Bluetooth) API to access the data from a Bluetooth-enabled GPS receiver, parse the data streams, and obtain the coordinates of current location. Additionally, you'll see how to formulate the HTTP request to access an external mapping service, use JSR-172 (XML Parsing and Web Services) API to parse the result, and make the final request to obtain the map image. Both JSR-82 and JSR-172 are included in the Java ME MSA standard.

Read the full article.

Also, see the Follow Up to this series, where Bruce Hopkins answers questions from readers of this series.

Comments:

Excellent Article.
I am working on a project that uses microcontroller populated with sensors like CO, temperature, etc, which will have a bluetooth included. Collected/read data will be sent periodicaly to my phone so that as i cycle around will be aware of the state of air quality in my immediate environment(including the route map). Could you advice how to go about it(me am stuck in).

Thanks

Posted by Abkul on February 27, 2009 at 06:25 PM PST #

Hey Abkul,

Thanks for the compliments. It sounds like you've taken on an exciting project. Since your embedded system does not have the JSR-82 API, then you to do the following:

1. Ensure that the the two Bluetooth systems are paired before you attempt any communication.

2. After pairing has been done, make your JSR-82 enabled phone to offer a SPP (serial port profile) service

3. Now, you're free to communicate from your embedded device to the mobile phone by writing directly to the serial port on the embedded device.

I hope this helps!

Bruce

Posted by Bruce Hopkins on February 28, 2009 at 06:53 AM PST #

Regarding your question about wearable interfaces for data collection: You may be interested in contacting Dr Joe Polastre of Sentilla on his recent talk at the M3DD, "TS-14: Effective Energy Management through Java." As the abstract states: "This session introduces the newest techniques, architecture, and APIs for analyzing energy, electricity, power, and efficiency directly at the point of consumption." You can view his slides by choosing that option next to his session description here:
https://developerdays.dev.java.net/nonav/sessions.html.

Posted by Christine Dorffi on March 02, 2009 at 03:37 AM PST #

Thanks for prompt and infromative explanation.

I am working on that option. Could you kindly shed some light on the
options without the serial cable connection(i.e where the phone
bluetooth and microcontroller based bluetooth communicate).

The whole agenda is to have a sort of wearable interaface (hardware
that is programmed and populated with sensors where individuals can
wear ), participate and/or be aware of the air quality in their
environments, through data collected through their handheld
devices.this will go along way in sensitizing communities on quality
of their environment.could you advice me type /where to by such
bluetooth or other sensors(Co, Sulphure dioxide, Ozone, temepearture
humidity, etc.) sorry for requesting all this..

Posted by Abkul on March 02, 2009 at 04:47 AM PST #

Abkul,

The following links below will take you sites where you can get Bluetooth chips for microcontrollers, and sensors for temperature, humidity, etc.

http://www.sparkfun.com/commerce/categories.php?c=23

http://www.phidgets.com/products.php?category=2

Posted by Bruce Hopkins on March 02, 2009 at 05:28 AM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Tips for developers who use Java technologies (Java SE, Java ME, JavaFX) for mobile and embedded devices.

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today