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_getReferencePoints]
303 // Get reference points
304 val referencePoints = sublocation.referencePoints
305 println("Number of reference points: ${referencePoints.size}")
306 // [kotlin_Sublocation_getReferencePoints]
308 // [kotlin_Sublocation_getVenues]
310 val venues = sublocation.venues
311 println("Number of venues: ${venues.size}")
312 // [kotlin_Sublocation_getVenues]
314 // [kotlin_Sublocation_getZones]
316 val zones = sublocation.zones
317 println("Number of zones: ${zones.size}")
318 // [kotlin_Sublocation_getZones]
320 // [kotlin_Sublocation_getBeacons]
322 val beacons = sublocation.beacons
323 println("Number of beacons: ${beacons.size}")
324 // [kotlin_Sublocation_getBeacons]
326 // [kotlin_Sublocation_getWifis]
327 // Get WiFi access points
328 val wifis = sublocation.wifis
329 println("Number of WiFi access points: ${wifis.size}")
330 // [kotlin_Sublocation_getWifis]
332 // [kotlin_Sublocation_getEddystones]
333 // Get Eddystone beacons
334 val eddystones = sublocation.eddystones
335 println("Number of Eddystone beacons: ${eddystones.size}")
336 // [kotlin_Sublocation_getEddystones]
338 // [kotlin_Sublocation_getGraph]
340 val graph = sublocation.graph
341 graph?.let { demonstrateGraphUsage(it) }
342 // [kotlin_Sublocation_getGraph]
344 // [kotlin_Sublocation_getGraph_withTag]
346 val graphByTag = sublocation.getGraph("main")
348 println("Found graph with tag \"main\"")
349 demonstrateGraphUsage(it)
351 // [kotlin_Sublocation_getGraph_withTag]
353 // [kotlin_Sublocation_getVenueById]
355 if (venues.isNotEmpty()) {
356 val venueById = sublocation.getVenueById(venues.first().id)
358 println("Found venue by ID: ${it.id}")
359 demonstrateVenueUsage(it)
362 // [kotlin_Sublocation_getVenueById]
364 // [kotlin_Sublocation_getZoneById]
366 if (zones.isNotEmpty()) {
367 val zoneById = sublocation.getZoneById(zones.first().id)
369 println("Found zone by ID: ${it.id}")
370 demonstrateZoneUsage(it)
373 // [kotlin_Sublocation_getZoneById]
375 // [kotlin_Sublocation_globalToLocal]
376 // Convert global coordinates to local coordinates
377 val globalPoint = GlobalPoint(55.7558, 37.6176) // Moscow coordinates
378 val localPoint = sublocation.globalToLocal(globalPoint)
379 println("Global point ${globalPoint.lat}, ${globalPoint.lon} converted to local: ${localPoint.x}, ${localPoint.y}")
380 // [kotlin_Sublocation_globalToLocal]
382 // [kotlin_Sublocation_localToGlobal]
383 // Convert local coordinates to global coordinates
384 val localPoint2 = LocationPoint(100.0, 200.0)
385 val globalPoint2 = sublocation.localToGlobal(localPoint2)
386 println("Local point ${localPoint2.x}, ${localPoint2.y} converted to global: ${globalPoint2.lat}, ${globalPoint2.lon}")
387 // [kotlin_Sublocation_localToGlobal]
389 // [kotlin_Sublocation_getImage]
390 // Get sublocation image
391 val image = sublocation.getImage(1024) // max texture size 1024
392 image?.let { println("Sublocation image obtained with max texture size 1024") }
393 // [kotlin_Sublocation_getImage]
397 * Demonstrate Venue class methods
399 fun demonstrateVenueUsage(venue: Venue) {
400 // [kotlin_Venue_getId]
402 val venueId = venue.id
403 println("Venue ID: $venueId")
404 // [kotlin_Venue_getId]
406 // [kotlin_Venue_getLocationId]
407 // Get venue location ID
408 val locationId = venue.locationId
409 println("Venue location ID: $locationId")
410 // [kotlin_Venue_getLocationId]
412 // [kotlin_Venue_getSublocationId]
413 // Get venue sublocation ID
414 val sublocationId = venue.sublocationId
415 println("Venue sublocation ID: $sublocationId")
416 // [kotlin_Venue_getSublocationId]
418 // [kotlin_Venue_getName]
420 val venueName = venue.name
421 println("Venue name: $venueName")
422 // [kotlin_Venue_getName]
424 // [kotlin_Venue_getPhone]
426 val phone = venue.phone
427 println("Venue phone: $phone")
428 // [kotlin_Venue_getPhone]
430 // [kotlin_Venue_getDescript]
431 // Get venue description
432 val venueDescription = venue.descript
433 println("Venue description: $venueDescription")
434 // [kotlin_Venue_getDescript]
436 // [kotlin_Venue_getAlias]
438 val alias = venue.alias
439 println("Venue alias: $alias")
440 // [kotlin_Venue_getAlias]
442 // [kotlin_Venue_getCategoryId]
444 val categoryId = venue.categoryId
445 println("Venue category ID: $categoryId")
446 // [kotlin_Venue_getCategoryId]
448 // [kotlin_Venue_getImageUrl]
449 // Get venue image URL
450 val imageUrl = venue.imageUrl
451 imageUrl?.let { println("Venue image URL: $it") }
452 // [kotlin_Venue_getImageUrl]
454 // [kotlin_Venue_getPoint]
456 val point = venue.point
457 point?.let { demonstratePointUsage(it) }
458 // [kotlin_Venue_getPoint]
462 * Demonstrate Zone class methods
464 fun demonstrateZoneUsage(zone: Zone) {
465 // [kotlin_Zone_getId]
468 println("Zone ID: $zoneId")
469 // [kotlin_Zone_getId]
471 // [kotlin_Zone_getLocationId]
472 // Get zone location ID
473 val locationId = zone.locationId
474 println("Zone location ID: $locationId")
475 // [kotlin_Zone_getLocationId]
477 // [kotlin_Zone_getSublocationId]
478 // Get zone sublocation ID
479 val sublocationId = zone.sublocationId
480 println("Zone sublocation ID: $sublocationId")
481 // [kotlin_Zone_getSublocationId]
483 // [kotlin_Zone_getName]
485 val zoneName = zone.name
486 println("Zone name: $zoneName")
487 // [kotlin_Zone_getName]
489 // [kotlin_Zone_getDescript]
490 // Get zone description
491 val zoneDescription = zone.descript
492 println("Zone description: $zoneDescription")
493 // [kotlin_Zone_getDescript]
495 // [kotlin_Zone_getCategoryId]
497 val categoryId = zone.categoryId
498 println("Zone category ID: $categoryId")
499 // [kotlin_Zone_getCategoryId]
501 // [kotlin_Zone_getAlias]
503 val alias = zone.alias
504 println("Zone alias: $alias")
505 // [kotlin_Zone_getAlias]
507 // [kotlin_Zone_getColor]
509 val color = zone.color
510 println("Zone color: $color")
511 // [kotlin_Zone_getColor]
513 // [kotlin_Zone_getPolygon]
515 val polygon = zone.polygon
516 println("Zone polygon points: ${polygon.size}")
517 // [kotlin_Zone_getPolygon]
521 * Demonstrate Beacon class methods
523 fun demonstrateBeaconUsage(beacon: Beacon) {
524 // [kotlin_Beacon_getPoint]
526 val point = beacon.point
527 point?.let { demonstratePointUsage(it) }
528 // [kotlin_Beacon_getPoint]
530 // [kotlin_Beacon_getLocationId]
531 // Get beacon location ID
532 val locationId = beacon.locationId
533 println("Beacon location ID: $locationId")
534 // [kotlin_Beacon_getLocationId]
536 // [kotlin_Beacon_getSublocationId]
537 // Get beacon sublocation ID
538 val sublocationId = beacon.sublocationId
539 println("Beacon sublocation ID: $sublocationId")
540 // [kotlin_Beacon_getSublocationId]
542 // [kotlin_Beacon_getName]
544 val beaconName = beacon.name
545 println("Beacon name: $beaconName")
546 // [kotlin_Beacon_getName]
548 // [kotlin_Beacon_getMajor]
550 val major = beacon.major
551 println("Beacon major: $major")
552 // [kotlin_Beacon_getMajor]
554 // [kotlin_Beacon_getMinor]
556 val minor = beacon.minor
557 println("Beacon minor: $minor")
558 // [kotlin_Beacon_getMinor]
560 // [kotlin_Beacon_getUuid]
562 val uuid = beacon.uuid
563 println("Beacon UUID: $uuid")
564 // [kotlin_Beacon_getUuid]
566 // [kotlin_Beacon_getPower]
568 val power = beacon.power
569 power?.let { println("Beacon power: $it") }
570 // [kotlin_Beacon_getPower]
572 // [kotlin_Beacon_getStatus]
574 val status = beacon.status
575 println("Beacon status: $status")
576 // [kotlin_Beacon_getStatus]
580 * Demonstrate Wifi class methods
582 fun demonstrateWifiUsage(wifi: Wifi) {
583 // [kotlin_Wifi_getPoint]
585 val point = wifi.point
586 point?.let { demonstratePointUsage(it) }
587 // [kotlin_Wifi_getPoint]
589 // [kotlin_Wifi_getLocationId]
590 // Get WiFi location ID
591 val locationId = wifi.locationId
592 println("WiFi location ID: $locationId")
593 // [kotlin_Wifi_getLocationId]
595 // [kotlin_Wifi_getSublocationId]
596 // Get WiFi sublocation ID
597 val sublocationId = wifi.sublocationId
598 println("WiFi sublocation ID: $sublocationId")
599 // [kotlin_Wifi_getSublocationId]
601 // [kotlin_Wifi_getName]
603 val wifiName = wifi.name
604 println("WiFi name: $wifiName")
605 // [kotlin_Wifi_getName]
607 // [kotlin_Wifi_getMac]
608 // Get WiFi MAC address
610 println("WiFi MAC: $mac")
611 // [kotlin_Wifi_getMac]
613 // [kotlin_Wifi_getStatus]
615 val status = wifi.status
616 println("WiFi status: $status")
617 // [kotlin_Wifi_getStatus]
621 * Demonstrate Eddystone class methods
623 fun demonstrateEddystoneUsage(eddystone: Eddystone) {
624 // [kotlin_Eddystone_getPoint]
625 // Get Eddystone point
626 val point = eddystone.point
627 point?.let { demonstratePointUsage(it) }
628 // [kotlin_Eddystone_getPoint]
630 // [kotlin_Eddystone_getLocationId]
631 // Get Eddystone location ID
632 val locationId = eddystone.locationId
633 println("Eddystone location ID: $locationId")
634 // [kotlin_Eddystone_getLocationId]
636 // [kotlin_Eddystone_getSublocationId]
637 // Get Eddystone sublocation ID
638 val sublocationId = eddystone.sublocationId
639 println("Eddystone sublocation ID: $sublocationId")
640 // [kotlin_Eddystone_getSublocationId]
642 // [kotlin_Eddystone_getName]
643 // Get Eddystone name
644 val eddystoneName = eddystone.name
645 println("Eddystone name: $eddystoneName")
646 // [kotlin_Eddystone_getName]
648 // [kotlin_Eddystone_getNamespaceId]
649 // Get Eddystone namespace ID
650 val namespaceId = eddystone.namespaceId
651 println("Eddystone namespace ID: $namespaceId")
652 // [kotlin_Eddystone_getNamespaceId]
654 // [kotlin_Eddystone_getInstanceId]
655 // Get Eddystone instance ID
656 val instanceId = eddystone.instanceId
657 println("Eddystone instance ID: $instanceId")
658 // [kotlin_Eddystone_getInstanceId]
660 // [kotlin_Eddystone_getPower]
661 // Get Eddystone power
662 val power = eddystone.power
663 power?.let { println("Eddystone power: $it") }
664 // [kotlin_Eddystone_getPower]
666 // [kotlin_Eddystone_getStatus]
667 // Get Eddystone status
668 val status = eddystone.status
669 println("Eddystone status: $status")
670 // [kotlin_Eddystone_getStatus]
674 * Demonstrate Point class methods
676 fun demonstratePointUsage(point: Point) {
677 // [kotlin_Point_getX]
680 println("Point X: $x")
681 // [kotlin_Point_getX]
683 // [kotlin_Point_getY]
686 println("Point Y: $y")
687 // [kotlin_Point_getY]
691 * Demonstrate Graph class methods
693 fun demonstrateGraphUsage(graph: Graph) {
694 // [kotlin_Graph_getVertices]
695 // Get graph vertices
696 val vertices = graph.vertices
697 println("Number of graph vertices: ${vertices.size}")
698 // [kotlin_Graph_getVertices]
700 // [kotlin_Graph_getEdges]
702 val edges = graph.edges
703 println("Number of graph edges: ${edges.size}")
704 // [kotlin_Graph_getEdges]
708 * Demonstrate GraphVertex class methods
710 fun demonstrateGraphVertexUsage(vertex: GraphVertex) {
711 // [kotlin_GraphVertex_getId]
713 val vertexId = vertex.id
714 println("Vertex ID: $vertexId")
715 // [kotlin_GraphVertex_getId]
717 // [kotlin_GraphVertex_getPoint]
719 val point = vertex.point
720 point?.let { demonstratePointUsage(it) }
721 // [kotlin_GraphVertex_getPoint]
723 // [kotlin_GraphVertex_getName]
725 val name = vertex.name
726 println("Vertex name: $name")
727 // [kotlin_GraphVertex_getName]
729 // [kotlin_GraphVertex_getIsExternal]
730 // Get vertex external flag
731 val isExternal = vertex.isExternal
732 println("Vertex is external: $isExternal")
733 // [kotlin_GraphVertex_getIsExternal]
735 // [kotlin_GraphVertex_getIsElevation]
736 // Get vertex elevation flag
737 val isElevation = vertex.isElevation
738 println("Vertex is elevation: $isElevation")
739 // [kotlin_GraphVertex_getIsElevation]
743 * Demonstrate GraphEdge class methods
745 fun demonstrateGraphEdgeUsage(edge: GraphEdge) {
746 // [kotlin_GraphEdge_getWeight]
748 val weight = edge.weight
749 println("Edge weight: $weight")
750 // [kotlin_GraphEdge_getWeight]
752 // [kotlin_GraphEdge_getDst]
753 // Get destination vertex ID
755 println("Edge destination ID: $dst")
756 // [kotlin_GraphEdge_getDst]
758 // [kotlin_GraphEdge_getSrc]
759 // Get source vertex ID
761 println("Edge source ID: $src")
762 // [kotlin_GraphEdge_getSrc]
764 // [kotlin_GraphEdge_getWeightCoef]
765 // Get edge weight coefficient
766 val weightCoef = edge.weightCoef
767 println("Edge weight coefficient: $weightCoef")
768 // [kotlin_GraphEdge_getWeightCoef]
772 * Demonstrate ElevationGraph class methods
774 fun demonstrateElevationGraphUsage(elevationGraph: ElevationGraph) {
775 // [kotlin_ElevationGraph_getEdges]
776 // Get elevation graph edges
777 val edges = elevationGraph.edges
778 println("Number of elevation graph edges: ${edges.size}")
780 // Demonstrate each edge
781 edges.forEachIndexed { index, edge ->
782 println("Elevation graph edge ${index + 1}:")
783 demonstrateGraphEdgeUsage(edge)
785 // [kotlin_ElevationGraph_getEdges]
789 * Demonstrate TransmitterStatus enum
791 fun demonstrateTransmitterStatus() {
792 // [kotlin_TransmitterStatus_values]
793 // Get all transmitter status values
794 val statuses = TransmitterStatus.values()
795 println("Available transmitter statuses:")
796 statuses.forEach { status ->
797 println(" - $status")
799 // [kotlin_TransmitterStatus_values]
806 locationManager?.let { manager ->
807 locationListener?.let { listener ->
808 // [kotlin_LocationManager_removeLocationListener]
809 // Remove location listener
810 manager.removeLocationListener(listener)
811 // [kotlin_LocationManager_removeLocationListener]
817 * Main demonstration method
820 println("=== LocationManager Example ===")
822 demonstrateLocationManagerMethods()
823 demonstrateTransmitterStatus()
825 // Wait a bit for location to load
829 println("=== Example completed ===")
834 * Function to run the example
837 val example = LocationManagerExample()