Fix android project and remove some files

This commit is contained in:
Maximilian Ammann 2022-04-24 12:22:27 +02:00
parent 8a1fa88dc9
commit 481629bb90
35 changed files with 23 additions and 82 deletions

View File

@ -1 +1 @@
maplibre-rs
maplibre-rs-android

View File

@ -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>

View File

@ -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>

View File

@ -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)
}
}

View File

@ -1,9 +0,0 @@
package com.example.demo;
public class MapLibre {
public static native void android_main();
static {
System.loadLibrary("maplibre_android");
}
}

View File

@ -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)
}
}

View File

@ -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>

View File

@ -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()
}
}

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Before

Width:  |  Height:  |  Size: 982 B

After

Width:  |  Height:  |  Size: 982 B

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -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());
}
}

View File

@ -1,6 +1,6 @@
package org.maplibre_rs;
public class MapLibreRsJava {
public class MapLibreRs {
public static native void android_main();
static {

View File

@ -1,11 +0,0 @@
package org.maplibre_rs
class MapLibreRs {
companion object {
@JvmStatic fun android_main() {}
init {
System.loadLibrary("maplibre_android")
}
}
}

View File

@ -16,6 +16,6 @@ dependencyResolutionManagement {
}
}
rootProject.name = "maplibre-rs"
include ':app'
rootProject.name = "maplibre-rs-android"
include ':demo'
include ':lib'

View File

@ -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();
}