什么是代码来获取当前位置的经纬度在php.Later我必须使用这个经度值在谷歌地图中绘制标记。我怎样才能得到当前位置经纬度值在PHP中使用android
-3
A
回答
0
为此,您需要在php中创建一个web服务,该服务存储当前的纬度,设备的lng和 创建一个新的web服务,该纬度返回给android应用程序,您可以使用lat, lng在谷歌地图上显示标记...
+0
可以请你帮我解释一下代码吗? – Neeraja
0
create table to store lat,lng
id,lat,lng
than
create store.php file
code to store lat,lng in table in php
$lat= $_POST['lat'];
$lng=$_POST['lng'];
$sql="insert into location values('null','$lat','$lng')";
$result=mysql_query($sql);
if($result>0)
{
echo '1';
}else
{
echo '0';
}
call this file using url in android code
for example
54.123.54.195/myapp/store.php
now to fetch the lat,lng make an new file fetch.php
$sql="select * from location";
$result=mysql_query($sql);
while($row=mysql_fetch_array($result))
{
json_encode($row);
}
call the fetch.php same as above file in your android code
for example
54.123.54.195/myapp/fetch.php
you will get data as json and you can use in your code to show marker
+0
好的,先生,谢谢:) – Neeraja
相关问题
- 1. 我怎样才能找到当前经度和使用HTML5
- 2. 我怎样才能在Android当前的位置?
- 3. 我怎样才能获得纬度和经度值从UDP数据包的C#
- 4. 我怎样才能得到在ios5中使用邮政编码的经度和纬度值?
- 5. android需要多长时间才能给出当前位置的经纬度值
- 6. Android ImageView:我怎样才能获得当前的旋转角度?
- 7. 找到当前位置的经纬度
- 8. Bing地图。我怎样才能得到纬度和经度的地址?
- 9. 角谷歌地图使用控制器我怎样才能得到(经度和纬度)当前地图的中心获取地图的经纬度中心
- 10. 无法获得Android当前位置的纬度和经度
- 11. 如何获得当前位置的经纬度在android系统
- 12. 使用lattitude和当前位置和目标位置的经度,我们怎样才能在iphone
- 13. 我怎样才能获得连续更新的当前位置在Android
- 14. iOS - 我怎样才能返回经度和纬度?
- 15. 当前位置,经度和纬度
- 16. Python:Django:我怎样才能找到用户的纬度和经度,以便我可以显示用户的位置?
- 17. 我怎样才能得到在Android的
- 18. 我怎样才能得到checkboxlist当前选定的项目值
- 19. 我怎样才能得到textarea中的行号的当前光标位置?
- 20. 我怎样才能得到当前用户名在Silverlight 2.0
- 21. 如何获得当前位置(经度,纬度),而gps关闭使用FusedLocationApi android
- 22. 我怎样才能获得的纬度和经度从JSON谷歌地图
- 23. 如何获取Android中当前位置的纬度和经度?
- 24. 获取当前位置经度和纬度在android
- 25. 获取当前位置的经纬度
- 26. Android:我怎样才能找到使用PINCODE的位置?
- 27. 我怎样才能得到
- 28. 我怎样才能得到
- 29. 我怎样才能得到屏幕-Android
- 30. 我怎样才能得到android
转到此http://developer.android.com/reference/android/location/Location.html ........... .......................或者这个http://stackoverflow.com/questions/17983865/making-a-location-object-in-android-with -latitude-and-longitude-values – Hytool