Permalink
Browse files

commit of Simple Location API

  • Loading branch information...
1 parent 8b68d0e commit d65af0903ffabd3651191dcd978bc053cbb6efb8 Tim Windsor committed Dec 9, 2011
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="res"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/net.rim.ejde.BlackBerryVMInstallType/BlackBerry JRE 5.0.0"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>Simple Location API</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>net.rim.ejde.internal.builder.BlackBerryPreprocessBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>net.rim.ejde.internal.builder.BlackBerryResourcesBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>net.rim.ejde.BlackBerryPreProcessNature</nature>
+ <nature>net.rim.ejde.BlackBerryProjectCoreNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
@@ -0,0 +1,12 @@
+#Tue Oct 25 12:04:00 EDT 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=ignore
+org.eclipse.jdt.core.compiler.source=1.3
@@ -0,0 +1,21 @@
+<!-- This file has been generated by the BlackBerry Plugin for Eclipse v3.7.100. -->
+
+<Properties ModelVersion="1.1.2">
+ <General Title="" Version="1.0.0" Vendor="BlackBerry Developer" Description=""/>
+ <Application Type="BlackBerry Application" MainMIDletName="" MainArgs="" HomeScreenPosition="0" StartupTier="7" IsSystemModule="false" IsAutostartup="false"/>
+ <Resources hasTitleResource="false" TitleResourceBundleName="" TitleResourceBundleRelativePath="" TitleResourceBundleClassName="" TitleResourceBundleKey="" DescriptionId="">
+ <Icons/>
+ </Resources>
+ <KeywordResources KeywordResourceBundleName="" KeywordResourceBundleRelativePath="" KeywordResourceBundleClassName="" KeywordResourceBundleKey=""/>
+ <Compile OutputCompilerMessages="false" ConvertImages="true" CreateWarningForNoExportedRoutine="true" CompressResources="false" AliasList="">
+ <PreprocessorDefines/>
+ </Compile>
+ <Packaging PreBuildStep="" PostBuildStep="" CleanStep="" OutputFileName="Simple_Location_API" OutputFolder="deliverables" GenerateALXFile="true">
+ <AlxFiles/>
+ </Packaging>
+ <HiddenProperties>
+ <ClassProtection/>
+ <PackageProtection/>
+ </HiddenProperties>
+ <AlternateEntryPoints/>
+</Properties>
@@ -0,0 +1,43 @@
+# Simple Location API
+
+Simple Location API, as the name suggests, is a simplified version of the Location API packages available on the BlackBerry&reg; 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. A demo application is included with the source.
+
+The project can be imported with the BlackBerry Java Plugin for Eclipse. Once it has been imported, build it and run to test it on a simulator or device.
+
+Further details are here: http://supportforums.blackberry.com/t5/Java-Development/Simple-Location-API/ta-p/1145951
+
+The sample code for this application is Open Source under the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0.html).
+
+**Applies To**
+
+* [BlackBerry Java SDK for Smartphones](http://us.blackberry.com/developers/javaappdev/)
+
+
+**Author(s)**
+
+* [Tim Windsor](https://github.com/timwindsor)
+
+
+**Dependencies**
+
+1. BlackBerry Java SDK 6.0.0 or higher required.
+2. Youtube Data API 2.0
+
+
+
+**To contribute code to this repository you must be [signed up as an official contributor](http://blackberry.github.com/howToContribute.html).**
+
+
+## Contributing Changes
+
+Please see the [README](https://github.com/blackberry/Samples-for-Java) of the Samples-for-Java repository for instructions on how to add new Samples or make modifications to existing Samples.
+
+
+## Bug Reporting and Feature Requests
+
+If you find a bug in a Sample, or have an enhancement request, simply file an [Issue](https://github.com/blackberry/Samples-for-Java/issues) for the Sample and send a message (via github messages) to the Sample Author(s) to let them know that you have filed an [Issue](https://github.com/blackberry/Samples-for-Java/issues).
+
+
+## Disclaimer
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,31 @@
+<loader version="1.0">
+ <application id="Simple_Location_API">
+ <name >
+
+ </name>
+ <description >
+
+ </description>
+ <version >
+ 1.0.0
+ </version>
+ <vendor >
+ BlackBerry Developer
+ </vendor>
+ <copyright >
+ Copyright (c) 2011 BlackBerry Developer
+ </copyright>
+ <fileset Java="1.54" _blackberryVersion="[5.0.0)">
+ <directory >
+ 5.0.0
+ </directory>
+ <files >
+ Simple_Location_API.cod
+
+ </files>
+
+ </fileset>
+
+ </application>
+
+</loader>
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2011 Research In Motion Limited.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package rimx.location.simplelocation;
+
+import net.rim.device.api.gps.BlackBerryLocation;
+
+/**
+ * Implement this interface to listen for events triggered by {@link SimpleLocationProvider} for a tracking session. Implementation of this interface
+ * should be registered with {@link SimpleLocationProvider} by calling {@link SimpleLocationProvider#addSimpleLocationListener(SimpleLocationListener, int)}.
+ * Otherwise, no tracking session will be started and no location fixes will be delivered to this listener interface. Only one {@link SimpleLocationListener}
+ * implementation can be registered with a {@link SimpleLocationProvider}.
+ * <p>
+ * <pre>
+ * // The following call registers simpleLocationListenerImpl (a {@link SimpleLocationListener} implementation) to receive location updates every 5 seconds.
+ * simpleLocationProvider.addSimpleLocationListener(simpleLocationListenerImpl, 5);
+ *
+ * // The following call removes simpleLocationListenerImpl (a {@link SimpleLocationListener} implementation) and stops any further location updates.
+ * simpleLocationProvider.removeSimpleLocationListener();
+ *
+ * </pre>
+ * @author Shadid Haque
+ *
+ */
+public interface SimpleLocationListener {
+ /**
+ * Triggered when the SimpleLocationProvider starts/restarts to acquire a location fix.
+ * <p>
+ * eventData is an {@link Integer} representing the attempt #. To learn more about attempt please see {@link SimpleLocationProvider#setRetryFactor(int)}
+ */
+ public static final int EVENT_ACQUIRING_LOCATION = 0;
+ /**
+ * Triggered when a location is obtained via GPS.
+ * <p>
+ * eventData is a {@link BlackBerryLocation} object.
+ */
+ public static final int EVENT_GPS_LOCATION = 1;
+ /**
+ * Triggered when a location is obtained via cell tower based geolocation.
+ * <p>
+ * eventData is a {@link BlackBerryLocation} object.
+ */
+ public static final int EVENT_CELL_GEOLOCATION = 2;
+ /**
+ * Triggered when a location is obtained via wlan based geolocation.
+ * <p>
+ * eventData is a {@link BlackBerryLocation} object.
+ */
+ public static final int EVENT_WLAN_GEOLOCATION = 3;
+ /**
+ * Triggered when a valid location is obtained but the mode is unknown.
+ * <p>
+ * eventData is a {@link BlackBerryLocation} object.
+ */
+ public static final int EVENT_UNKNOWN_MODE = 4;
+ /**
+ * Triggered when obtaining a location fix fails within the specified timeout -
+ * (See {@link SimpleLocationProvider#setGeolocationTimeout(int)} and {@link SimpleLocationProvider#setGPSTimeout(int)}).
+ * The SimpleLocationProvider will retry after a certain time has passed. For more information on retry mechanisms please
+ * see {@link SimpleLocationProvider#setRetryFactor(int)}.
+ * <p>
+ * eventData is a {@link Long} representing the timestamp of the next scheduled retry.
+ */
+ public static final int EVENT_LOCATION_FAILED = 5;
+
+
+ /**
+ * Triggers one of the EVENT_* events defined in this interface.
+ * @param event an event code. One of EVENT_*
+ * @param eventData an Object that contains contextual information of the event. See descriptions of each EVENT_*.
+ */
+ public void locationEvent(int event, Object eventData);
+
+ /**
+ * Called when a debug message is available. Applications can use this log to debug this API.
+ * @param msg A debug message.
+ */
+ public void debugLog(String msg);
+}
Oops, something went wrong.

0 comments on commit d65af09

Please sign in to comment.