comparison android/DWindows.kt @ 2473:aa420e366b2b

Android: Initial skeletal commit for Android support, almost nothing implemented... but this should be a framework for adding Android support via JNI/NDK.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 18 Apr 2021 01:28:55 +0000
parents
children a13e6db064f4
comparison
equal deleted inserted replaced
2472:206a0643add6 2473:aa420e366b2b
1 package org.dbsoft.dwindows.dwtest
2
3 import androidx.appcompat.app.AppCompatActivity
4 import android.os.Bundle
5 import android.widget.TextView
6
7 class DWindows : AppCompatActivity() {
8 override fun onCreate(savedInstanceState: Bundle?) {
9 super.onCreate(savedInstanceState)
10 setContentView(R.layout.dwindows_main)
11
12 // Example of a call to a native method
13 findViewById<TextView>(R.id.sample_text).text = stringFromJNI()
14 }
15
16 /**
17 * A native method that is implemented by the 'dwindows' native library,
18 * which is packaged with this application.
19 */
20 external fun stringFromJNI(): String
21
22 companion object {
23 // Used to load the 'dwindows' library on application startup.
24 init {
25 System.loadLibrary("dwindows")
26 }
27 }
28 }