Python Forum
Can Embedded Python run any shared library on Android ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can Embedded Python run any shared library on Android ?
#1
As I have experienced, porting Python to Android is savagely difficult. However, there is a ready made Python interpreter on Android, along with its standard libraries, but porting a third party library as a Python module to Android is a nightmare. That's why I prefer the easier way as I've done on Windows, loading a precompiled library and using it like so:
from ctypes import *
lib = cdll.LoadLibrary("lib.so")
So my question is, can a Python interpreter running on Android load any shared library using this method and access its functions? Does the library have to be compiled with the 'extern C' method to be accessible? Does the library have had to be compiled with a JNI interface or is it not needed?
In summary, can Python embedded in Android use a shared library that is not compiled as a module ?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to run detectron2, as python embedded code in C++, on GPU? hassaniqbal931 3 1,039 Nov-02-2023, 04:45 PM
Last Post: blabling2
  android e python fece recognition Fabiola 1 683 Sep-13-2023, 04:59 PM
Last Post: albertschmidt
  Adding libraries to embedded Python as a ZIP The_Oman 0 1,191 May-05-2023, 04:05 PM
Last Post: The_Oman
Question Running Python under Termux on Android tablet dfkettle 1 3,355 Jan-25-2023, 02:34 PM
Last Post: dfkettle
  Python-for-Android:p4a: syntax error in main.py while compiling apk jttolleson 2 1,777 Sep-17-2022, 04:09 AM
Last Post: jttolleson
Bug Embedded Python Memory Leaks Alexei 1 1,001 Sep-16-2022, 01:15 PM
Last Post: Alexei
  Embedded Python in C++ Xeno 19 3,395 Aug-03-2022, 07:29 AM
Last Post: Gribouillis
  Dynamic File Name to a shared folder with open command in python sjcsvatt 9 5,877 Jan-07-2022, 04:55 PM
Last Post: bowlofred
  Python bot for ADB Android SCRCPY Bizzy_ 3 4,386 May-01-2021, 10:41 AM
Last Post: Larz60+
  Embedded python fails to compile on Raspberry Pi tryfon 2 3,398 Dec-22-2020, 02:06 PM
Last Post: tryfon

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020