Android SDK: Change mode from iBeacon => Eddystone


#1

Does anyone have some example code for using the Android SDK to change the card beacon from iBeacon to Eddystone-URL or Eddystone-UID?


#2
private void changeModelToUrl() {
	changeModel("url");
}

private void changeModelToIBeacon() {
	changeModel("iBeacon");
}

private void changeModel(String model) {
	conn = new EddyStoneConnection(eddyStone.getName(),
			eddyStone.getMacAddress(), eddyStone.getModel(), this);
	conn.changerModel(model);
	conn.connectGattToWrite(password, new EddyStoneWriteCallBack() {

		@Override
		public void onWriteSuccess() {
			Toast.makeText(EddyStoneModifyActivity.this, "模式更改成功",
					Toast.LENGTH_SHORT).show();
		}
	});