I am trying to se python in android studio as a backend code for working on variables and producing answer. My MainActivity is in Java and a directory is created for python code. when I try to write code in python is tells that "no python interpreter configured for the module" I have added Chaquopy and Python Community Plugin. Also I want to know how can I send variables for my MainActivity to python and viceversa.
I am trying to add python in android studio. I have tried Chaquopy and also Python Community Plugin. I have tried to find answers on different places and guides too. But no Luck till now.
buildscript {
repositories {
google()
jcenter()
maven{url "https://chaquo.com/maven"}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
classpath "com.chaquo.python:gradle:0.5.0"
}
}
this is MainActivity and I want to send my variable "a" to python file to work on it.
package com.example.testingpython;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
int a=2;
String[] array={"My","Name","Java"};
}
}