Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
133 views
in Technique[技术] by (71.8m points)

geolocation - BlackBerry GPS Application

First a fall i would like to tell you my rating in blackberry is very very poor.

now i am trying to learn gps application.

How to start a GPS application for BlackBerry?

I'm using Blackberry 7.

Could you suggest any working sample application or any link?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Hi following information useful to you

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

Sample application details

some more useful information you can get from here

https://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

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

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.

Simple Location API features:

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

enter image description here

Examples:

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);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...