Search code examples
androidestimote

How to change estimote beacon UUID using AndroidSDK


I'm trying to change the UUID of the estimote beacons and have not found a specific API for this, anyone have any example or help?


Solution

  • Here you have, It's the same for the proximityUUID but you gotta change the writeMajor by writeProximityUuid.

    private void setMajorID(final int majorid,final Beacon beacon) {
    
            mMajorsConnection = new BeaconConnection(this, beacon, new BeaconConnection.ConnectionCallback() {
                @Override
                public void onAuthenticated(BeaconConnection.BeaconCharacteristics chars) {
                    Log.d(TAG, "Authenticated to beacon: " + chars);
                    mMajorsConnection.writeMajor(majorid, new BeaconConnection.WriteCallback() {
                        @Override
                        public void onSuccess() {
                            runOnUiThread(new Runnable() {
                                @Override
                                public void run() {
                                    mAdapter.update(beacon);
                                }
                            });
                            Log.d(TAG, "Successfully writted the major id!");
                            mMajorsConnection.close();
                        }
    
                        @Override
                        public void onError() {
                            Log.d(TAG, "Error while writting the major id!");
                        }
                    });
                }
    
                @Override
                public void onAuthenticationError() {
                    Log.d(TAG, "Authentication Error");
                }
    
                @Override
                public void onDisconnected() {
                    Log.d(TAG, "Disconnected");
                }
            });
                mMajorsConnection.authenticate();
        }