How to Get AAID for Facebook Ads?
You can get Your Android Application ID (AAID) programmatically using the below code. You can call the below method in your onCreate method.
public void getAAID() { AsyncTask.execute(new Runnable() { @Override public void run() { try { AdvertisingIdClient.Info adInfo = AdvertisingIdClient.getAdvertisingIdInfo(MyActivity.this); String myId = adInfo != null ? adInfo.getId() : null; Log.i("UIDMY",myId); } catch (Exception e) { Log.e("error", e); } } }); }
Note you need to import all required classes.