[OSM-dev] use API v6 with Eclipse

Stellan Lagerstrom lagerstrom at blindsight.com
Tue Feb 9 15:02:16 GMT 2010

kamélia BENCHEKROUN wrote:
> Hello
> I'm a student in a school engineering in France, and i have to develop
> a JAVA application connected to OpenstreetMap in order to get and edit
> information from the data base.
> I know that is possible with the API v 6 , but i don't know how to do
> it with "Eclipse".
> I'm really at the beginning of my way, and i don't know what to do.
> I need your help and if you have any advice or example to show me it
> will be great.
This is really two questions.

1. How to write Java programs with Eclipse.
Eclipse is a (very) general development tool. It makes it more
convenient to edit, build and test a Java application.
Any Java application. What the application does is totally up to you.
So, start by reading and following a beginners Eclipse tutorial; build
and run a "Hello world" app, then modify it.

2. How to write a Java program that talks to the OSM server (API).
Since the API uses HTTP, you'll need a HTTP client object.
So read about the java.net package, especially the HTTPUrlConnection class.
Build and play with an example application that fetches data via an HTTP
Read about XML parsing  (javax.xml.parsers package)
Look at JOSM source code. http://josm.openstreetmap.de/svn/trunk

You should at some point decide if you are going to use Java for normal
computers (Standard Edition) or Java for smartphones, etc. (Mobile
Edition, "J2ME")

Good luck!

More information about the dev mailing list