Play Services에 액세스 할 수 있다면 Recognizing the User's Current Activity을 살펴보십시오.
그렇지 않으면 다음과 같이 할 수 있습니다. GPS 신호가 동일한 위치에 있어도 달라질 수 있으므로 새 위치와 이전 위치를 비교할 수 없습니다. 난 당신이 플레이 서비스를 위해 제공되는 새로운 활동 인식 기능을 사용하여, 사용자가 "여전히"는 것을 확인할 수 있습니다 다음과 같은 코드
double venueLat =latitude // Last known lat
double venueLng = longitude // Last known lng
double latDistance = Math.toRadians(userLat - venueLat);
double lngDistance = Math.toRadians(userLng - venueLng);
double a = (Math.sin(latDistance/2) * Math.sin(latDistance/2)) +
(Math.cos(Math.toRadians(userLat))) *
(Math.cos(Math.toRadians(venueLat))) *
(Math.sin(lngDistance/2)) *
(Math.sin(lngDistance/2));
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
double dist = 6371 * c;
if (dist<0.01){ (in km, you can use 0.1 for metres etc.)
/* If it's within 10m, we assume we're not moving */
}
location.getSpeed가 원하는 것을 수행하지 못합니까? 또는 설명서를 읽지 않았습니까? – njzk2