Get Device Id
Getting the Device ID through a Device ID listener
public class MainActivity extends Activity {
private GeoUniq geoUniq;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.geoUniq = GeoUniq.getInstance(this);
this.setDeviceIdListener();
}
/**
* Sets a listener to received the ID assigned to this device
*/
private void setDeviceIdListener(){
this.geoUniq.setDeviceIdListener(new GeoUniq.IDeviceIdListener() {
@Override
public void onDeviceIdAvailable(String deviceId) {
Log.d("GeoUniq", "Device ID received: "+deviceId);
}
});
}
}Getting the Device ID by calling an explicit class method
Last updated
Was this helpful?