Fix android project and remove some files
2
android/gradle/.idea/.name
generated
@ -1 +1 @@
|
||||
maplibre-rs
|
||||
maplibre-rs-android
|
||||
2
android/gradle/.idea/gradle.xml
generated
@ -12,7 +12,7 @@
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
<option value="$PROJECT_DIR$/demo" />
|
||||
<option value="$PROJECT_DIR$/lib" />
|
||||
</set>
|
||||
</option>
|
||||
|
||||
7
android/gradle/.idea/misc.xml
generated
@ -1,5 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DesignSurface">
|
||||
<option name="filePathToZoomLevelMap">
|
||||
<map>
|
||||
<entry key="app/src/main/res/layout/activity_main.xml" value="0.296195652173913" />
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK" />
|
||||
</project>
|
||||
@ -1,24 +0,0 @@
|
||||
package com.example.demo
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class ExampleInstrumentedTest {
|
||||
@Test
|
||||
fun useAppContext() {
|
||||
// Context of the app under test.
|
||||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
||||
assertEquals("com.example.demo", appContext.packageName)
|
||||
}
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
package com.example.demo;
|
||||
|
||||
public class MapLibre {
|
||||
public static native void android_main();
|
||||
|
||||
static {
|
||||
System.loadLibrary("maplibre_android");
|
||||
}
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
package com.example.demo
|
||||
|
||||
import org.junit.Test
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
class ExampleUnitTest {
|
||||
@Test
|
||||
fun addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2)
|
||||
}
|
||||
}
|
||||
@ -2,8 +2,8 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.example.demo">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
@ -26,13 +26,8 @@
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".MainActivity">
|
||||
<!-- <intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<activity android:name=".MainActivity" android:exported="true">
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter> -->
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
@ -2,11 +2,14 @@ package com.example.demo
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
import org.maplibre_rs.MapLibreRs
|
||||
|
||||
// Currently not used. Instead the NativeActivity referenced in AndroidManifest.xml is used.
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_main)
|
||||
MapLibre.android_main()
|
||||
MapLibreRs.android_main()
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 982 B After Width: | Height: | Size: 982 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
@ -1,9 +1,8 @@
|
||||
package org.maplibre_rs;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.test.InstrumentationRegistry;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import androidx.test.InstrumentationRegistry;
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@ -21,6 +20,6 @@ public class ExampleInstrumentedTest {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getTargetContext();
|
||||
|
||||
assertEquals("com.nishtahir.library.test", appContext.getPackageName());
|
||||
assertEquals("org.maplibre_rs", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package org.maplibre_rs;
|
||||
|
||||
public class MapLibreRsJava {
|
||||
public class MapLibreRs {
|
||||
public static native void android_main();
|
||||
|
||||
static {
|
||||
@ -1,11 +0,0 @@
|
||||
package org.maplibre_rs
|
||||
|
||||
class MapLibreRs {
|
||||
companion object {
|
||||
@JvmStatic fun android_main() {}
|
||||
|
||||
init {
|
||||
System.loadLibrary("maplibre_android")
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -16,6 +16,6 @@ dependencyResolutionManagement {
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = "maplibre-rs"
|
||||
include ':app'
|
||||
rootProject.name = "maplibre-rs-android"
|
||||
include ':demo'
|
||||
include ':lib'
|
||||
|
||||
@ -21,10 +21,8 @@ pub fn android_main() {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "system" fn Java_com_example_demo_MapLibre_android_1main(env: JNIEnv, class: JClass) {
|
||||
pub extern "system" fn Java_org_maplibre_1rs_MapLibreRs_android_1main(env: JNIEnv, class: JClass) {
|
||||
let tag = CString::new("maplibre").unwrap();
|
||||
let message = CString::new("maplibre WOORKING").unwrap();
|
||||
ndk_glue::android_log(Level::Warn, &tag, &message);
|
||||
|
||||
//android_main();
|
||||
}
|
||||
|
||||