0

I am familiar with Python and a few other languages and I was wondering if I could get a simple python script (one file) to run as a native application on Android. I believe building an APK and running it will do the trick. I do not want the users to download an external application, and load the script from there, I want to make the app, and when it is being executed, it will simply show nothing, but run in background (kind of an infinite loop). Also, hooking it up to launch automatically on boot would be ideal. And one more thing.. Is it possible to access Android services such as Location, Accelerometer etc.?

Thank you very much.

DaKnOb
  • 577
  • 4
  • 17
  • Check out this similar question: http://stackoverflow.com/questions/101754/is-there-any-way-to-run-python-on-android?rq=1. As for services, you simply use "getSystemService". For example, if I wanted to get access to the system window, I would say: WindowManager winmngr = (WindowManager) getSystemService(Context.WINDOW_SERVICE);. Just swap out window for whatever you want to access. – Denizen Aug 29 '12 at 23:02
  • See this : https://stackoverflow.com/questions/72078429/how-to-convert-py-to-apk/72339696#72339696 – Abhijeet May 26 '22 at 17:25

1 Answers1

0

Kivy is good for this .... http://kivy.org/ ... in fact its the only option ive seen

[edit] bah thats the same answer as the comment from Denizen ... lame

Joran Beasley
  • 110,522
  • 12
  • 160
  • 179
  • Doesn't that require the user to have Kivy installed? Also, I don't think it allows you to run in background and/or hook to launch. – DaKnOb Aug 29 '12 at 23:23
  • you would bundle it in your app i think(http://kivy.org/docs/guide/packaging.html) and it certainly can run infinite loops whether you can run it as a background process im not sure ... its more for UI stuff ... oh your right they would need the kivy launcher it looks like ... I dunno we have only used it where we were distributing the hardware.... but kivy is pretty nice to use – Joran Beasley Aug 29 '12 at 23:26
  • What I need is to run it, no GUI, no anything. Like what happens when the app crashes on launch. So it is like a system service (running 24/7 in the background doing some work). And when the phone reboots, it starts again. – DaKnOb Aug 29 '12 at 23:37
  • im not sure man ... as Ive said its pretty much the only option ive seen for python on android... give it a shot ... – Joran Beasley Aug 29 '12 at 23:40