IBM工作灯 - 如何实现GPS功能? [英] IBM Worklight - How to implement GPS functionality?

查看:184
本文介绍了IBM工作灯 - 如何实现GPS功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用工作灯的Andr​​oid应用程序。

我不能够理解如何实现地理定位和如何将它从HTML按钮事件调用。


解决方案

补充工作灯6.0 <一个href=\"http://pic.dhe.ibm.com/infocenter/wrklight/v6r0m0/index.jsp?topic=/com.ibm.worklight.help.doc/devref/c_overview_location_services.htmlhttp://pic.dhe.ibm.com/infocenter/wrklight/v6r0m0/index.jsp?topic=/com.ibm.worklight.help.doc/devref/c_overview_location_services.html\"相对=nofollow>位置服务API 超出了 navigator.geolocation 对象提供的W3C地理位置API。概括起来,它们允许你:


  1. 获取当前位置。

  2. 设置正在进行的收购政策(所需的精度,最小时间和距离的位置更新等之间 - 影响电池消耗的东西)。

  3. 设置位置的变化和地理围栏触发(退出,进入,里面居住或多边形或圆形外),这
    能够

    1. 触发回调函数和

    2. 发送语义位置事件服务器 - 它可以使用事件处理程序在您的适配器注册后,他们的行为


  4. 使用WiFi能见度(在Android)连接无线(在Android,iOS和WP8)也做同样的室内位置。

由于6.1这也可作为iOS和Android原生API。我们还增加了一些很酷的功能,让您可以方便地调试和测试基于位置的混合(JavaScript)的应用程序 - 见<一href=\"https://pic.dhe.ibm.com/infocenter/wrklight/v6r1m0/index.jsp?topic=%2Fcom.ibm.help.doc%2Fwl_home.html\"相对=nofollow>这里。

I am currently working on an Android app using Worklight.

I am not able to understand how to implement geolocation and how to call it from HTML button event.

解决方案

Worklight 6.0 added Location Services APIs that go beyond the w3c geolocation APIs available in the navigator.geolocation object. To sum it up, they allow you to:

  1. Get the current location.
  2. Setup ongoing acquisition policy (desired accuracy, min time and distance between location updates, etc - things that influence the battery consumption).
  3. Setup location-change and geo-fence triggers (exit, enter, dwell inside or outside a polygon or a circle) which can

    1. trigger callback functions and
    2. send semantic location events to the server - which can act upon them using event handlers you register in your adapters.

  4. Do the same also for indoor location using wifi visibility (on Android) and connected wifi (on Android, iOS, and WP8).

As of 6.1 this is available also as native APIs for iOS and Android. We've also added some cool features that allow you to conveniently debug and test location-based hybrid (javascript) apps - see here.

这篇关于IBM工作灯 - 如何实现GPS功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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