使用WiFi获取当前位置? [英] Get current location using wifi?

查看:294
本文介绍了使用WiFi获取当前位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何可以得到使用WiFi的当前位置?
在我使用GPS的项目,我可以得到当前的位置...
如何使用网络服务在android系统?

How can i get current location using WiFi? In my project using gps I can get current location ... How can I use network service in android?

LocationManager mlocManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
LocationListener currentlocation = new CurrentLocation();
        mlocManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0,
                currentlocation);

不过,我想当前位置的WiFi?
谁能帮我获取当前位置使用WiFi?

But I want current location WiFi? Can anyone help me for getting current location using WiFi?

推荐答案

尝试使用的 NETWORK_PROVIDER

请注意,你将不得不通过增加修改你的Andr​​oidManifest.xml还有:

Please note, that you will have to amend your AndroidManifest.xml as well by adding:

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

这篇关于使用WiFi获取当前位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆