2

I'm creating an android application that I want to run sentiment analysis. I have a good chunk of python code that does exactly the analysis I need it to, I just need to find a way to integrate this, or use it from, Android studio.

So, in lamens terms, I have an Android studio UI that I want to run python code... Possible?

I have looked at integrating Java machine learning libraries but the Python code is really the best thing I have at the moment. I have absolutely no experience with APIs, is that an option? Is there a way to run this python code on a server and add code in Android Studio to place calls to it. This is where my research seems to be leading.

If you could point me in the right direction that would be a great help. I don't want to ditch the python and use Java ML libraries if I don't have to.

JamWill
  • 134
  • 3
  • 21
  • Possible duplicate of [Is there a way to run Python on Android?](https://stackoverflow.com/questions/101754/is-there-a-way-to-run-python-on-android) – Amit Amola Jan 05 '19 at 20:26
  • @AmitAmola I have scoured that thread with no great solution. Also they seem to address running the code from an android device, not integrating it with Android studio. – JamWill Jan 05 '19 at 20:38
  • I retracted my flag in that case mate. – Amit Amola Jan 05 '19 at 20:49
  • @AmitAmola Thank you. My fault, I didn't make myself clear enough. – JamWill Jan 05 '19 at 20:50
  • 1
    `Is there a way to run this python code on a server and add code in Android Studio to place calls to it.` You are trying to create a web service. Related: [Recommendations of Python REST (web services) framework?](https://stackoverflow.com/q/713847/295004) Lots of tutorials online regarding web services and Android. – Morrison Chang Jan 05 '19 at 22:20
  • I am also exploring this topic and this one chaquo.com/chaquopy looks promising to integrate python code into android app. However, a standard way is to use ML kit framework, it allows to make your custom model on python, convert to ```tflite``` format and run on Android (in this case you will have to work with java code and Android API) – Gleichmut Aug 17 '23 at 11:27

0 Answers0