android - Locate Bluetooth Inbox -
our app needs grab files bluetooth inbox after pushed external hardware device. there way programmatically find bluetooth folder location? on galaxy it's /mnt/sdcard/bluetooth
, , on desire seems /mnt/sdcard/downloads/bluetooth
.
thanks!
as far can tell, there's no simple , easy way via apis (although there should be!)
two solutions work (depending on usage context; first 1 seems better):
on start-up, app checks if there's
sharedpreference
(e.g.) "bluetoothlocation". if doesn't find it, app searches either (a) fs or (b) fs rooted @ /mnt/ (probably (b) better) until finds file such that:- the
name.equals("bluetooth")
, ,isdirectory()
.
- the
then saves path, , there go. alternatively (depending on context) could,
- the first time external device connects, sends file long, hard-coded filename (e.g.
greoermmvemoper190erjvw0j9e2.txt
). app searches through fs until finds file shared, hard-coded name, , saves location.
these both far perfect, , viability depends on context. thought i'd throw out there. hope helps.
Comments
Post a Comment