黑莓GPS应用 [英] BlackBerry GPS Application

查看:456
本文介绍了黑莓GPS应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先跌倒我想告诉你,我的黑莓评级是非常非常差。

现在我想学习GPS应用。

now i am trying to learn gps application.

如何启动黑莓GPS应用程序?

How to start a GPS application for BlackBerry?

我使用黑莓7。

你可以建议任何工作示例应用程序或任何链接?

Could you suggest any working sample application or any link?

推荐答案

嗨以下信息对你有用。

如果您想直接从网站上学习以下信息,您可以点击这个链接

if you want to study following information from directly site you can click this link

<一个href=\"http://supportforums.blackberry.com/t5/Java-Development/Simple-Location-API/ta-p/1145951\">Sample应用程序详细信息

您可以从这里得到一些有用的信息。

some more useful information you can get from here

http://stackoverflow.com/a/7673953/914111

注:以上的情况下链路发生故障时,请在这里阅读相同的信息,否则请忽略以下信息,上述信息通过

Note: in case above link fails please read same information here,otherwise please ignore following information and go through above information

简单的位置API,顾名思义,是可用的位置API包的简化版本的BlackBerry®开发平台。这个API是建立在现有位置API之上,并提供了一​​种简单无忧,但功能丰富的API,将有望使开发人员能够专注于他们的应用程序,而不是在复杂的细节和角落的情况下花了很多的时间标准位置的API。这个API的源$ C ​​$ C现在是开源的,可以从GitHub一个演示应用程序一起下载:<一href=\"https://github.com/blackberry/Samples-for-Java/tree/master/Simple%20Location%20API\">https://github.com/blackberry/Samples-for-Java/tree/master/Simple%20Location%20API

Simple Location API, as the name suggests, is a simplified version of the Location API packages available on the BlackBerry® development platform. This API is built on top of the existing Location APIs and offers a simple, worry-free but feature-rich API that will hopefully allow the developers to focus on their application instead of spending a lot of time on the complex details and corner cases of standard Location APIs. The source code of this API is now Open Source and can be downloaded along with a demo application from Github: https://github.com/blackberry/Samples-for-Java/tree/master/Simple%20Location%20API

请注意:该API支持的BlackBerry®设备软件5.0及以后,具有preprocessor陈述利用黑莓设备Sofware 5.0和BlackBerry®6.0功能。要在5.0使用此API时,code段封闭在//#IFDEF BlackBerrySDK6.0.0及以下//#ENDIF必须拆除。同样,针对黑莓6.0及更高版本时,code段封闭在//#IFDEF BlackBerrySDK5.0.0及以下//#ENDIF必须拆除。如果您正在使用为BlackBerry®Java®插件为Eclipse®中,preprocessors应该会自动由IDE基于您选择的BlackBerry Java运行时环境项目的照顾。

NOTE: The API supports BlackBerry® Device Software 5.0 and onwards and has preprocessor statements to leverage BlackBerry Device Sofware 5.0 and BlackBerry® 6.0 features. To use this API in 5.0, the code snippets enclosed in //#ifdef BlackBerrySDK6.0.0 and following //#endif must be removed. Similarly, when targeting BlackBerry 6.0 and later, the code snippets enclosed in //#ifdef BlackBerrySDK5.0.0 and following //#endif must be removed. If you are using BlackBerry® Java® Plug-in for Eclipse®, the preprocessors should be automatically taken care of by the IDE based on your selected BlackBerry® Java Runtime Environment for the project.

简单的Location API的特点:

Simple Location API features:

重点是真实世界用例简化。仅由两个班。
无忧定位API,它利用设备上的全球定位系统和RIM的地理定位服务。
动态检测尝试其中的任何之前设备上可用的和支持的位置模式。
选择基于所述设备上可用的模式的最佳位置的模式。
内置重试机制动态延迟(以节省电池)的基础上由API用户设置的重试因子。
执行单或跟踪定位修复。
通过SimpleLocationListener接口简化事件。
能够启动,停止和可靠线程安全的方式重新启动跟踪会话。
旨在消除/减少的位置API滥用

Simplified with a focus on real world usecases. Consists of only two classes. Worry-free location API that leverages on-device GPS and RIM's Geolocation services. Dynamically detects available and supported location modes on the device before trying any of them. Chooses the best location mode based on the modes available on the device. Built-in retry mechanism with dynamic delay (to save battery) based on a retry factor set by the API user. Performs both single or tracking location fixes. Simplified events via SimpleLocationListener interface. Capable of starting, stopping and restarting tracking session in a reliable thread-safe way. Designed to eliminate/reduce misuse of location API

例如:

Single location fix in default mode:


 try{
        simpleProvider = new SimpleLocationProvider();
 } catch(LocationException le){ // thrown if the default mode MODE_OPTIMAL is not available.
        ...
 }
 BlackBerryLocation location = simpleProvider.getLocation(120); // 120 seconds timeout


Single location fix in a specified mode:


 try{
        simpleProvider = new SimpleLocationProvider(SimpleLocationProvider.MODE_GPS);
 } catch(LocationException le){ // thrown if the selected mode (in this case MODE_GPS) is not available.
        ...
 }
 BlackBerryLocation location = simpleProvider.getLocation(120); // 120 seconds timeout


Tracking session in default mode


 try{
        simpleProvider = new SimpleLocationProvider();   
 } catch(LocationException le){ // thrown if the default mode MODE_OPTIMAL is not available.
        ...
 } 
 // Location fixes will be delivered to simpleLocationListenerImpl (an implementation of SimpleLocationListener) every 6 seconds.
 simpleProvider.addSimpleLocationListener(simpleLocationListenerImpl, 6);



Tracking session in a specific mode


try{
        simpleProvider = new SimpleLocationProvider(SimpleLocationProvider.MODE_GPS);    
 } catch(LocationException le){ // thrown if the selected mode (in this case MODE_GPS) is not available.
        ...
 } 
 // Location fixes will be delivered to simpleLocationListenerImpl (an implementation of SimpleLocationListener) every 6 seconds.
 simpleProvider.addSimpleLocationListener(simpleLocationListenerImpl, 6);

这篇关于黑莓GPS应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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