0

I am new in android. I want to use telegram API to develop my own telegram application. There are two problems. 1) I can not find any code sample or documentation or tutorial. I have searched a lot and I have study telegram documentation here. .2) I have used following code to authenticate in telegram. But it does not work. why? code has copied from 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");

    }
Community
  • 1
  • 1
Meysam Valueian
  • 661
  • 1
  • 5
  • 21

0 Answers0