File tree Expand file tree Collapse file tree 3 files changed +22
-6
lines changed
android_pythonnative_3/app/src/main/java/com/pythonnative/pythonnative
templates/android_template Expand file tree Collapse file tree 3 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -36,17 +36,17 @@ class MainActivity : AppCompatActivity() {
3636// val pyButton = createButtonModule.callAttr("create_button", this).toJava(Button::class.java)
3737// layoutMain.addView(pyButton)
3838
39- // val createWidgetsModule = py.getModule("create_widgets")
40- // val pyLayout = createWidgetsModule.callAttr("create_widgets", this).toJava(LinearLayout::class.java)
41- // layoutMain.addView(pyLayout)
39+ val createWidgetsModule = py.getModule(" create_widgets" )
40+ val pyLayout = createWidgetsModule.callAttr(" create_widgets" , this ).toJava(LinearLayout ::class .java)
41+ layoutMain.addView(pyLayout)
4242
4343// val createConstraintLayoutModule = py.getModule("create_constraint_layout")
4444// val pyLayout = createConstraintLayoutModule.callAttr("create_constraint_layout", this).toJava(ConstraintLayout::class.java)
4545// layoutMain.addView(pyLayout)
4646
47- val createRecyclerViewModule = py.getModule(" create_recycler_view" )
48- val pyRecyclerView = createRecyclerViewModule.callAttr(" create_recycler_view" , this ).toJava(RecyclerView ::class .java)
49- layoutMain.addView(pyRecyclerView)
47+ // val createRecyclerViewModule = py.getModule("create_recycler_view")
48+ // val pyRecyclerView = createRecyclerViewModule.callAttr("create_recycler_view", this).toJava(RecyclerView::class.java)
49+ // layoutMain.addView(pyRecyclerView)
5050
5151 // Existing code for displaying plot
5252// val imageView = findViewById<ImageView>(R.id.image_home)
Original file line number Diff line number Diff line change 11plugins {
22 id ' com.android.application'
33 id ' org.jetbrains.kotlin.android'
4+ id ' com.chaquo.python'
45}
56
67android {
@@ -15,6 +16,20 @@ android {
1516 versionName " 1.0"
1617
1718 testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
19+ ndk {
20+ abiFilters " armeabi-v7a" , " arm64-v8a" , " x86" , " x86_64"
21+ }
22+ python {
23+ version " 3.8"
24+ pip {
25+ install " matplotlib"
26+ install " pythonnative"
27+
28+ // "-r"` followed by a requirements filename, relative to the
29+ // project directory:
30+ // install "-r", "requirements.txt"
31+ }
32+ }
1833 }
1934
2035 buildTypes {
Original file line number Diff line number Diff line change @@ -3,4 +3,5 @@ plugins {
33 id ' com.android.application' version ' 8.0.2' apply false
44 id ' com.android.library' version ' 8.0.2' apply false
55 id ' org.jetbrains.kotlin.android' version ' 1.8.20' apply false
6+ id ' com.chaquo.python' version ' 14.0.2' apply false
67}
You can’t perform that action at this time.
0 commit comments