I have a issue with my java code. i asked the same question yesterday. I got answer but sorry it was my fault. My question is not clear.
I have code looks like this:
Additions to Thierry-Dimitri Roys response.
StringBuilder sb = new StringBuilder();
ProximityTarget prox;
float latitude;
float longitude;
float radius;
//Use for-each if you process all elements
for(Target target : geo.getTargets()){
//Use literal string first to avoid NullPointerException
if("ProximityTarget".equalsIgnoreCase(target.getTargetType())){
prox = (ProximityTarget)geo.getTargets(i);
latitude = prox.getGeoPoint().getLatitudeInMicroDegrees());
longitude = prox.getGeoPoint().getLongitudeInMicroDegrees());
radius = prox.getRadiusDistanceUnits();
//Checking sb every loop is not a good practice.
//Instead try removing first delimeter after for-loop
sb.append("|circle:" + longitude + ":" + latitude + ":" + radius);
}
}
//AFAIK StringBuilder has no isEmpty Method.
//So use length method
if (sb.length() > 0){
sb.deleteCharAt(0);
}
String result = sb.toString();