I am working on developing an app for Android that requires a bluetooth connection. I currently have the most recent version of android x86 installed using virtualbox on my linux mint 18.3 OS. Everything is working fine except one thing, bluetooth.
When I go to turn the bluetooth on, it says it is on temporarily, but then shuts off when I go back to the bluetooth settings.
Image of bluetooth settings turned on
Bluetooth settings after returning to general settings
As you can see, the bluetooth doesn't actually turn on. I have ported my laptop's integrated bluetooth to virtualbox, and my output from hciconfig -a is as shown below:
I really would like bluetooth to work so I can properly test the app, any help is appreciated!
I have the same problem with VirtualBox and androidx86 under windows 10 with a USB stick Cambridge Silicon Radio and
found this page
http://andex.exton.net/?p=726
which states
Bluetooth doesn’t work. (You can enable Bluetooth and see units though).
I would try with a hd install without Virtual Box.
bye
Related
I am running an emulated Nexus 5 running Android 5.1.0 on Xamarin, and I cannot for the life of me get adb to recognize the emulator as a device. The only way I can get the device to connect is through TCP/IP, connecting to the emulator's given IP address manually.
I've tried reinstalling the Android SDK, Xamarin, and VirtualBox (which the Xamarin emulator uses), as well as tweaking several settings in each, all of which lead to nothing.
And no, running
adb kill-server
adb start-server
does NOT fix the issue, like every other thread I've seen has suggested as the only fix.
I look forward to your help, and thank you in advance!
EDIT: Additionally, I should add that adb devices DOES recognize my physical Android device when connected through USB, but still not the emulated device.
If you are using Xamarin Android Player. Try following steps
Shut down the emulated device.
Open Oracle VM virtual box manager
Identify emulated device and open settings.
Go to USB tab and Enable USB Controller.
Save settings. And start device from Xamarin Android Player
Try different sub options from Enable USB Controller. I enabled USB 1.1 and it worked for me. I am not sure it will work for all. Let me know your experience.
I have Android X-86 installed on Virtual Box as Virtual machine on my Windows 7. I am using Bluetooth dongle to access the Bluetooth on my VM. But I cannot turn on Bluetooth from menu. When I start Bluetooth app, it just says
Turning on Bluetooth...
and does nothing.It was working fine till the last time I used it but it stopped working suddenly.I have created VM using the following steps:
Set the type of guest OS as Linux instead of Other.
After creating the virtual machine, set the network adapter to 'Bridged'.
Start the VM and select 'Live CD VESA' at boot.
Now you find out the ip of this VM. Go to terminal in VM (use Alt+F1 & Alt+F7 to toggle) and use the netcfg command to find this.
Now open a command prompt and go to your android install folder (on host). This is usually C:\Program Files\Android\android-sdk\platform-tools>.
Type adb connect IP_ADDRESS
Plug in USB Bluetooth dongle.
In VirtualBox screen, go to Devices>USB devices. Select dongle.
Moreover I have found similar questions however nothing has helped yet
Bluetooth does not work in Android x86 on VirtualBox
USB bluetooth in Ubuntu 12.04 on Virtual Box
Any ideas how can I use blue tooth dongle on Vm would be really appreciated
Successfully verified on:
Ubuntu: 16.04
Virtualbox: 5.0.24
Android x86: 4.4-r5, 5.1-rc1, 6.0-rc1*
Bluetooth USB Dongle Tested:
PASSES: Cambridge Silicon Radio CSR8510 A10 [8891]
FAILS: Broadcom BCM20702A0 [0112]
To be able to do the following:
Android -> Settings -> Bluetooth -> On
You need to physically attach the Bluetooth USB dongle to the Host and virtually attach it to the VirtualMachine before starting it up the VirtualMachine.
*NOTE: For Android 6.0-rc1, you can virtually attach the bluetooth USB dongle (and do a Android settings bluetooth enable) after boot up.
Virtualbox -> AndroidVitrualMachine -> Settings -> USB -> USB+ (Button icon with the balloon help that says - Add new filter with all fields set to the values of the selected USB device attached to the Host PC.)
I have verified this which included running the nRF Master Control Panel Android app and scanning for Bluetooth LE devices on the AndroidVirtualMachine.
When you start up the VM, under Devices in the VirtualBox window that opens, ensure that under USB Devices there is a checkmark next to your bluetooth dongle device.
If it is not checked, and warns you that the device is in use already when you try to check it, unplug the dongle and plug it back in while the VM is still on the initial blue boot-up screen. This must be done before the Android has booted up, or it will not work.
How to enable WiFi on Android emulator? I have tried to find this but everyone is confusing WiFi with 3G.
Wifi is not available on the emulator if you are using below of API level 25.
When using an AVD with API level 25 or higher, the emulator provides a
simulated Wi-Fi access point ("AndroidWifi"), and Android
automatically connects to it.
More Information:
https://developer.android.com/studio/run/emulator.html#wifi
Apparently it does not and I didn't quite expect it would. HOWEVER Ivan brings up a good possibility that has escaped Android people.
What is the purpose of an emulator? to EMULATE, right? I don't see why for testing purposes -provided the tester understands the limitations- the emulator might not add a Wifi emulator.
It could for example emulate WiFi access by using the underlying internet connection of the host. Obviously testing WPA/WEP differencess would not make sense but at least it could toggle access via WiFi.
Or some sort of emulator plugin where there would be a base WiFi emulator that would emulate WiFi access via the underlying connection but then via configuration it could emulate WPA/WEP by providing a list of fake WiFi networks and their corresponding fake passwords that would be matched against a configurable list of credentials.
After all the idea is to do initial testing on the emulator and then move on to the actual device.
As of now, with Revision 26.1.3 of the android emulator, it is finally possible on the image v8 of the API 25.
If the emulator was created before you upgrade to the latest API 25 image, you need to wipe data or simply delete and recreate your image if you prefer.
Added support for Wi-Fi in some system images (currently only API
level 25). An access point called "AndroidWifi" is available and
Android automatically connects to it. Wi-Fi support can be disabled by
running the emulator with the command line parameter -feature -Wifi.
from https://developer.android.com/studio/releases/emulator.html#26-1-3
(Repeating here my answer elsewhere.)
In theory, linux (the kernel underlying android) has mac80211_hwsim driver, which simulates WiFi. It can be used to set up several WiFi devices (an acces point, and another WiFi device, and so on), which would make up a WiFi network.
It's useful for testing WiFi programs under linux. Possibly, even under user-mode linux or other isolated virtual "boxes" with linux.
In theory, this driver could be used for tests in the android systems where you don't have a real WiFi device (or don't want to use it), and also in some kind of android emulators. Perhaps, one can manage to use this driver in android-x86, or--for testing--in android-x86 run in VirtualBox.
The emulator does not provide virtual hardware for Wi-Fi if you use API 24 or earlier. From the Android Developers website:
When using an AVD with API level 25 or higher, the emulator provides a simulated Wi-Fi access point ("AndroidWifi"), and Android automatically connects to it.
You can disable Wi-Fi in the emulator by running the emulator with the command-line parameter -feature -Wifi.
https://developer.android.com/studio/run/emulator.html#wi-fi
What's not supported
The Android Emulator doesn't include virtual
hardware for the following:
Bluetooth
NFC
SD card insert/eject
Device-attached headphones
USB
The watch emulator for Android Wear doesn't support the Overview (Recent
Apps) button, D-pad, and fingerprint sensor.
(read more at https://developer.android.com/studio/run/emulator.html#about)
https://developer.android.com/studio/run/emulator.html#wi-fi
When using an AVD with API level 25 or higher, the emulator provides a simulated Wi-Fi access point ("AndroidWifi"), and Android automatically connects to it.
Source : https://developer.android.com/studio/run/emulator.html#wi-fi
If your simulator is not connecting to wifi and your in a mac(I don't know how to add DNS in windows) just go to
Network -> advance -> DNS and add 8.8.8.8 and 8.8.4.4 the close the android simulator, open android studio, select the simulator and click on cold reboot then your simulator will be connected to wifi.
I was trying to run androidx86-ieee.iso on VM and everything works fine. The VMs (Android) can connect to the internet via bridge mode successfuly, share Bluetooth via my dongle on Windows 7 host (since no error is thrown while activating Bluetooh). But the devices cannot detect each other (or my phone for that matter).
I recall in the previous VMWare version (v7) when there was no support to share Bluetooth device, I could connect to my phone when only 1 of the VM had control over it (Sharing Bluetooth was not permitted). But I required Bluetooth sharing.
My netcfg shows 192.168.1.x address for both devices since they are connected to the internet, but cannot see each other on bluetooth.
Any help is greatly appreciated.
Answering my own question. I googled aplenty and found out the 2.3 Gingerbread android x86 iso I was using is buggy as confirmed by a user here Android-x86 Google Group and had requested him for the ISO he compiled after fixing the Android 2.3 code, which he rightfully obliged.
For anyone viewing this or having the same problem, the fixed ISO is uploaded here.
How to enable WiFi on Android emulator? I have tried to find this but everyone is confusing WiFi with 3G.
Wifi is not available on the emulator if you are using below of API level 25.
When using an AVD with API level 25 or higher, the emulator provides a
simulated Wi-Fi access point ("AndroidWifi"), and Android
automatically connects to it.
More Information:
https://developer.android.com/studio/run/emulator.html#wifi
Apparently it does not and I didn't quite expect it would. HOWEVER Ivan brings up a good possibility that has escaped Android people.
What is the purpose of an emulator? to EMULATE, right? I don't see why for testing purposes -provided the tester understands the limitations- the emulator might not add a Wifi emulator.
It could for example emulate WiFi access by using the underlying internet connection of the host. Obviously testing WPA/WEP differencess would not make sense but at least it could toggle access via WiFi.
Or some sort of emulator plugin where there would be a base WiFi emulator that would emulate WiFi access via the underlying connection but then via configuration it could emulate WPA/WEP by providing a list of fake WiFi networks and their corresponding fake passwords that would be matched against a configurable list of credentials.
After all the idea is to do initial testing on the emulator and then move on to the actual device.
As of now, with Revision 26.1.3 of the android emulator, it is finally possible on the image v8 of the API 25.
If the emulator was created before you upgrade to the latest API 25 image, you need to wipe data or simply delete and recreate your image if you prefer.
Added support for Wi-Fi in some system images (currently only API
level 25). An access point called "AndroidWifi" is available and
Android automatically connects to it. Wi-Fi support can be disabled by
running the emulator with the command line parameter -feature -Wifi.
from https://developer.android.com/studio/releases/emulator.html#26-1-3
(Repeating here my answer elsewhere.)
In theory, linux (the kernel underlying android) has mac80211_hwsim driver, which simulates WiFi. It can be used to set up several WiFi devices (an acces point, and another WiFi device, and so on), which would make up a WiFi network.
It's useful for testing WiFi programs under linux. Possibly, even under user-mode linux or other isolated virtual "boxes" with linux.
In theory, this driver could be used for tests in the android systems where you don't have a real WiFi device (or don't want to use it), and also in some kind of android emulators. Perhaps, one can manage to use this driver in android-x86, or--for testing--in android-x86 run in VirtualBox.
The emulator does not provide virtual hardware for Wi-Fi if you use API 24 or earlier. From the Android Developers website:
When using an AVD with API level 25 or higher, the emulator provides a simulated Wi-Fi access point ("AndroidWifi"), and Android automatically connects to it.
You can disable Wi-Fi in the emulator by running the emulator with the command-line parameter -feature -Wifi.
https://developer.android.com/studio/run/emulator.html#wi-fi
What's not supported
The Android Emulator doesn't include virtual
hardware for the following:
Bluetooth
NFC
SD card insert/eject
Device-attached headphones
USB
The watch emulator for Android Wear doesn't support the Overview (Recent
Apps) button, D-pad, and fingerprint sensor.
(read more at https://developer.android.com/studio/run/emulator.html#about)
https://developer.android.com/studio/run/emulator.html#wi-fi
When using an AVD with API level 25 or higher, the emulator provides a simulated Wi-Fi access point ("AndroidWifi"), and Android automatically connects to it.
Source : https://developer.android.com/studio/run/emulator.html#wi-fi
If your simulator is not connecting to wifi and your in a mac(I don't know how to add DNS in windows) just go to
Network -> advance -> DNS and add 8.8.8.8 and 8.8.4.4 the close the android simulator, open android studio, select the simulator and click on cold reboot then your simulator will be connected to wifi.