Why ITelephony.aidl works?

Actually, adding ITelephony.aidl to your project isn’t necessary, it is just a convenience. You could just as well do it this way: TelephonyManager tm = (TelephonyManager) context .getSystemService(Context.TELEPHONY_SERVICE); Class c = Class.forName(tm.getClass().getName()); Method m = c.getDeclaredMethod(“getITelephony”); m.setAccessible(true); Object telephonyService = m.invoke(tm); // Get the internal ITelephony object c = Class.forName(telephonyService.getClass().getName()); // Get its class m … Read more

how can I add the aidl file to Android studio (from the in-app billing example)

Adding this as an answer since it seemed to help quite a few people. Create a new directory named ‘aidl’ under ‘src/main/’. It should look like ‘src/main/aidl‘. Add a new package name ‘com.android.vending.billing‘ to the directory ‘src/main/aidl‘ Locate your sdk location and go to “sdk\extras\google\play_billing”. Default location for the sdk is “C:\Program Files (x86)\Android\android-sdk”. If … Read more