问题
I am using Roximity SDK and it gives beacons range update but only with three points Far, Near and Immediate, while i want to get their distance in feets, any idea how can i get this ? Here's the code i have used according to roximity SDK docs.
private void createBroadcastRecievers(){
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(ROXConsts.MESSAGE_FIRED);
intentFilter.addAction(ROXConsts.BEACON_RANGE_UPDATE);
intentFilter.addAction(ROXConsts.WEBHOOK_POSTED);
LocalBroadcastManager.getInstance(this).registerReceiver(broadcastReceiver, intentFilter);
}
private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if(intent.getAction().equals(ROXConsts.MESSAGE_FIRED)) {
MessageParcel messageParcel = (MessageParcel)intent.getParcelableExtra(ROXConsts.EXTRA_MESSAGE_PARCEL);
handleMessageFired(messageParcel);
} else if (intent.getAction().equals(ROXConsts.BEACON_RANGE_UPDATE)){
String rangeJson = intent.getStringExtra(ROXConsts.EXTRA_RANGE_DATA);
handleBeaconRangeUpdate(rangeJson);
} else if (intent.getAction().equals(ROXConsts.WEBHOOK_POSTED)){
String webhookJson = intent.getStringExtra(ROXConsts.EXTRA_BROADCAST_JSON);
handleWebhookPosted(webhookJson);
}
}
};
and in my handleBeaconRangeUpdate method i am getting following attributes only as
"beacon_id" = unique identifier of the beacon. "beacon_name" = beacon name as set in your ROXIMITY Dashboard "beacon_tags" = tags associated with this beacon, as set in your ROXIMTIY Dashboard "proximity_value" = the proximity value integer of the beacon when triggered. 1 = Immediate 2 = Near 3 = Far "proximity_string" = the string representation of your beacon proximity when triggered. "Immediate" "Near" or "Far"
this only provides limited values of distance as Near, Far, Immediate while i need exact in feet's. Any help will be appreciated.
来源:https://stackoverflow.com/questions/32253823/how-can-i-get-exact-distance-in-feets-from-the-beacon-using-roximity-sdk