How to get beacon name, major value Using telemetry ID in android..?

#1

I want to find beacon name which detect in telemetry method. But in telemetry or proximity, no any parameter which use for identify beacon major or name.

beaconManager.setLocationListener(new BeaconManager.LocationListener() {
    @Override
    public void onLocationsFound(List<EstimoteLocation> beacons) {
}
});

and 

beaconManager.setTelemetryListener(new BeaconManager.TelemetryListener() {
    @Override
    public void onTelemetriesFound(List<EstimoteTelemetry> telemetries) {
        for (EstimoteTelemetry tlm : telemetries) {
}
}
});
#2

You need to query Estimote Cloud with device ID and you will find all information about your beacon - name, UUID/major/minor, etc. . See https://cloud.estimote.com/docs/#api-Devices-GetDevice

Device name that is configured in the cloud is not advertised by beacon. Telemetry packet is does not contain major/minor but it has unique device ID. Why do you need major/minor from telemetry? Does device ID is not enough to identify device?

#4

How can i call below api from android:

curl -X GET ‘https://cloud.estimote.com/v2/devices/40b53f0f65a40b6f18c91e6f16ff802d’ -u YOUR_SDK_APP_ID:YOUR_SDK_APP_TOKEN -H “Accept: application/json”

pls can u explain that how can call this api example:which parameter key for app id…?

#5

If you are using Estimote SDK 1.4.* then following code might be helpful:

EstimoteSDK.initialize(applicationContext, "YOUR APP ID", "YOUR APP TOKEN");

EstimoteCloud.getInstance().fetchDeviceDetails(myDeviceId, new CloudCallback<Device>() {
      @Override
      public void success(Device device) {
         String deviceName = device.shadow.name;
         short major = device.settings.advertisers.iBeacon.get(0).major;
         short minor = device.settings.advertisers.iBeacon.get(0).minor;
      }

      @Override
      public void failure(EstimoteCloudException serverException) {

      }
    });

How to obtain AppID/AppToken can be found here: https://community.estimote.com/hc/en-us/articles/203607313-What-are-App-ID-and-App-Token-and-what-do-I-need-them-for-
Note: This SDK will be deprecated.

We encourage to use new Proximity SDK. This SDK allows you to create JSON style attachments in Cloud and when user enters region you will get that attachment returned. You can store various information there including beacon name. It is using device ID, so you will need to start telemetry scanning and you can match both informations together. Here is a code snippet how to start telemetry scanning in Proximity SDK:

    BluetoothScanner bluetoothScanner = new EstimoteBluetoothScannerFactory(context).getSimpleScanner();
    scanHandler = bluetoothScanner.estimoteTelemetryFullScan()
                      .withOnPacketFoundAction(new Function1<EstimoteTelemetryFull, Unit>() {
                        @Override
                        public Unit invoke(EstimoteTelemetryFull estimoteTelemetryFull) {
                          String deviceID= estimoteTelemetryFull.getIdentifier();
                          return null;
                        }
                      })
                      .withBalancedPowerMode()
                      .start();

Note: This SDK is in alpha stage, so some things might get changed.
I would avoid using both SDKs for scanning.

#6

OK thanks. I have call curl api from android and i was got all data.

split this topic #7

A post was split to a new topic: Where to find App ID and Token for IoT apps?