I need a frequent wifi scan on my android application (I'm trying to build a local indoor positioning system based on wifi RSSI values). IF I call wifi.startScan() I have onReceive() called back once every 6 seconds (I suppose by default it's scanning passively): how do I get more frequent callbacks? Should I ask for "active" scans? How is it done? Are there any drawbacks?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
I've been trying the same thing and I came to the following conclusion. It's not possible on 2.1 and higher. I've got no clue on lower versions because my app had to run on 2.1 and higher.
-Changed stuff inside the Android SDK so it will enable active scanning
-Traced it back to the driver resulting in the following conclusion: The driver will set the wifi module in passive mode every time. I've been looking to change this inside the driver but there was no setting inside the drive to achieve this.
Bottom line: Not possible.
I don't think you can. It is a device and/or OS version dependend setting. On the Nexus One for example it takes roughly a second to scan whereas on the G1 it takes significantly longer (or get fresh results after a few scans). If I recall correctly, some Android Version (< 2.0) did not issue a fresh scan everytime
startScan()
was called but might have reused the old result. But I might be mistaken on that one.