Trouble detecting a bluetooth device - Android Studio

Thanks for taking the time.
I am using a galaxy S22 with andoid 13, and my app is using SDK 21 (I think...).
I have a bluetooth device of type HC-05 that is in pairing mode. I have verified that it operates as a bluetooth slave.
I have written a app using AndroidStudio to scan for devices, and it works pretty well: I can detect my bluetooth headset, a TV, etc. but somehow the scan result callback is not invoked for that device (HC-05).
I have tried different scan modes to no avail - my phone sees the device and can pair with it (when scanning via the bluetooth connectivity page) as can my PC but somehow the app cannot. I have all the permissions granted to the app I think - including Location for LE scans - but again, this does not help; device not detected.
I have noticed that _sometimes_ the device may be identified initially as a generic "Android Bluedroid" device which is displayed instead of its name - is that a factor in detection?
Any ideas what I am missing?
Thanks in advance.

Related

[Solved] XPERIA As BlueTooth Mouse

Possible? : )
Need's soft for WM6, which can emulate BT mouse for PC (HID).
I used this on my diamond it's really good, you can use your phone as a mouse, keyboard and touchpad
http://gbmsoftware.com/
hope that helps
many thanks!!!
There is something that use standard HID protocol?
So we can use with ps3, pc win/linux ecc ecc?
Thx.
I've been checking on this too, but it seems there is not much info.
Looking about HID bluetooth profile on xperia, i think it supports to be controlled by HID from remote bluetooth devies, not to be the controller itself. still looking.
update:
I have just confirmed the second point: xperia can be controlled by other HID controllers with the HID profile. I made a test to control my xperia from my old SE K800i Remote Control application, which uses HID profile to remote control other devices, and i was able to do so, moving arrows and selecting options, cool, but absolutely need the opposite...
im looking for this too
i used to have a SE K790, and i used it a lot to control my laptop
this is a big hing! THX
finally it is out !!!
http://www.mobilesrc.com/MobileRemote.aspx
a HID controller for the computer, with no software needed on pc, just bluetooth that has HID support and the software on the WinMo, works great, mouse and keyboard so easy to use !!! it is said to support hardware keyboards (like xperia and touch pro), but the mouse is so cool: touchpad style
not free, but price is acceptable, $9...
mcbyte_it said:
finally it is out !!!
http://www.mobilesrc.com/MobileRemote.aspx
a HID controller for the computer, with no software needed on pc, just bluetooth that has HID support and the software on the WinMo, works great, mouse and keyboard so easy to use !!! it is said to support hardware keyboards (like xperia and touch pro), but the mouse is so cool: touchpad style
not free, but price is acceptable, $9...
Click to expand...
Click to collapse
Here is a little video showing how it works.
http://www.youtube.com/watch?v=n8tlL3QXNwk
Has anyone tried to get it to work with PS3? Keeps searching without any results.
Works om my laptop though...
Anyone able to get this working with OSX? I can even see the mobileSRC Mobile Remote service on my Mac, but on my phone it just hangs on connecting.
jhoffa said:
Anyone able to get this working with OSX? I can even see the mobileSRC Mobile Remote service on my Mac, but on my phone it just hangs on connecting.
Click to expand...
Click to collapse
Hangs or does not connects?
Ethermind said:
Hangs or does not connects?
Click to expand...
Click to collapse
When you press the bluetooth button in the program the connection progress bar continually tries to connect, but never completes. It just runs endlessly.
I can pair from my mac to my phone while the program is running and the correct mobile remote service will appear, but I can't pair from my phone to my mac (but I can with most other programs).
I waaaaaaaaaaant...... to place my XPERIA face down on a soft fabric mousepad, and have the optical sensor track motion, moving my entire XPERIA as a bluetooth mouse.
DEVELOPERS: On your marks, get set, go!
lol
(plus at the same time you'd be cleaning off your screen on the mousepad lol) GENIUSSSSSSSSSS!!!!
jhoffa said:
When you press the bluetooth button in the program the connection progress bar continually tries to connect, but never completes. It just runs endlessly.
I can pair from my mac to my phone while the program is running and the correct mobile remote service will appear, but I can't pair from my phone to my mac (but I can with most other programs).
Click to expand...
Click to collapse
algorithm
0. switch on BlueTooth on PDA
1. Run mobile remote on PDA (dont care about endless connecting....)
2. Run Bluetooth wizard of bluetooth master on PC
3. Select anything about new device and click on XPERIA
If you see default name for pairing up "MobileRemote mobileSRC" - all correct
4. at the same time on PDA you ca see changes
5. just press OK.
Thanks for the reply Ethermind. I've tried both methods already, but unfortunately it doesn't work.
If I pair from the Mac to the phone while mobileremote is running, I do get the mobileSRC Mobile Remote service on my mac, but the connection fails with the error: "Bluetooth network failed. Failed to open a connection to the network service. Your device may have reached its maximum number of supported network connections."
It does recognize that the phone is connecting as a remote control, but it just drops the connection when you try to connect.
Here's my BT services after pairing:
Device Type: Phone
Device Services: Service Discovery, Network Access Point, Audio Video Remote Control Profile, A2DP, Phone Book Access PSE, OBEX Object Push, Active Sync Bluetooth Service, Voice Gateway, Voice Gateway, mobileSRC Mobile Remote
Paired: Yes
Configured: Yes
Favorite: Yes
Connected: No
Here's the error:
Mar 1 21:57:36 Apple kernel[0]: [IOBluetoothHIDDriver][waitForHandshake][xx-xx-xx-xx-xx-xx] Timeout waiting for handshake
Mar 1 21:57:36 Apple kernel[0]: [IOBluetoothHIDDriver][handleStart] final device setup failed
Mar 1 21:57:36 Apple kernel[0]: [IOBluetoothHIDDriver][handleStart] Failed.
Mar 1 21:59:01 Apple kernel[0]: [IOBluetoothHIDDriver][handleStart] staticPrepControlChannelAction returned error e00002c0
Mar 1 21:59:01 Apple kernel[0]: [IOBluetoothHIDDriver][handleStart] Failed.
I've spoken to the developer as well who says there's an issue with the the OSX bluetooth stack. I'll update if they're able to fix this, but please post if anyone is able to find another workaround as well.

Bluetooth: Will not connect to Win7 PC

I can pair my Velocity (Telstra Oz Branding still with stock OS) with a Windows 7 32-Bit pc but it will not connect. During installation (& under Device Manager), I get warning that Windows could not find the driver for "Bluetooth Peripheral Device".
I have no issues with pairing or connecting other devices on either the Velocity or the PC - it's just between the Velocity and the PC. I've just come from the HD2 so I'm a newb with this Handset which was fine.
I can on the PC "send a file" to the phone just fine but no PAN or tethering...or are these features not yet part of Andriod 2.3.7 or is there some setting I don't know about?
Thanks
Nathan
jmone said:
I can pair my Velocity (Telstra Oz Branding still with stock OS) with a Windows 7 32-Bit pc but it will not connect. During installation (& under Device Manager), I get warning that Windows could not find the driver for "Bluetooth Peripheral Device".
I have no issues with pairing or connecting other devices on either the Velocity or the PC - it's just between the Velocity and the PC. I've just come from the HD2 so I'm a newb with this Handset which was fine.
I can on the PC "send a file" to the phone just fine but no PAN or tethering...or are these features not yet part of Andriod 2.3.7 or is there some setting I don't know about?
Thanks
Nathan
Click to expand...
Click to collapse
Had the same issue with mine.
1. Instal HTC Sync
2. Pair set your phone discoverable.
3. Search for bluetooth devices from your PC.
4. Select your phone.
5. After pairing your mobile go to
Start->Devices and Printers right click on your phone name Properties then Services tab, choose only
Advanced Audio - tick if your bluetooth pc is compatible or leave it blank
EMAIL - leave blank
File Transfer (Obex) - tick
Headset Audio Gateway - tick if your bluetooth pc is compatible or leave it blank
Object Push (Obex) - tick
Remotely Controllable Device - tick if your bluetooth pc is compatible or leave it blank
SMS - leave blank.
Then on your PC right click on Bluetooth icon choose Join Area Network and select your phone.
Hope it will help. This resolved my issue.
But just to let you know My HTC Raider is not able to receive *.apk extension over bluetooth. MP3, jpg perfect.
Mmmm looks like my handset is only advertising that it has EMAIL and SMS as "Services" to the PC. Do you know if I need to install anything on the Handset?
Thanks
Nathan
I don't know what PAN is, or maybe I just dont recognize the acronym, but you should use the wireless hotspot for tethering, much, much, much, faster than BT.
FYI - Straight from Wikipedia:
=============
Bluetooth vs. Wi-Fi (IEEE 802.11)
Bluetooth and Wi-Fi (the brand name for products using IEEE 802.11 standards) have some similar applications: setting up networks, printing, or transferring files. Wi-Fi is intended as a replacement for cabling for general local area network access in work areas. This category of applications is sometimes called wireless local area networks (WLAN). Bluetooth was intended for portable equipment and its applications. The category of applications is outlined as the wireless personal area network (WPAN). Bluetooth is a replacement for cabling in a variety of personally carried applications in any setting and can also support fixed location applications such as smart energy functionality in the home (thermostats, etc.).
Wi-Fi is a wireless version of a common wired Ethernet network, and requires configuration to set up shared resources, transmit files, and to set up audio links (for example, headsets and hands-free devices). Wi-Fi uses the same radio frequencies as Bluetooth, but with higher power, resulting in higher bit rates and better range from the base station. The nearest equivalents in Bluetooth are the DUN profile, which allows devices to act as modem interfaces, and the PAN profile, which allows for ad-hoc networking.[citation needed]
==================
One benefit of Bluetooth is it chews much less power as the range is limited. I'm guessing the profile is not in 3.2 of Andriod so I'll wait and see what ICS brings.
jmone said:
Mmmm looks like my handset is only advertising that it has EMAIL and SMS as "Services" to the PC. Do you know if I need to install anything on the Handset?
Thanks
Nathan
Click to expand...
Click to collapse
Hello, have you got installed drivers for your bluetooth dongle? it looks like there is only basic microsoft service/driver automaticly installed. Usualy bluetooth module has got Broadcom chipset. Try to find out what make it is in device manager on your PC. Did you try to pair another handset to your pc? If behaviour is the same on your PC that means you need drivers for your bluetooth module. Check if cd was included with bluetooth when you bought it.
Yeah on my HD2 (WinMo 6.5) I get DUN and PAN (Windows Bluetooth services reports the device supports DUN, SPP, Telephony). On my Tab I get DUN (Windows Bluetooth services reports the device supports DUN). On my Velocity I get sod all (Windows Bluetooth services reports the device supports Email and SMS).
Win Device Mgr reports my BT Radios as Apple Braodcom Built In and the MS Bluetooth Enumerator.
Thanks
Nathan
I usually just tether via wifi and charge it off the usb still, then i can have it plugged up to power but if I need to take a call I can always disconnect it breifly without interuption to the internet... I've never really gotten on well with BT, I always found it cumbersome... that and my main laptop doesnt have BT... so wifi or usb is the only option

[Q] Trusted Device Bluetooth Issue

I bought a USB 4.0 bluetooth for my Windows 8 PC so I could set my PC as a trusted device while I am at home to avoid having to pattern unlock every time I want to use my phone. The devices are paired, but an active connection is not maintained. The phone has a tile on Win 8, when I click on that I can see the option to send a file, but the device also shows as disconnected. How can I maintain an active connection so the phone will stay unlocked?
You can use the PC I play audio but then all the phones audio will be routed through the PC. Not a good solution
Sent from my XT1058 using Tapatalk 4
Tasker, probably.

Connect to BLE device when BLE device is near

Hi all,
I would like to connect to a BLE (Bluetooth Low Energy) device when the BLE device is near.
Tasker can list the nearby BLE devices and Secure settings can connect to Bluetooth devices, but it seems Secure Settings cannot connect to BLE devices (I am on Marshmallow).
All market apps (that I could find) which can connect to a BLE device get killed by android memory manager (e.g when recent apps are cleared).
I was wondering if Takser could be used to connect to a specific BLE device say using a shell command?
Any directions would be helpful.
Thanks.

Unlocking the Xiaomi Mi Smart Clock

After seeing the success of getting the lenovo smart clock cracked open, I wanted to do something similar to my Xiaomi Mi Smart Clock, because it's a very similar device. Some of the exploit works, but some of it doesn't, and I've reached a dead end so thought someone else might have some ideas...
- Using the send feedback / privacy policy workaround, I can break out to webview and can use the browser (but there's no keyboard of course)
- I can get to 3rd party app stores but there's no downloading from webview (clicking on direct links just does nothing). Tested on a few different sites, so it's not specific to f-droid
- I've been able to get to other settings, by going to Accessibility global options, text to speech settings, and pasting items into the settings search.
- Settings have allowed me to unlock developer options, unlock bootloader, and enable usb debugging.
- The data pins on the micro USB port are connected, the device enumerates on Linux / Windows as "X04G"
- With usb debugging turned on, adb doesn't ever see any device connected. Tested on chromebook, Windows, Xubuntu.
- holding down a combination of mic toggle and volume on power on allows access to the recovery menu, including fastboot
- in recovery the device enumerates as an mtk fastboot device
- can't find any drivers (on windows) to do anything from stock recovery or fastboot... Nor can I do anything on Linux. But I'm not experienced with android modding and development, so this is my best bet so far. TWRP??
Other areas I've explored -
- no Bluetooth pairing, Bluetooth causes settings to crash
- crashing Bluetooth deliberately lets me launch the full settings app rather than just searching for individual entries - that's how I was able to get developer options turned on.
- From the full settings app, the device reports running on android 10 and has 1gb ram / 4gb storage
- USB OTG seems to be set to charge only, and attempting to access the usb settings also crashes settings
- Because of that, no wired keyboard and no usb mass storage works
- storage app allows navigation of the Filesystem, but there's not very much there
- a few other apps include a Bluetooth mesh app, stock music app, and contacts
- there doesn't seem to be any way to get into the device remotely, no ftp / remote adb - no wireless adb in developer settings because it's android 10
- I can manually turn on wireless tethering and connect to the device
- when tethered running ports are DNS, 8008, 8009, 8012, 8443, 9000, 10001 but I don't know if any of them are exploitable
Does anyone have any ideas as to how I might download or drop a file onto this darn thing? I feel like it's so close, but it's definitely a bit more locked down than the lenovo smart clock.
Hello, I am also interested in this matter
it doesn't open the browser for me, but I can pair via bluetooth, but I can't send a file
windows sees the watch as an mtp device but cannot do anything with it
and adb doesn't work :c
I have also been trying to get apps onto this device, but there is seemingly no way to download/get files into the device's memory. I have also tried everything you have listed, but to no avail.
You can get to bluetooth settings by searching it up, but the device is detected as a speaker by other devices, so no files can be sent.
I have also tried Wi-Fi Direct, I can connect to the clock, but sending files fails.
I will be still trying, as I've already gotten pretty far, but for now i'm still not able to install any apps.

Categories

Resources