I am using AndroidIbeacon library released by radiusnetworks and I am able to run their demo app successfully. But when I add that to my application onIBeaconServiceConnect() method is not called.
Below my code,
public class Sample extends Activity implements IBeaconConsumer {
protected static final String TAG = "Sample";
private IBeaconManager iBeaconManager = IBeaconManager
.getInstanceForApplication(this);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity);
iBeaconManager.bind(this);
}
@Override
protected void onDestroy() {
super.onDestroy();
iBeaconManager.unBind(this);
}
@Override
public void onIBeaconServiceConnect() {
iBeaconManager.setMonitorNotifier(new MonitorNotifier() {
@Override
public void didEnterRegion(Region region) {
Log.i(TAG, "I just saw an iBeacon for the firt time!");
}
@Override
public void didExitRegion(Region region) {
Log.i(TAG, "I no longer see an iBeacon");
}
@Override
public void didDetermineStateForRegion(int state, Region region) {
Log.i(TAG,
"I have just switched from seeing/not seeing iBeacons: "
+ state);
}
});
try {
iBeaconManager.startMonitoringBeaconsInRegion(new Region(
"myMonitoringUniqueId", null, null, null));
} catch (RemoteException e) {
}
}
}
Kindly help me to solve this issue. thanks