在多个设备共享一个谷歌地图 [英] Share single google map among multiple device

查看:188
本文介绍了在多个设备共享一个谷歌地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我有一个使用谷歌地图的应用程序,而我的控制器,我可以添加标记,删除标记,等...问题是我怎么可以让另外一个人在另一个设备上看到我的地图
在时尚动感也就是说,如果我删除/添加了一个标志,他刷新,他将看到的变化发生了。

Say I have an app that uses google map , and I'm the controller , I can add markers , remove markers , etc... the question is how can I let some one else on another device to see my map in dynamic fashion i.e. if I deleted/added a marker and he refreshed , he will see the changes happened

推荐答案

您需要同步两个应用程序,例如使用一个数据库,在所有的应用程序发送一个网络服务器,并在其statuts阅读这些更新。对于你必须打电话到PHP服务器,发送和JSON可能收到信息。

You need to sync the two apps, using for instance a database in a webserver where all the apps sends and read the updates in their statuts. For that you have to make calls to a php server, sending and receiving the info probably in json.

此外,您还可以尝试使用同步适配器

Also, you can try to use sync adapters

在Android设备和Web服务器之间同步数据可以使
  您的应用程序显著更有价值和吸引力的你
  用户。例如,将数据传送到Web服务器做出有益的
  备份,以及从服务器传输数据使得它提供给
  用户即使设备处于离线状态。在某些情况下,用户可能会发现它
  更容易进入,并在Web界面编辑自己的数据,然后让
  他们的设备上的可用数据,也可能要收集数据
  随着时间的推移,然后将其上传到中央存储区域

Synchronizing data between an Android device and web servers can make your application significantly more useful and compelling for your users. For example, transferring data to a web server makes a useful backup, and transferring data from a server makes it available to the user even when the device is offline. In some cases, users may find it easier to enter and edit their data in a web interface and then have that data available on their device, or they may want to collect data over time and then upload it to a central storage area.

虽然可以设计自己的系统做数据传输
  您的应用程序,你应该考虑使用Android的同步适配器框架。
  该框架可帮助管理和自动化数据传输和
  协调跨不同的应用程序同步操作。当你
  使用这个框架,你可以采取的几个特点优势
  不可用于数据传输方案您自己设计的:

Although you can design your own system for doing data transfers in your app, you should consider using Android's sync adapter framework. This framework helps manage and automate data transfers, and coordinates synchronization operations across different apps. When you use this framework, you can take advantage of several features that aren't available to data transfer schemes you design yourself:

在给定的链接,你可以找到更多的信息,也是一个示例应用程序

in the given link you can find more information, and also an example app

这篇关于在多个设备共享一个谷歌地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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