1package com.navigine.examples
3import com.navigine.idl.java.*
6 * LocationManager usage example for Kotlin
7 * Demonstrates working with locations, sublocations, categories, and other location-related classes
9class LocationManagerExample {
10 private var sdk: NavigineSdk? = null
11 private var locationManager: LocationManager? = null
12 private var currentLocation: Location? = null
13 private var locationListener: LocationListener? = null
17 setupLocationListener()
21 * Initialize SDK and get LocationManager
23 private fun initializeSdk() {
25 // [kotlin_NavigineSdk_getInstance]
27 sdk = NavigineSdk.getInstance()
28 // [kotlin_NavigineSdk_getInstance]
30 // [kotlin_NavigineSdk_setUserHash]
32 sdk?.setUserHash("USER-HASH-HERE")
33 // [kotlin_NavigineSdk_setUserHash]
35 // [kotlin_NavigineSdk_setServer]
36 // Set server URL (optional)
37 sdk?.setServer("https://custom.navigine.com")
38 // [kotlin_NavigineSdk_setServer]
40 // [kotlin_NavigineSdk_getLocationManager]
41 // Get LocationManager for working with locations
42 locationManager = sdk?.getLocationManager()
43 // [kotlin_NavigineSdk_getLocationManager]
45 if (locationManager != null) {
46 println("LocationManager successfully initialized")
48 } catch (e: Exception) {
49 System.err.println("Error initializing SDK: ${e.message}")
54 * Setup location listener
56 private fun setupLocationListener() {
57 locationListener = object : LocationListener() {
59 // [kotlin_LocationListener_onLocationLoaded]
60 fun onLocationLoaded(location: Location?) {
61 println("Location loaded successfully")
62 currentLocation = location
63 location?.let { demonstrateLocationUsage(it) }
65 // [kotlin_LocationListener_onLocationLoaded]
68 // [kotlin_LocationListener_onLocationUploaded]
69 fun onLocationUploaded(locationId: Int) {
70 println("Location uploaded: $locationId")
72 // [kotlin_LocationListener_onLocationUploaded]
75 // [kotlin_LocationListener_onLocationFailed]
76 fun onLocationFailed(locationId: Int, error: Error) {
77 System.err.println("Failed to load location $locationId: ${error.message}")
79 // [kotlin_LocationListener_onLocationFailed]
84 * Demonstrate LocationManager methods
86 fun demonstrateLocationManagerMethods() {
87 val manager = locationManager ?: run {
88 System.err.println("LocationManager not initialized")
92 val listener = locationListener ?: return
94 // [kotlin_LocationManager_addLocationListener]
95 // Add location listener
96 manager.addLocationListener(listener)
97 // [kotlin_LocationManager_addLocationListener]
99 // [kotlin_LocationManager_setLocationId]
100 // Set location ID to load
101 manager.setLocationId(12345)
102 // [kotlin_LocationManager_setLocationId]
104 // [kotlin_LocationManager_getLocationId]
105 // Get current location ID
106 val currentLocationId = manager.getLocationId()
107 println("Current location ID: $currentLocationId")
108 // [kotlin_LocationManager_getLocationId]
110 // [kotlin_LocationManager_setLocationUpdateInterval]
111 // Set location update interval (in seconds)
112 manager.setLocationUpdateInterval(600) // 10 minutes
113 // [kotlin_LocationManager_setLocationUpdateInterval]
115 // [kotlin_LocationManager_commitChanges]
117 manager.commitChanges()
118 // [kotlin_LocationManager_commitChanges]
120 // [kotlin_LocationManager_revertChanges]
121 // Revert changes (if needed)
122 // manager.revertChanges()
123 // [kotlin_LocationManager_revertChanges]
127 * Demonstrate Location class methods
129 fun demonstrateLocationUsage(location: Location) {
130 // [kotlin_Location_getId]
132 val locationId = location.id
133 println("Location ID: $locationId")
134 // [kotlin_Location_getId]
136 // [kotlin_Location_getVersion]
137 // Get location version
138 val version = location.version
139 println("Location version: $version")
140 // [kotlin_Location_getVersion]
142 // [kotlin_Location_getName]
144 val name = location.name
145 println("Location name: $name")
146 // [kotlin_Location_getName]
148 // [kotlin_Location_getDescript]
149 // Get location description
150 val description = location.descript
151 println("Location description: $description")
152 // [kotlin_Location_getDescript]
154 // [kotlin_Location_getModified]
155 // Check if location is modified
156 val isModified = location.modified
157 println("Location modified: $isModified")
158 // [kotlin_Location_getModified]
160 // [kotlin_Location_getGraphTags]
161 // Get available graph tags
162 val graphTags = location.graphTags
163 println("Available graph tags: $graphTags")
164 // [kotlin_Location_getGraphTags]
166 // [kotlin_Location_getElevationGraph]
167 // Get elevation graph by tag
168 graphTags.firstOrNull()?.let { tag ->
169 val elevationGraph = location.getElevationGraph(tag)
170 elevationGraph?.let { demonstrateElevationGraphUsage(it) }
172 // [kotlin_Location_getElevationGraph]
174 // [kotlin_Location_getCategories]
175 // Get all categories
176 val categories = location.categories
177 println("Number of categories: ${categories.size}")
178 // [kotlin_Location_getCategories]
180 // [kotlin_Location_getCategoryById]
181 // Get category by ID
182 categories.firstOrNull()?.let { category ->
183 val foundCategory = location.getCategoryById(category.id)
184 foundCategory?.let { demonstrateCategoryUsage(it) }
186 // [kotlin_Location_getCategoryById]
188 // [kotlin_Location_getSublocations]
189 // Get all sublocations
190 val sublocations = location.sublocations
191 println("Number of sublocations: ${sublocations.size}")
192 // [kotlin_Location_getSublocations]
194 // [kotlin_Location_getSublocationById]
195 // Get sublocation by ID
196 sublocations.firstOrNull()?.let { sublocation ->
197 val foundSublocation = location.getSublocationById(sublocation.id)
198 foundSublocation?.let { demonstrateSublocationUsage(it) }
200 // [kotlin_Location_getSublocationById]
204 * Demonstrate Category class methods
206 fun demonstrateCategoryUsage(category: Category) {
207 // [kotlin_Category_getId]
209 val categoryId = category.id
210 println("Category ID: $categoryId")
211 // [kotlin_Category_getId]
213 // [kotlin_Category_getName]
215 val categoryName = category.name
216 println("Category name: $categoryName")
217 // [kotlin_Category_getName]
219 // [kotlin_Category_getImageUrl]
220 // Get category image URL
221 val imageUrl = category.imageUrl
222 imageUrl?.let { println("Category image URL: $it") }
223 // [kotlin_Category_getImageUrl]
227 * Demonstrate Sublocation class methods
229 fun demonstrateSublocationUsage(sublocation: Sublocation) {
230 // [kotlin_Sublocation_getId]
231 // Get sublocation ID
232 val sublocationId = sublocation.id
233 println("Sublocation ID: $sublocationId")
234 // [kotlin_Sublocation_getId]
236 // [kotlin_Sublocation_getName]
237 // Get sublocation name
238 val sublocationName = sublocation.name
239 println("Sublocation name: $sublocationName")
240 // [kotlin_Sublocation_getName]
242 // [kotlin_Sublocation_getDescript]
243 // Get sublocation description
244 val sublocationDescription = sublocation.descript
245 println("Sublocation description: $sublocationDescription")
246 // [kotlin_Sublocation_getDescript]
248 // [kotlin_Sublocation_getCategoryId]
250 val categoryId = sublocation.categoryId
251 println("Sublocation category ID: $categoryId")
252 // [kotlin_Sublocation_getCategoryId]
254 // [kotlin_Sublocation_getLocation]
256 val locationId = sublocation.location
257 println("Sublocation location ID: $locationId")
258 // [kotlin_Sublocation_getLocation]
260 // [kotlin_Sublocation_getWidth]
261 // Get sublocation width in meters
262 val width = sublocation.width
263 println("Sublocation width: $width meters")
264 // [kotlin_Sublocation_getWidth]
266 // [kotlin_Sublocation_getHeight]
267 // Get sublocation height in meters
268 val height = sublocation.height
269 println("Sublocation height: $height meters")
270 // [kotlin_Sublocation_getHeight]
272 // [kotlin_Sublocation_getAltitude]
273 // Get sublocation altitude in meters
274 val altitude = sublocation.altitude
275 altitude?.let { println("Sublocation altitude: $it meters") }
276 // [kotlin_Sublocation_getAltitude]
278 // [kotlin_Sublocation_getAzimuth]
279 // Get sublocation azimuth in degrees
280 val azimuth = sublocation.azimuth
281 println("Sublocation azimuth: $azimuth degrees")
282 // [kotlin_Sublocation_getAzimuth]
284 // [kotlin_Sublocation_getOriginPoint]
285 // Get sublocation origin point in WGS84 coordinates
286 val originPoint = sublocation.originPoint
287 println("Sublocation origin point: ${originPoint.lat}, ${originPoint.lon}")
288 // [kotlin_Sublocation_getOriginPoint]
290 // [kotlin_Sublocation_getLevelId]
291 // Get sublocation level ID
292 val levelId = sublocation.levelId
293 println("Sublocation level ID: $levelId")
294 // [kotlin_Sublocation_getLevelId]
296 // [kotlin_Sublocation_getExternalId]
297 // Get sublocation external ID
298 val externalId = sublocation.externalId
299 println("Sublocation external ID: $externalId")
300 // [kotlin_Sublocation_getExternalId]
302 // [kotlin_Sublocation_getBuildingName]
303 // Get sublocation building name
304 val buildingName = sublocation.buildingName
305 println("Sublocation building name: $buildingName")
306 // [kotlin_Sublocation_getBuildingName]
308 // [kotlin_Sublocation_getReferencePoints]
309 // Get reference points
310 val referencePoints = sublocation.referencePoints
311 println("Number of reference points: ${referencePoints.size}")
312 // [kotlin_Sublocation_getReferencePoints]
314 // [kotlin_Sublocation_getVenues]
316 val venues = sublocation.venues
317 println("Number of venues: ${venues.size}")
318 // [kotlin_Sublocation_getVenues]
320 // [kotlin_Sublocation_getZones]
322 val zones = sublocation.zones
323 println("Number of zones: ${zones.size}")
324 // [kotlin_Sublocation_getZones]
326 // [kotlin_Sublocation_getBeacons]
328 val beacons = sublocation.beacons
329 println("Number of beacons: ${beacons.size}")
330 // [kotlin_Sublocation_getBeacons]
332 // [kotlin_Sublocation_getWifis]
333 // Get WiFi access points
334 val wifis = sublocation.wifis
335 println("Number of WiFi access points: ${wifis.size}")
336 // [kotlin_Sublocation_getWifis]
338 // [kotlin_Sublocation_getEddystones]
339 // Get Eddystone beacons
340 val eddystones = sublocation.eddystones
341 println("Number of Eddystone beacons: ${eddystones.size}")
342 // [kotlin_Sublocation_getEddystones]
344 // [kotlin_Sublocation_getGraph]
346 val graph = sublocation.graph
347 graph?.let { demonstrateGraphUsage(it) }
348 // [kotlin_Sublocation_getGraph]
350 // [kotlin_Sublocation_getGraph_withTag]
352 val graphByTag = sublocation.getGraph("main")
354 println("Found graph with tag \"main\"")
355 demonstrateGraphUsage(it)
357 // [kotlin_Sublocation_getGraph_withTag]
359 // [kotlin_Sublocation_getVenueById]
361 if (venues.isNotEmpty()) {
362 val venueById = sublocation.getVenueById(venues.first().id)
364 println("Found venue by ID: ${it.id}")
365 demonstrateVenueUsage(it)
368 // [kotlin_Sublocation_getVenueById]
370 // [kotlin_Sublocation_getZoneById]
372 if (zones.isNotEmpty()) {
373 val zoneById = sublocation.getZoneById(zones.first().id)
375 println("Found zone by ID: ${it.id}")
376 demonstrateZoneUsage(it)
379 // [kotlin_Sublocation_getZoneById]
381 // [kotlin_Sublocation_globalToLocal]
382 // Convert global coordinates to local coordinates
383 val globalPoint = GlobalPoint(55.7558, 37.6176) // Moscow coordinates
384 val localPoint = sublocation.globalToLocal(globalPoint)
385 println("Global point ${globalPoint.lat}, ${globalPoint.lon} converted to local: ${localPoint.x}, ${localPoint.y}")
386 // [kotlin_Sublocation_globalToLocal]
388 // [kotlin_Sublocation_localToGlobal]
389 // Convert local coordinates to global coordinates
390 val localPoint2 = LocationPoint(100.0, 200.0)
391 val globalPoint2 = sublocation.localToGlobal(localPoint2)
392 println("Local point ${localPoint2.x}, ${localPoint2.y} converted to global: ${globalPoint2.lat}, ${globalPoint2.lon}")
393 // [kotlin_Sublocation_localToGlobal]
395 // [kotlin_Sublocation_getImage]
396 // Get sublocation image
397 val image = sublocation.getImage(1024) // max texture size 1024
398 image?.let { println("Sublocation image obtained with max texture size 1024") }
399 // [kotlin_Sublocation_getImage]
403 * Demonstrate Venue class methods
405 fun demonstrateVenueUsage(venue: Venue) {
406 // [kotlin_Venue_getId]
408 val venueId = venue.id
409 println("Venue ID: $venueId")
410 // [kotlin_Venue_getId]
412 // [kotlin_Venue_getLocationId]
413 // Get venue location ID
414 val locationId = venue.locationId
415 println("Venue location ID: $locationId")
416 // [kotlin_Venue_getLocationId]
418 // [kotlin_Venue_getSublocationId]
419 // Get venue sublocation ID
420 val sublocationId = venue.sublocationId
421 println("Venue sublocation ID: $sublocationId")
422 // [kotlin_Venue_getSublocationId]
424 // [kotlin_Venue_getName]
426 val venueName = venue.name
427 println("Venue name: $venueName")
428 // [kotlin_Venue_getName]
430 // [kotlin_Venue_getPhone]
432 val phone = venue.phone
433 println("Venue phone: $phone")
434 // [kotlin_Venue_getPhone]
436 // [kotlin_Venue_getDescript]
437 // Get venue description
438 val venueDescription = venue.descript
439 println("Venue description: $venueDescription")
440 // [kotlin_Venue_getDescript]
442 // [kotlin_Venue_getAlias]
444 val alias = venue.alias
445 println("Venue alias: $alias")
446 // [kotlin_Venue_getAlias]
448 // [kotlin_Venue_getCategoryId]
450 val categoryId = venue.categoryId
451 println("Venue category ID: $categoryId")
452 // [kotlin_Venue_getCategoryId]
454 // [kotlin_Venue_getImageUrl]
455 // Get venue image URL
456 val imageUrl = venue.imageUrl
457 imageUrl?.let { println("Venue image URL: $it") }
458 // [kotlin_Venue_getImageUrl]
460 // [kotlin_Venue_getPoint]
462 val point = venue.point
463 point?.let { demonstratePointUsage(it) }
464 // [kotlin_Venue_getPoint]
468 * Demonstrate Zone class methods
470 fun demonstrateZoneUsage(zone: Zone) {
471 // [kotlin_Zone_getId]
474 println("Zone ID: $zoneId")
475 // [kotlin_Zone_getId]
477 // [kotlin_Zone_getLocationId]
478 // Get zone location ID
479 val locationId = zone.locationId
480 println("Zone location ID: $locationId")
481 // [kotlin_Zone_getLocationId]
483 // [kotlin_Zone_getSublocationId]
484 // Get zone sublocation ID
485 val sublocationId = zone.sublocationId
486 println("Zone sublocation ID: $sublocationId")
487 // [kotlin_Zone_getSublocationId]
489 // [kotlin_Zone_getName]
491 val zoneName = zone.name
492 println("Zone name: $zoneName")
493 // [kotlin_Zone_getName]
495 // [kotlin_Zone_getDescript]
496 // Get zone description
497 val zoneDescription = zone.descript
498 println("Zone description: $zoneDescription")
499 // [kotlin_Zone_getDescript]
501 // [kotlin_Zone_getCategoryId]
503 val categoryId = zone.categoryId
504 println("Zone category ID: $categoryId")
505 // [kotlin_Zone_getCategoryId]
507 // [kotlin_Zone_getAlias]
509 val alias = zone.alias
510 println("Zone alias: $alias")
511 // [kotlin_Zone_getAlias]
513 // [kotlin_Zone_getColor]
515 val color = zone.color
516 println("Zone color: $color")
517 // [kotlin_Zone_getColor]
519 // [kotlin_Zone_getPolygon]
521 val polygon = zone.polygon
522 println("Zone polygon points: ${polygon.size}")
523 // [kotlin_Zone_getPolygon]
527 * Demonstrate Beacon class methods
529 fun demonstrateBeaconUsage(beacon: Beacon) {
530 // [kotlin_Beacon_getPoint]
532 val point = beacon.point
533 point?.let { demonstratePointUsage(it) }
534 // [kotlin_Beacon_getPoint]
536 // [kotlin_Beacon_getLocationId]
537 // Get beacon location ID
538 val locationId = beacon.locationId
539 println("Beacon location ID: $locationId")
540 // [kotlin_Beacon_getLocationId]
542 // [kotlin_Beacon_getSublocationId]
543 // Get beacon sublocation ID
544 val sublocationId = beacon.sublocationId
545 println("Beacon sublocation ID: $sublocationId")
546 // [kotlin_Beacon_getSublocationId]
548 // [kotlin_Beacon_getName]
550 val beaconName = beacon.name
551 println("Beacon name: $beaconName")
552 // [kotlin_Beacon_getName]
554 // [kotlin_Beacon_getMajor]
556 val major = beacon.major
557 println("Beacon major: $major")
558 // [kotlin_Beacon_getMajor]
560 // [kotlin_Beacon_getMinor]
562 val minor = beacon.minor
563 println("Beacon minor: $minor")
564 // [kotlin_Beacon_getMinor]
566 // [kotlin_Beacon_getUuid]
568 val uuid = beacon.uuid
569 println("Beacon UUID: $uuid")
570 // [kotlin_Beacon_getUuid]
572 // [kotlin_Beacon_getPower]
574 val power = beacon.power
575 power?.let { println("Beacon power: $it") }
576 // [kotlin_Beacon_getPower]
578 // [kotlin_Beacon_getStatus]
580 val status = beacon.status
581 println("Beacon status: $status")
582 // [kotlin_Beacon_getStatus]
586 * Demonstrate Wifi class methods
588 fun demonstrateWifiUsage(wifi: Wifi) {
589 // [kotlin_Wifi_getPoint]
591 val point = wifi.point
592 point?.let { demonstratePointUsage(it) }
593 // [kotlin_Wifi_getPoint]
595 // [kotlin_Wifi_getLocationId]
596 // Get WiFi location ID
597 val locationId = wifi.locationId
598 println("WiFi location ID: $locationId")
599 // [kotlin_Wifi_getLocationId]
601 // [kotlin_Wifi_getSublocationId]
602 // Get WiFi sublocation ID
603 val sublocationId = wifi.sublocationId
604 println("WiFi sublocation ID: $sublocationId")
605 // [kotlin_Wifi_getSublocationId]
607 // [kotlin_Wifi_getName]
609 val wifiName = wifi.name
610 println("WiFi name: $wifiName")
611 // [kotlin_Wifi_getName]
613 // [kotlin_Wifi_getMac]
614 // Get WiFi MAC address
616 println("WiFi MAC: $mac")
617 // [kotlin_Wifi_getMac]
619 // [kotlin_Wifi_getStatus]
621 val status = wifi.status
622 println("WiFi status: $status")
623 // [kotlin_Wifi_getStatus]
627 * Demonstrate Eddystone class methods
629 fun demonstrateEddystoneUsage(eddystone: Eddystone) {
630 // [kotlin_Eddystone_getPoint]
631 // Get Eddystone point
632 val point = eddystone.point
633 point?.let { demonstratePointUsage(it) }
634 // [kotlin_Eddystone_getPoint]
636 // [kotlin_Eddystone_getLocationId]
637 // Get Eddystone location ID
638 val locationId = eddystone.locationId
639 println("Eddystone location ID: $locationId")
640 // [kotlin_Eddystone_getLocationId]
642 // [kotlin_Eddystone_getSublocationId]
643 // Get Eddystone sublocation ID
644 val sublocationId = eddystone.sublocationId
645 println("Eddystone sublocation ID: $sublocationId")
646 // [kotlin_Eddystone_getSublocationId]
648 // [kotlin_Eddystone_getName]
649 // Get Eddystone name
650 val eddystoneName = eddystone.name
651 println("Eddystone name: $eddystoneName")
652 // [kotlin_Eddystone_getName]
654 // [kotlin_Eddystone_getNamespaceId]
655 // Get Eddystone namespace ID
656 val namespaceId = eddystone.namespaceId
657 println("Eddystone namespace ID: $namespaceId")
658 // [kotlin_Eddystone_getNamespaceId]
660 // [kotlin_Eddystone_getInstanceId]
661 // Get Eddystone instance ID
662 val instanceId = eddystone.instanceId
663 println("Eddystone instance ID: $instanceId")
664 // [kotlin_Eddystone_getInstanceId]
666 // [kotlin_Eddystone_getPower]
667 // Get Eddystone power
668 val power = eddystone.power
669 power?.let { println("Eddystone power: $it") }
670 // [kotlin_Eddystone_getPower]
672 // [kotlin_Eddystone_getStatus]
673 // Get Eddystone status
674 val status = eddystone.status
675 println("Eddystone status: $status")
676 // [kotlin_Eddystone_getStatus]
680 * Demonstrate Point class methods
682 fun demonstratePointUsage(point: Point) {
683 // [kotlin_Point_getX]
686 println("Point X: $x")
687 // [kotlin_Point_getX]
689 // [kotlin_Point_getY]
692 println("Point Y: $y")
693 // [kotlin_Point_getY]
697 * Demonstrate Graph class methods
699 fun demonstrateGraphUsage(graph: Graph) {
700 // [kotlin_Graph_getVertices]
701 // Get graph vertices
702 val vertices = graph.vertices
703 println("Number of graph vertices: ${vertices.size}")
704 // [kotlin_Graph_getVertices]
706 // [kotlin_Graph_getEdges]
708 val edges = graph.edges
709 println("Number of graph edges: ${edges.size}")
710 // [kotlin_Graph_getEdges]
714 * Demonstrate GraphVertex class methods
716 fun demonstrateGraphVertexUsage(vertex: GraphVertex) {
717 // [kotlin_GraphVertex_getId]
719 val vertexId = vertex.id
720 println("Vertex ID: $vertexId")
721 // [kotlin_GraphVertex_getId]
723 // [kotlin_GraphVertex_getPoint]
725 val point = vertex.point
726 point?.let { demonstratePointUsage(it) }
727 // [kotlin_GraphVertex_getPoint]
729 // [kotlin_GraphVertex_getName]
731 val name = vertex.name
732 println("Vertex name: $name")
733 // [kotlin_GraphVertex_getName]
735 // [kotlin_GraphVertex_getIsExternal]
736 // Get vertex external flag
737 val isExternal = vertex.isExternal
738 println("Vertex is external: $isExternal")
739 // [kotlin_GraphVertex_getIsExternal]
741 // [kotlin_GraphVertex_getIsElevation]
742 // Get vertex elevation flag
743 val isElevation = vertex.isElevation
744 println("Vertex is elevation: $isElevation")
745 // [kotlin_GraphVertex_getIsElevation]
749 * Demonstrate GraphEdge class methods
751 fun demonstrateGraphEdgeUsage(edge: GraphEdge) {
752 // [kotlin_GraphEdge_getWeight]
754 val weight = edge.weight
755 println("Edge weight: $weight")
756 // [kotlin_GraphEdge_getWeight]
758 // [kotlin_GraphEdge_getDst]
759 // Get destination vertex ID
761 println("Edge destination ID: $dst")
762 // [kotlin_GraphEdge_getDst]
764 // [kotlin_GraphEdge_getSrc]
765 // Get source vertex ID
767 println("Edge source ID: $src")
768 // [kotlin_GraphEdge_getSrc]
770 // [kotlin_GraphEdge_getWeightCoef]
771 // Get edge weight coefficient
772 val weightCoef = edge.weightCoef
773 println("Edge weight coefficient: $weightCoef")
774 // [kotlin_GraphEdge_getWeightCoef]
778 * Demonstrate ElevationGraph class methods
780 fun demonstrateElevationGraphUsage(elevationGraph: ElevationGraph) {
781 // [kotlin_ElevationGraph_getEdges]
782 // Get elevation graph edges
783 val edges = elevationGraph.edges
784 println("Number of elevation graph edges: ${edges.size}")
786 // Demonstrate each edge
787 edges.forEachIndexed { index, edge ->
788 println("Elevation graph edge ${index + 1}:")
789 demonstrateGraphEdgeUsage(edge)
791 // [kotlin_ElevationGraph_getEdges]
795 * Demonstrate TransmitterStatus enum
797 fun demonstrateTransmitterStatus() {
798 // [kotlin_TransmitterStatus_values]
799 // Get all transmitter status values
800 val statuses = TransmitterStatus.values()
801 println("Available transmitter statuses:")
802 statuses.forEach { status ->
803 println(" - $status")
805 // [kotlin_TransmitterStatus_values]
812 locationManager?.let { manager ->
813 locationListener?.let { listener ->
814 // [kotlin_LocationManager_removeLocationListener]
815 // Remove location listener
816 manager.removeLocationListener(listener)
817 // [kotlin_LocationManager_removeLocationListener]
823 * Main demonstration method
826 println("=== LocationManager Example ===")
828 demonstrateLocationManagerMethods()
829 demonstrateTransmitterStatus()
831 // Wait a bit for location to load
835 println("=== Example completed ===")
840 * Function to run the example
843 val example = LocationManagerExample()