336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
package com.example.jsyproject;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationManager;
public class MyLocation {
static Criteria criteria;
public static double[] getMyLocation(Context context) {
double[] result = null;
if (criteria == null) {
criteria = new Criteria();
criteria.setAccuracy(Criteria.ACCURACY_COARSE); // 정확도
criteria.setAltitudeRequired(false); // 고도
criteria.setBearingRequired(false); // ..
criteria.setSpeedRequired(false); // 속도
}
LocationManager locationManager;
locationManager = (LocationManager) context
.getSystemService(Context.LOCATION_SERVICE);
// true=현재 이용가능한 공급자 제한
String provider = locationManager.getBestProvider(criteria, true);// "gps";
if (provider == null)
provider = "network";
Location location = locationManager.getLastKnownLocation(provider);
if (location == null) {
} else {
result = new double[] {
location.getLatitude(), location.getLongitude()
};
}
return result;
}
}
'Programming > Android' 카테고리의 다른 글
| Intent 정리 (0) | 2013.05.09 |
|---|---|
| 파일 이름 일괄 변경 DarkNamer (0) | 2013.05.05 |
| Android Battery Monitor (0) | 2013.04.29 |
| Android google Map v2 (2) | 2013.04.27 |
| 안드로이드 APK 추출하기 (0) | 2013.04.25 |

