Muchas gracias a tod@s
Culex.
Telegram works based on asynchronous RPC calls, so interacting with the API implies sending the payload that represents the call to the function and receiving a result. This mode of operation avoids blockages, but implies the need to correctly manage communication between processes.
To implement a correct operation on my Bachelor's Degree Final Project,it was necessary to divide the API call management logic into two different actions. On the one hand, the result of the call is handled in class Telegram.java, and on the other hand, a spinlock is used to synchronize communication between processes.
HANDLE THE ANSWER:
To handle client-server interactions, the Telegram.java class adds a DefaultHandler object to each API call. The onResult(TdApi.Object object) method then receives the response when it is available.
The original functionality of the onResult() method was limited to printing the result of the call, a TL (Type Language) object such as the following, through the standard output of the system.
Enjoy,
Culex
I've transated my post about the PFG for my Linkedin profile. If you prefer read it in English here you are the links:
𝗕𝗮𝗰𝗵𝗲𝗹𝗼𝗿 𝘀 𝗗𝗲𝗴𝗿𝗲𝗲 𝗙𝗶𝗻𝗮𝗹 𝗣𝗿𝗼𝗷𝗲𝗰𝘁 𝗼𝗻 𝗰𝗼𝗺𝗽𝘂𝘁𝗲𝗿 𝘀𝗰𝗶𝗲𝗻𝗰𝗲
𝗕𝗮𝗰𝗵𝗲𝗹𝗼𝗿 𝘀 𝗗𝗲𝗴𝗿𝗲𝗲 𝗙𝗶𝗻𝗮𝗹 𝗣𝗿𝗼𝗷𝗲𝗰𝘁 𝗼𝗻 𝗰𝗼𝗺𝗽𝘂𝘁𝗲𝗿 𝘀𝗰𝗶𝗲𝗻𝗰𝗲 – 𝗣𝗮𝗿𝘁 𝗜I
Enjoy!
Culex.
Bueno este año he tenido el blog totalmente abandonado pero tengo una buena excusa. He estado dedicado todo el año a mi PFG, defendí en Julio y ya por fin he terminado el grado :).
A titulo personal, la experiencia ha sido muy enriquecedora y he disfrutado todo el proceso: desde las primeras etapas donde me estaba documentando y andaba más perdido que un pulpo en un garaje hasta la creación de la memoria que se me atragantó un poco la verdad.
Esta es la razón de este post, dar algunas indicaciones sobre los capítulos más 'abstractos' y alguna recomendación general.
Primero y más importante, si te es posible no dejes la escritura de la memoria para el final. No es que tengas que ir escribiendo la versión final a la vez que desarrollas el proyecto pero ir añadiendo notas en los capítulos te va a ayudar mucho a la hora de ponerse a escribir de verdad.
Segundo, una lista de buenas practicas:
Y por ultimo, algunas indicaciones sobre como abordar algunos capítulos:
Respecto a la defensa solo decir que puede que haya sido la parte más sencilla de todo el proceso. Eso si, es importante para subir nota y no se debe de descuidar.
Por favor, lo anterior son solo algunas ideas que me habría gustado leer antes de empezar a escribir mi memoria y que pienso que pueden ser de interés pero son solo eso, ideas, no se pueden tomar como si fuesen la biblia.
Enjoy!
Culex.
Although the instructions provide on github are quite completed there were some issues I had to solve myself for doing the example works, so I share here my experience.
Getting the system ready:
Building TDLIB Binaries
Building JNI & Java example
I had to install gperf manually and add the path to gperf.exe to the PATH environment variable.
The first cmake -DCMAKE_BUILD has to be modified as follows (taking into account you path to TDLib sources is D:\TDLib\td)
cmake -A x64 -DCMAKE_BUILD_TYPE=Release -DTD_ENABLE_JNI=ON -DCMAKE_INSTALL_PREFIX:PATH=../example/java/td .. -DCMAKE_TOOLCHAIN_FILE=D:/TDLib/td/vcpkg/scripts/buildsystems/vcpkg.cmake
The second cmake -DCMAKE_BUILD has to be modified as follows,
cmake -DCMAKE_BUILD_TYPE=Release -DTd_DIR=D:/TDLib/td/example/java/td/lib/cmake/Td -DCMAKE_INSTALL_PREFIX:PATH=.. ..
Before this last command, I get an error when I run ‘mkdir build’ because the directory already exists but it seems not to be a problem since everything works fine
Enjoy,
Culex