开发者

Android Getspeed using maps

开发者 https://www.devze.com 2023-02-08 01:16 出处:网络
i am implementing getspeed to get speed of the device while moving in phone.why getSpeed() always return 0 on android ..?..i am using gps to get 开发者_如何学运维coordinates.

i am implementing getspeed to get speed of the device while moving in phone.why getSpeed() always return 0 on android ..?..i am using gps to get 开发者_如何学运维coordinates.

if(location.hasSpeed() == true)
{
    Toast.makeText(ProxAlertActivity.this, "Speed:"+ location.getSpeed(), Toast.LENGTH_LONG).show();
}


How fast are you moving? Bear in mind that the precission of the GPS units embedded in mobile phones can be quite poor, specially in urban areas with tall buildings surrounding you. Have you tried testing this while driving a car or in a bus?

Also remember that the GPS unit may take up to several minutes to detect enough satellites to deliver accurate position and speed information.

0

精彩评论

暂无评论...
验证码 换一张
取 消