All Projects → line → abc-kmm-location

line / abc-kmm-location

Licence: Apache-2.0 license
Location Service Manager for Kotlin Multiplatform Mobile iOS and Android

Programming Languages

kotlin
9241 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to abc-kmm-location

moko-geo
Geolocation access for mobile (android & ios) Kotlin Multiplatform development
Stars: ✭ 41 (-25.45%)
Mutual labels:  kotlin-multiplatform
Scout
Scout is a kotlin multiplatform application that allows users to search and save games to lists to be browsed later.
Stars: ✭ 28 (-49.09%)
Mutual labels:  kotlin-multiplatform
kotlin-no-backend
Lista de empresas que utilizam Kotlin no Brasil.
Stars: ✭ 46 (-16.36%)
Mutual labels:  kotlin-multiplatform
MRTScheduleSwiftUI
MRT Schedule & Locator iOS App built using SwiftUI
Stars: ✭ 32 (-41.82%)
Mutual labels:  corelocation
LinuxCommandLibrary
1M+ downloads Linux reference app with basics, tips and formatted man pages
Stars: ✭ 333 (+505.45%)
Mutual labels:  kotlin-multiplatform
mobius.kt
Kotlin Multiplatform framework for managing state evolution and side-effects
Stars: ✭ 39 (-29.09%)
Mutual labels:  kotlin-multiplatform
Restaurant-Viewing-App
Build A Restaurant Viewing App in Swift 4.2
Stars: ✭ 43 (-21.82%)
Mutual labels:  corelocation
kiwi
Fluent assertions for Kotlin
Stars: ✭ 17 (-69.09%)
Mutual labels:  kotlin-multiplatform
StarWars
Minimal GraphQL based Jetpack Compose, Wear Compose and SwiftUI Kotlin Multiplatform sample (using StarWars endpoint - https://graphql.org/swapi-graphql)
Stars: ✭ 165 (+200%)
Mutual labels:  kotlin-multiplatform
MultiplatformPlayground
Kotlin Multiplatform project in Jetpack Compose & SwiftUI with shared ViewModel layer and File upload
Stars: ✭ 72 (+30.91%)
Mutual labels:  kotlin-multiplatform
KParser
Kotlin Multiplatform Arithmatic Parser
Stars: ✭ 32 (-41.82%)
Mutual labels:  kotlin-multiplatform
serialization-parcelable
Android Parcelable support for the Kotlinx Serialization library.
Stars: ✭ 53 (-3.64%)
Mutual labels:  kotlin-multiplatform
KotlinXcodeSync
Sync Kotlin files with an Xcode project
Stars: ✭ 25 (-54.55%)
Mutual labels:  kotlin-multiplatform
D-KMP-sample
D-KMP Architecture official sample: it uses a shared KMP ViewModel and Navigation for Compose and SwiftUI apps.
Stars: ✭ 636 (+1056.36%)
Mutual labels:  kotlin-multiplatform
KMQTT
Embeddable and standalone Kotlin Multiplatform MQTT broker
Stars: ✭ 56 (+1.82%)
Mutual labels:  kotlin-multiplatform
Arkit Corelocation
Combines the high accuracy of AR with the scale of GPS data.
Stars: ✭ 5,045 (+9072.73%)
Mutual labels:  corelocation
kmm-production-sample
This is an open-source, mobile, cross-platform application built with Kotlin Multiplatform Mobile. It's a simple RSS reader, and you can download it from the App Store and Google Play. It's been designed to demonstrate how KMM can be used in real production projects.
Stars: ✭ 1,476 (+2583.64%)
Mutual labels:  kotlin-multiplatform
geok
Kotlin geometry library
Stars: ✭ 29 (-47.27%)
Mutual labels:  kotlin-multiplatform
chords
A Kotlin multi-platform view library for displaying stringed instrument chord diagrams
Stars: ✭ 25 (-54.55%)
Mutual labels:  kotlin-multiplatform
CompleteKotlin
Gradle Plugin to enable auto-completion and symbol resolution for all Kotlin/Native platforms.
Stars: ✭ 236 (+329.09%)
Mutual labels:  kotlin-multiplatform

abc-kmm-location: Location Service Manager for Kotlin Multiplatform Mobile iOS and android

Kotlin KMM AGP Gradle Platform

Location Service Manager for Kotlin Multiplatform Mobile iOS and android

Features

  • Super easy to use location capability in one interface
  • Provides simple permission settings and management
  • Dramatically reduce code to write
  • Common interface available on KMM Shared

Usage

Register handlers for permissions

  • Android

    ABCLocation
        .onPermissionUpdated(this) { isGranted ->
            println("onPermissionUpdated -> isGranted: $isGranted")
        }
        .onLocationUnavailable(this) {
            println("onLocationUnavailable")
        }
  • iOS

    ABCLocation.Companion()
        .onPermissionUpdated(target: self) { isGranted ->
            print("onPermissionUpdated -> isGranted: \(isGranted)")
        }
        .onLocationUnavailable(target: self) {
            print("onLocationUnavailable")
        }
        .onAlwaysAllowsPermissionRequired(target: self) {
            print("onAlwaysAllowsPermissionRequired")
        }

To get current location just once

  • Android

    ABCLocation.currentLocation { data ->
        println("currentLocation -> data: $data")
    }
  • iOS

    ABCLocation.Companion().currentLocation { data in
        print("currentLocation -> data: \(data)")
    }

To get current location whenever location changes

  • Android

    ABCLocation
        .onLocationUpdated(this) { data ->
            println("onLocationUpdated -> data: $data")
        }
        .startLocationUpdating()
  • iOS

    ABCLocation.Companion()
        .onLocationUpdated(target: self) { data in
            print("onLocationUpdated -> data: \(data)")
        }
        .startLocationUpdating()

To stop location updating

  • Android

    ABCLocation.stopLocationUpdating()
  • iOS

    ABCLocation.Companion().stopLocationUpdating()

Installation

Gradle Settings

Add below gradle settings into your KMP (Kotlin Multiplatform Project)

build.gradle.kts in shared

plugins {
    id("com.android.library")
    kotlin("multiplatform")
}

val abcLocationLib = "com.linecorp.abc:kmm-location:0.2.4"

kotlin {
    android()
    ios {
        binaries
            .filterIsInstance<Framework>()
            .forEach {
                it.baseName = "shared"
                it.transitiveExport = true
                it.export(abcLocationLib)
            }
    }

    sourceSets {
        val commonMain by getting {
            dependencies {
                implementation(abcLocationLib)
            }
        }
        val commonTest by getting {
            dependencies {
                implementation(kotlin("test-common"))
                implementation(kotlin("test-annotations-common"))
            }
        }
        val androidMain by getting {
            dependencies {
                implementation("com.google.android.material:material:1.2.1")
                implementation(abcLocationLib)
            }
        }
        val androidTest by getting {
            dependencies {
                implementation(kotlin("test-junit"))
                implementation("junit:junit:4.13.2")
                implementation("androidx.test:core:1.0.0")
                implementation("androidx.test:runner:1.1.0")
                implementation("org.robolectric:robolectric:4.2")
            }
        }
        val iosMain by getting {
            dependencies {
                implementation(abcLocationLib)
            }
        }
        val iosTest by getting
    }
}

Project Settings

Android

  • You can use right now without other settings.

iOS

  1. Create Podfile with below setting in your project root.
use_frameworks!

platform :ios, '10.0'

install! 'cocoapods', :deterministic_uuids => false

target 'iosApp' do
    pod 'shared', :path => '../shared/'
end
  1. Run command pod install on the terminal

Requirements

  • iOS
    • Deployment Target 10.0 or higher
  • Android
    • minSdkVersion 21
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].