public synchronized static Gson getGsonInstance() {
		if(gson == null) {
			GsonBuilder builder = new GsonBuilder();
			
			//needed to get proper sub type after deserialization
			builder.registerTypeAdapter(org.redpin.base.core.Fingerprint.class, new BaseFingerprintTypeAdapter());
			builder.registerTypeAdapter(org.redpin.base.core.Location.class, new BaseLocationTypeAdapter());
			builder.registerTypeAdapter(org.redpin.base.core.Map.class, new BaseMapTypeAdapter());
			builder.registerTypeAdapter(org.redpin.base.core.Measurement.class, new BaseMeasurementTypeAdapter());
			
			//needed in order to deserialize proper the measurement vectors
			builder.registerTypeAdapter(Measurement.class, new MeasurementTypeAdapter());
	
			//builder.setPrettyPrinting();
			gson = builder.create();

		}
		
		return gson;
	}