我想在不使用谷歌地图api的情况下从当前位置获取附近的地方。是可能的,我怎么做?我写了以下代码:
private float longitude[] = new float[2];
private float latitude[] = new float[2];
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
latitude[0] = Float.parseFloat("37.79287000");
longitude[0] = Float.parseFloat("26.70519000");
latitude[1]=Float.parseFloat("40.65447000");
longitude[1] = Float.parseFloat("22.95335000");
for (int number = 0; number < 2; number++)
{
Location loc = null;
Location.distanceBetween(loc.getLatitude(), loc.getLongitude(), latitude[],longitude[]);
}
}
}