im trying to get the device id inside a onRecive (which is inside broadcastreceiver) but the only way i found is to use this code:
TelephonyManager tManager = (TelephonyManager)myActivity.getBaseContext().getSystemService(Context.TELEPHONY_SERVICE);
device_id = tManager.getDeviceId();
but here i am not in an Activity. so how can i get the device id?
Thanks!
If you are on onReceive then you have a Context.
If you have a context then you can call getSystemService and do the same thing as here