有没有一种简单的方法可以在phonegap中获得电话的罗盘航向精度? [英] Is there an easy way to get phone's compass heading accuracy in phonegap?

查看:114
本文介绍了有没有一种简单的方法可以在phonegap中获得电话的罗盘航向精度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带指南针的phonegap构建适用于Android和ios的应用程序.因此,我正在使用w3c api,如本文所述

I am building an app for Android and ios with phonegap that includes a compass. Therefore I am using the w3c api as explained in this article

我的问题是指南针的使用在我的应用程序中至关重要,因此我需要使用户意识到,只要校准不佳,手机的指南针就会出现问题.

My problem is that the use of the compass is critical in my application so I need to make the user aware that his phone's compass has a problem whenever it is poorly calibrated.

据我所知,您可以使用Java for Android中的本机代码检查指南针的准确性.我对Swift和ios一无所知.

I know for a fact that you can check the compass accuracy with native code in Java for Android. I don't know anything about Swift and ios.

我的问题是:您是否知道任何简单的方法来通过phonegap获取有关指南针精度的信息?我一直在寻找插件来执行此操作,但我什么都没找到(也许对于Android 此插件)

My question is : Would you know any easy way to get the information about the compass accuracy with phonegap ? I've been searching a plugin to do that but I couldn't find anything really (except maybe for Android this plugin )

非常感谢您

推荐答案

由于该问题似乎没有可能的答案.我创建了解决方案:

Since it seems there were no possible answers to that question. I created the solution :

https://github.com/simsComputing/cordova-plugin-headingcalibration

这是我的第一个cordova插件,因此肯定不是完美的.它尚未在npm上发布. 当我有时间完成并发布它时,我会做.同时,如果有人找到此线程,请随时使用该插件.

This is my first cordova plugin so it surely is not perfect. It isn't published on npm yet. When I find time to complete it and publish it, i'll do it. In the mean time if anyone finds this thread, feel free to use the plugin.

这篇关于有没有一种简单的方法可以在phonegap中获得电话的罗盘航向精度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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