This directory contains NavigineSDK usage examples for all supported platforms.
Examples Structure
examples/
├── java/
│ └── NavigineSdkExample.java # Java example
├── kotlin/
│ └── NavigineSdkExample.kt # Kotlin example
├── objc/
│ └── NavigineSdkExample.m # Objective-C example
├── swift/
│ └── NavigineSdkExample.swift # Swift example
├── dart/
│ └── navigine_sdk_example.dart # Dart/Flutter example
└── README.md # This file
Examples Description
NavigineSDK - Main SDK Class
The NavigineSDK class is the central access point to all SDK services. It provides:
Static methods:
getInstance() - get SDK instance
getVersion() - get SDK version
getDeviceId() - get unique device ID
getRelativeTime() - get internal timestamp
Instance methods:
setUserHash(String userHash) - set authorization token
setServer(String server) - set server URL
getLocationManager() - get location manager
getNavigationManager(LocationManager) - get navigation manager
getZoneManager(NavigationManager) - get zone manager
getRouteManager(LocationManager, NavigationManager) - get route manager
getAsyncRouteManager(LocationManager, NavigationManager) - get async route manager
getNotificationManager(LocationManager) - get notification manager
getMeasurementManager(LocationManager) - get measurement manager
getLocationListManager() - get location list manager
getStorageManager() - get storage manager
Implementation Features for Each Platform
Java
- Uses traditional approach with explicit exception handling
- Demonstrates work with interfaces and abstract classes
- Shows proper resource management
Kotlin
- Uses null-safety operators (
?., ?.let, ?.apply)
- Demonstrates scope functions (
let, run, with, apply)
- Shows modern language features
Objective-C
- Uses ARC (Automatic Reference Counting)
- Demonstrates work with blocks and KVO
- Shows proper memory management
Swift
- Uses optional binding (
guard let, if let)
- Demonstrates modern language features (async/await, property wrappers)
- Shows work with extensions
Dart/Flutter
- Uses null-aware operators
- Demonstrates asynchronous programming with
async/await
- Shows work with extension methods
- Includes examples for Flutter applications
How to Use Examples
Java
# Compilation
javac -cp "path/to/navigine-sdk.jar" NavigineSdkExample.java
# Run
java -cp ".:path/to/navigine-sdk.jar" NavigineSdkExample
Kotlin
# Compilation with Kotlin
kotlinc -cp "path/to/navigine-sdk.jar" NavigineSdkExample.kt
# Run
kotlin -cp ".:path/to/navigine-sdk.jar" NavigineSdkExampleKt
Objective-C
# Compilation
clang -framework Foundation -framework NavigineSDK NavigineSdkExample.m -o NavigineSdkExample
# Run
./NavigineSdkExample
Swift
# Compilation
swiftc -import-objc-header NavigineSDK-Bridging-Header.h NavigineSdkExample.swift -o NavigineSdkExample
# Run
./NavigineSdkExample
Dart/Flutter
# For Dart
dart navigine_sdk_example.dart
# For Flutter (in Flutter project)
flutter run
Important Notes
- Authorization Token: Replace
"XXXX-XXXX-XXXX-XXXX" with your actual token from CMS
- Server: Change server URL in
setServer() method if needed
- Dependencies: Make sure all necessary libraries are connected
- Permissions: Geolocation permissions are required for operation
Next Steps
After studying the basic NavigineSDK example, you can proceed to study examples for specific managers:
Each manager provides specific functionality and has its own usage features.