Explicitly load tdjni in Client.java and TdApi.java.
This commit is contained in:
parent
612afe63fe
commit
4d5625a06f
@ -13,6 +13,14 @@ import java.util.concurrent.atomic.AtomicLong;
|
|||||||
* Main class for interaction with the TDLib.
|
* Main class for interaction with the TDLib.
|
||||||
*/
|
*/
|
||||||
public final class Client {
|
public final class Client {
|
||||||
|
static {
|
||||||
|
try {
|
||||||
|
System.loadLibrary("tdjni");
|
||||||
|
} catch (UnsatisfiedLinkError e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for handler for results of queries to TDLib and incoming updates from TDLib.
|
* Interface for handler for results of queries to TDLib and incoming updates from TDLib.
|
||||||
*/
|
*/
|
||||||
|
@ -55,14 +55,6 @@ public final class Example {
|
|||||||
private static final String commandsLine = "Enter command (gcs - GetChats, gc <chatId> - GetChat, me - GetMe, sm <chatId> <message> - SendMessage, lo - LogOut, q - Quit): ";
|
private static final String commandsLine = "Enter command (gcs - GetChats, gc <chatId> - GetChat, me - GetMe, sm <chatId> <message> - SendMessage, lo - LogOut, q - Quit): ";
|
||||||
private static volatile String currentPrompt = null;
|
private static volatile String currentPrompt = null;
|
||||||
|
|
||||||
static {
|
|
||||||
try {
|
|
||||||
System.loadLibrary("tdjni");
|
|
||||||
} catch (UnsatisfiedLinkError e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void print(String str) {
|
private static void print(String str) {
|
||||||
if (currentPrompt != null) {
|
if (currentPrompt != null) {
|
||||||
System.out.println("");
|
System.out.println("");
|
||||||
|
@ -194,7 +194,15 @@ std::string TD_TL_writer_java::gen_output_begin() const {
|
|||||||
return "package " + package_name +
|
return "package " + package_name +
|
||||||
";\n\n"
|
";\n\n"
|
||||||
"public class " +
|
"public class " +
|
||||||
tl_name + " {\n";
|
tl_name +
|
||||||
|
" {\n"
|
||||||
|
" static {\n"
|
||||||
|
" try {\n"
|
||||||
|
" System.loadLibrary(\"tdjni\");\n"
|
||||||
|
" } catch (UnsatisfiedLinkError e) {\n"
|
||||||
|
" e.printStackTrace();\n" +
|
||||||
|
" }\n"
|
||||||
|
" }\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string TD_TL_writer_java::gen_output_end() const {
|
std::string TD_TL_writer_java::gen_output_end() const {
|
||||||
|
Loading…
Reference in New Issue
Block a user