td icon indicating copy to clipboard operation
td copied to clipboard

Builds for android for python

Open sanodin opened this issue 6 years ago • 7 comments

Hello, tell me how to assemble, or maybe use ready? libtdjson.so works great on linux, but does not work on android ""/home/kivy/4/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/ctypes/init.py", line 356, in init OSError: dlopen failed: "/data/data/org.bte.bte/files/lib/libtdjson.so" is 64-bit instead of 32-bit"

libtdjni.so error "" /home/kivy/4/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/ctypes/init.py ", line 374, in getitem AttributeError: undefined symbol: td_json_client_create " Well, it's understandable, these functions are not there, And written for java.

Or should libtdjson.so be built for Android? I want to use in the project on Kivy. And there is ready assembled libtdjson.so for Android?

sanodin avatar Dec 31 '18 11:12 sanodin

libtdjson.so should be built using Android NDK to be used on Android. Prebuilt Android library provides only JNI interface, so if you want to use JSON interface, you need to build it manually. It is definitely possible, but you will likely need to write a small CMakeLists.txt file for Android Studio like described in https://developer.android.com/studio/projects/configure-cmake. You will also need to first build OpenSSL for Android.

levlam avatar Dec 31 '18 17:12 levlam

Thank. JNI interface, did not find a description of the methods? createNativeClient Client_createNativeClient in the example that are missing in the assembled library. "AttributeError: undefined symbol:" Or am I looking there?

sanodin avatar Jan 01 '19 10:01 sanodin

Java interface has full Javadoc documentation, but you will not be able to use JNI interface from Python anyway.

levlam avatar Jan 01 '19 13:01 levlam

This is already understood, thank you. So I will try to collect JSON. Although not sure if I can do it. Thank you

sanodin avatar Jan 01 '19 14:01 sanodin

For iOS, Linux, Windows there is an example of an assembly, maybe for Android, post an example of an assembly libtdjson?

sanodin avatar Jan 05 '19 09:01 sanodin

We may add such example in a future along with example of building Java interface for Android, but given existence of prebuilt Android Java binaries, it is not a priority.

levlam avatar Jan 05 '19 13:01 levlam

This is already understood, thank you. So I will try to collect JSON. Although not sure if I can do it. Thank you

I'm trying to build for android, using JSON c++ interface, but still can not build through Cmake. If you can build for android, please give me some instruction, thank you very much!

quannv108 avatar Jan 05 '19 21:01 quannv108