|
@@ -8,6 +8,8 @@ import android.os.RemoteException;
|
|
|
import android.support.annotation.Nullable;
|
|
|
import android.util.Log;
|
|
|
|
|
|
+import com.wdkl.nursewatch.utils.StringUtils;
|
|
|
+
|
|
|
import org.altbeacon.beacon.Beacon;
|
|
|
import org.altbeacon.beacon.BeaconConsumer;
|
|
|
import org.altbeacon.beacon.BeaconManager;
|
|
@@ -51,7 +53,7 @@ public class BeaconService extends Service implements BeaconConsumer, RangeNotif
|
|
|
|
|
|
private String serverId;
|
|
|
|
|
|
- private String nurseId;
|
|
|
+ private int nurseId;
|
|
|
|
|
|
private String nurseName;
|
|
|
|
|
@@ -90,7 +92,13 @@ public class BeaconService extends Service implements BeaconConsumer, RangeNotif
|
|
|
public int onStartCommand(Intent intent, int flags, int startId) {
|
|
|
|
|
|
serverId = intent.getStringExtra(SERVER_ID_KEY);
|
|
|
- nurseId = intent.getStringExtra(NURSE_ID_KEY);
|
|
|
+ String ID = intent.getStringExtra(NURSE_ID_KEY);
|
|
|
+ try {
|
|
|
+ nurseId = Integer.valueOf(ID);
|
|
|
+ } catch (Exception e) {
|
|
|
+ nurseId = -1;
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
nurseName = intent.getStringExtra(NURSE_NAME_KEY);
|
|
|
|
|
|
return super.onStartCommand(intent, flags, startId);
|
|
@@ -111,6 +119,7 @@ public class BeaconService extends Service implements BeaconConsumer, RangeNotif
|
|
|
@Override
|
|
|
public void didRangeBeaconsInRegion(Collection<Beacon> collection, Region region) {
|
|
|
BEACON_HANDLER.execute(() -> {
|
|
|
+ //Log.d("wzl", "didRangeBeaconsInRegion size: " + collection.size());
|
|
|
if (collection.size() > 0) {
|
|
|
final JSONObject obj = new JSONObject();
|
|
|
try {
|