public String[] getPosition(){
LocationProvider lp=null;
Location lck =null;
try {
lp = LocationProvider.getInstance(null);
} catch (LocationException ex) {
ex.printStackTrace();
}
try {
lck = lp.getLocation(10);
} catch (InterruptedException ex) {
ex.printStackTrace();
} catch (LocationException ex) {
ex.printStackTrace();
}
String res[] = new String[5];
try{
Coordinates cd = lck.getQualifiedCoordinates();
res[0] = "Alt:"+cd.getAltitude()+"";
res[1] = "Lat:"+cd.getLatitude()+"";
res[2] = "Lon:"+cd.getLongitude()+"";
res[3] = "Course:"+lck.getCourse()+"";
res[4] = "Speed:"+lck.getSpeed()+"";
}catch(Exception e){
e.printStackTrace();
}
return res;
}