How to use tdlib in android studio (java)
Unlike all the other libs, tdlib is quite difficult to install. What I did:
- Install CMake.
- Download tdlib.zip from https://core.telegram.org/tdlib/tdlib.zip.
- Unzip tdlib.zip:
- Create jniLibs folder in myProject src/main/ and copy 4 folders from libtd/src/main/libs/ to jniLibs
- Copy the corresponding Java classes to myProject src/main/java/
And when I try to run NativeClient, it show:
What should I do for now?
Have you added
android {
sourceSets {
main {
jniLibs.srcDirs = ['src/main/jniLibs']
}
}
}
to your build.gradle?
Nothing changes !
This should be enough to find libtdjni.so in subdirectories of jniLibs.
You may also need jni.srcDirs = [], but only to prevent attempts to build native libraries:
sourceSets.main {
jniLibs.srcDir 'src/main/jniLibs'
jni.srcDirs = [] //disable automatic ndk-build call
}
Unlike all the other libs, tdlib is quite difficult to install. What I did:
Install CMake.
Download tdlib.zip from https://core.telegram.org/tdlib/tdlib.zip.
Unzip tdlib.zip:
- Create jniLibs folder in myProject src/main/ and copy 4 folders from libtd/src/main/libs/ to jniLibs
- Copy the corresponding Java classes to myProject src/main/java/
And when I try to run NativeClient, it show:
What should I do for now?
did you solved ?