user2129623
user2129623

Reputation: 2257

Implementing Python functionality in Android application

I have created one project which has machine learning and Signal processing functionality.

This project is running on server without any issue. My android device making API call to server and getting response.

I want this functionality to be run offline (Without Internet) without calling to remote API.

What are the possible way to run to Python functionality in the Android application?

Writing entire application in Java is not feasible because it depends on many python libraries like numpy, scipy, pandas, sklearn etc.

Upvotes: 1

Views: 177

Answers (3)

Dmitry Yablokov
Dmitry Yablokov

Reputation: 176

It is possible to use python for android project https://github.com/kivy/python-for-android. For rooted device or system app it is possible to launch python interpreter (compiled binaries) as a separate process with script as a parameter

Upvotes: 1

max_sargent
max_sargent

Reputation: 71

You can try Chaquopy, it allows intermixing of Python, Java and Kotlin. Furthermore it allows the use of cheeseshop (PyPi) packages such as the one you described.

You should be able to integrate your existing code with a Java application for Android.

https://chaquo.com/chaquopy/

It requires a commercial license if you don't want to opensource your code.

Upvotes: 1

Abdelhak Bougouffa
Abdelhak Bougouffa

Reputation: 86

Maybe you can use Termux which is an Android terminal emulator and Linux environment app.

It comes with a package manager pkg which can be used to install Python.

pkg install python # or python2

It installs python and the pip package manager.

You can also find some useful information in wiki.python.org/moin/Android.

Upvotes: 1

Related Questions