- Jérôme Nègre's piece of web -

AUG 31 2012 OpenStreetMap and Android

OSM logo

This summer, I went on vacation to a place that was not covered by OpenStreetMap, so I became a small OpenStreetMap contributer and mapped the surroundings. Here's the list of software that I used on my Android devices.

To gather GPS data, I used OSM Tracker for Android, available both in Google Play and via F-Droid. It's a nice GPS tracker with fast Points of Interest (POI) placement shortcuts. It should be able to upload traces directly to OSM, but this functionality always crashed with me; uploading the generated traces (.gpx) with the website worked once I renamed the files to remove non-ASCII characters.

To edit the map, I used Vespucci, which is also available both in Google Play and via F-Droid. It's fine for relative small edits, but for larger one you'd better use the Flash-based Potlatch 2. Another useful application to edit details such as the name of roads or POIs is OSMapTuner (see update), available in Google Play.

OpenFixMap (in Google Play) was very helpful to flag errors on the map. You'll have to use an editor to fix them.

A more comprehensive list can be found on OpenStreetMap's wiki: Android software supporting OpenStreetMap. Happy hacking mapping!

Update: I've just found another editor for POIs, Mapzen POI Collector. It can add POIs and has a much nicer user interface. However, it is limited to the most common types of POI, so if you have very special needs, it's not for you.

DEC 23 2011 Deploying to a maven repository via SCP with Gradle

Deploying your artifacts to a remote Maven repository with Gradle is possible, but the official documentation is rather thin at the time of this writing. Worse, it tells you to use a version of wagon-ssh that ignores the provided password and prompt for it at the command line (use gradle -i to see its message).

So, without further ado, here is a build.gradle that uploads its artifact via scp with a password. It has been tested with Gradle 1.0-milestone-6.

apply plugin: 'java'
apply plugin: 'maven'

configurations {

repositories {

dependencies {
    //the one and only version that works
    deployerJars 'org.apache.maven.wagon:wagon-ssh:1.0-alpha-3'

uploadArchives {
    repositories.mavenDeployer {
        configuration = configurations.deployerJars
        uniqueVersion = false
        String username = 'me'
        String password = 'secret'
        repository(url: 'scp://repos.mycompany.com/releases') {
            authentication(userName: username, password: password)
        snapshotRepository(url: 'scp://repos.mycompany.com/snapshots') {
            authentication(userName: username, password: password)


Of course, in a real world scenario, it would be wiser to get the username and password from your gradle.properties or any other non-public file.

SEP 21 2011 Book review: "Building and Testing with Gradle"

Gradle is a very flexible and powerful build tool, allowing an extremely concise build file for conventional projects and letting you do whatever crazy thing your project requires using a Groovy DSL. I've been following its development for the last two years, and I introduced it to replace a legacy Ant based build system at my work about a year ago.


As far as I know, Building and Testing with Gradle, written by Tim Berglund and Matthew McCullough and published by O'Reilly, is the first book published on this topic.

The first chapter will guide you through the installation process and the use of the Gradle from the command line. I'm not sure someone willing to use Gradle needs that kind of information. It will also show you the shorter build file possible for a Java project, containing only 18 non-whitespace characters: compare this with Maven...

The second chapter is were the serious stuff begins. It presents the basic unit of Gradle build files: tasks. The two lifecycle phases, configuration and execution, are explained. You'll also learn how to use their rich API and how to simply write your own tasks. If you're used to the complexity of Maven, be prepared for a shock as this is dead simple and way conciser.

The third chapter shows how Gradle can leverage your existing Ant files and custom tasks. This particularity of Gradle allows a step-by-step migration from Ant.

The fourth chapter compares Maven and Gradle. Gradle takes the best ideas from Maven (and others): convention over configuration, consistently named artifacts and a solid dependency management with the same central repositories. It drops what makes Maven so painful to use: tons of XML, a rigid lifecycle and more generally its lack of flexibility.

The fifth chapter is about testing. The integration of JUnit, TestNG, Spock, Geb and EasyB will be rapidly shown.

The sixth and last chapter is focused on multiproject (or multimodule) builds. Once again, the tremendous flexibility of Gradle makes it bend to your needs rather than imposing its standards on you.

This is a short book with fewer than a hundred pages, read in a couple of hours, and full of code samples. It is an introduction to Gradle, not a complete reference guide: it will show you the power and the simplicity of Gradle, and - I hope - will convince you to give Gradle a try.

JUL 31 2011 Using the Brother HL-2250DN laser printer on Ubuntu Linux

The Brother HL-2250DN is a laser printer with both a USB and an Ethernet interface. It understands PCL6, so I knew I could use it with my Ubuntu 10.10 box without too much troubles.

Here's how to configure your computer to enjoy the Ethernet interface. One doesn't buy a network printer to use USB, right?

First, one need to get the IP address of the printer. You could get it from your router, or you may just ask the printer. To print the settings of your printer, do the following:

  1. Switch on the printer;
  2. Wait till the printer is ready;
  3. Press "Go" three times in less than 2 seconds.

The IP address will be on the third page.

Now, on your Ubuntu box:

  1. Go to System / Administration / Printing;
  2. Click on the "Add" button;
  3. Select "LPD/LPR Host or Printer" on the left;
  4. On the right, enter the printer's IP address;
  5. The name of the queue is "PCL_P1";
  6. When asked for a driver, pick "Generic PCL 6/PCL XL Printer - CUPS+Gutenprint v5.2.6 Simplified".

And voilà!

Spelling or grammatical mistake? Let me know, mail me at [webmaster at jnegre dot org], thanks!
Last modified: May. 28, 2013 at 17:47:49 CEST
Valid XHTML 1.0!