-1

我需要一些关于模拟信标的帮助,我正在搜索许多小脚本来运行一个没有运气的 sumilator,我找不到适用于 android 的信标模拟器的应用程序。你知道一个正在工作的吗?我需要测试,因为我开始使用 api for android。有任何想法吗?提前致谢。

4

2 回答 2

0

好的,我知道我要说的不是 android 设备的模拟器,但是当开发一个应用程序来检测从 android 设备中的信标(用于估计信标)接收数据时,如果你手边有 ipad,你可以使用 estimote 应用程序模拟信标。这解决了我的问题。感谢其他答案,我也试试。

于 2016-01-11T22:27:00.800 回答
0

您可以使用Android 信标库在 Android 5+ 设备上作为信标进行传输。这是一个例子:

Beacon beacon = new Beacon.Builder()
    .setId1("2f234454-cf6d-4a0f-adf2-f4911ba9ffa6")
    .setId2("1")
    .setId3("2")
    .setManufacturer(0x0118) // Radius Networks.  Change this for other beacon layouts
    .setTxPower(-59)
    .setDataFields(Arrays.asList(new Long[] {0l})) // Remove this for beacon layouts without d: fields
    .build();

// Change the layout below for other beacon types
BeaconParser beaconParser = new BeaconParser()
    .setBeaconLayout("m:2-3=beac,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25");
BeaconTransmitter beaconTransmitter = new     BeaconTransmitter(getApplicationContext(), beaconParser); 
beaconTransmitter.startAdvertising(beacon, new AdvertiseCallback() {
        @Override
        public void onStartFailure(int errorCode) {
            Log.e(TAG, "Advertisement start failed with code: "+errorCode);
        }

        @Override
        public void onStartSuccess(AdvertiseSettings settingsInEffect) {
            Log.i(TAG, "Advertisement start succeeded.");
        }
});

在此处查看更多详细信息: https ://altbeacon.github.io/android-beacon-library/beacon-transmitter.html

您还可以使用基于此库的现成Locate 应用程序。

于 2016-01-09T00:39:27.830 回答