In my project, I tried to write a code using Chaquopy to add a folder to Android when running the program. Everything is correct and it does not give any error but nothing is added.
here is my MainActivity code
package com.example.use_chaquopy;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Bundle;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import com.chaquo.python.Python;
import com.chaquo.python.android.AndroidPlatform;
public class MainActivity extends AppCompatActivity {
Context context = this;
@SuppressLint("SetTextI18n")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView t1 = findViewById(R.id.t);
if (! Python.isStarted()) {
Python.start(new AndroidPlatform(context));
}
if (Python.isStarted()) {
t1.setText("python is start");
}
}
}
and this id python script
import os
os.mkdir("loolmkkukj")
What's wrong?