Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Verified Commit 8e1a7520 authored by Marvin W.'s avatar Marvin W. 🐿️
Browse files

Add client

parent aff82ab9
Loading
Loading
Loading
Loading

client/build.gradle

0 → 100644
+74 −0
Original line number Diff line number Diff line
/*
 * SPDX-FileCopyrightText: 2019, microG Project Team
 * SPDX-License-Identifier: Apache-2.0
 */

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'maven-publish'

android {
    compileSdkVersion androidCompileSdk
    buildToolsVersion "$androidBuildVersionTools"

    defaultConfig {
        versionName version
        minSdkVersion androidMinSdk
        targetSdkVersion androidTargetSdk
    }

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    compileOptions {
        sourceCompatibility = 1.8
        targetCompatibility = 1.8
    }
}
repositories {
    mavenCentral()
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutineVersion"
}

afterEvaluate {
    publishing {
        publications {
            release(MavenPublication) {
                pom {
                    name = 'UnifiedNlp Client'
                    description = 'UnifiedNlp client library'
                    url = 'https://github.com/microg/UnifiedNlp'
                    licenses {
                        license {
                            name = 'The Apache Software License, Version 2.0'
                            url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
                        }
                    }
                    developers {
                        developer {
                            id = 'microg'
                            name = 'microG Team'
                        }
                        developer {
                            id = 'mar-v-in'
                            name = 'Marvin W.'
                        }
                    }
                    scm {
                        url = 'https://github.com/microg/UnifiedNlp'
                        connection = 'scm:git:https://github.com/microg/UnifiedNlp.git'
                        developerConnection = 'scm:git:ssh://github.com/microg/UnifiedNlp.git'
                    }
                }

                from components.release
            }
        }
    }
}
+13 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ SPDX-FileCopyrightText: 2019, microG Project Team
  ~ SPDX-License-Identifier: Apache-2.0
  -->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="org.microg.nlp.client">

    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

    <application />
</manifest>
+12 −0
Original line number Diff line number Diff line
/*
 * SPDX-FileCopyrightText: 2020, microG Project Team
 * SPDX-License-Identifier: Apache-2.0
 */

package org.microg.nlp.service;

import android.location.Location;

interface AddressCallback {
    void onResult(in List<Address> location);
}
+12 −0
Original line number Diff line number Diff line
/*
 * SPDX-FileCopyrightText: 2019, microG Project Team
 * SPDX-License-Identifier: Apache-2.0
 */

package org.microg.nlp.service;

import android.location.Location;

interface LocationCallback {
    void onLocationUpdate(in Location location);
}
+31 −0
Original line number Diff line number Diff line
/*
 * SPDX-FileCopyrightText: 2019, microG Project Team
 * SPDX-License-Identifier: Apache-2.0
 */

package org.microg.nlp.service;

import android.location.Location;
import org.microg.nlp.service.AddressCallback;
import org.microg.nlp.service.LocationCallback;

interface UnifiedLocationService {
    void registerLocationCallback(LocationCallback callback, in Bundle options);
    void setUpdateInterval(long interval, in Bundle options);
    void requestSingleUpdate(in Bundle options);

    void getFromLocationWithOptions(double latitude, double longitude, int maxResults,
        String locale, in Bundle options, AddressCallback callback);
    void getFromLocationNameWithOptions(String locationName, int maxResults,
        double lowerLeftLatitude, double lowerLeftLongitude, double upperRightLatitude,
        double upperRightLongitude, String locale, in Bundle options, AddressCallback callback);

    void reloadPreferences();
    String[] getLocationBackends();
    void setLocationBackends(in String[] backends);
    String[] getGeocoderBackends();
    void setGeocoderBackends(in String[] backends);

    Location getLastLocation();
    Location getLastLocationForBackend(String packageName, String className, String signatureDigest);
}
Loading