我是android新手。我想使用电报API来开发我自己的电报应用程序。有两个问题。 1)我找不到任何代码示例或文档或教程。我搜索了很多,我学习了电报文件here。 .2)我使用以下代码在电报中进行身份验证。但它不起作用。为什么?代码已从here复制。
TelegramApi api = new TelegramApi(new MemoryApiState(false), new appInfo(12345,"Sony","are these values important?","1","en"), new apiCallback());
// Create request
String phoneNumber = "98123456789";
TLRequestAuthCheckPhone checkPhone = new TLRequestAuthCheckPhone(phoneNumber);
// Call service synchronously
TLCheckedPhone checkedPhone = null;
try {
Log.d("meme", "----");
checkedPhone = api.doRpcCall(checkPhone);
boolean invited = checkedPhone.getPhoneInvited();
boolean registered = checkedPhone.getPhoneRegistered();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Log.d("meme", "IOException");
}