Is there a way to know the number of LEDs an android device supports . For eg certain device support notification and charging LEDs and some devices support only charging LEDs . Is there a way for an app to know the number of LEDs present in the device (Similar to APIs which tell how many cameras are present in the Android device )
Is there a way to know the number of LEDs an android device supports
No, sorry.
Is there a way for an app to know the number of LEDs present in the device
No, sorry.
Well short of 100% reliable, but you could often derive some clues by looking for nodes in /sys/class/leds. You won't have permission to set them through that interface though. And interpreting what you find there may take some experience. And while this is typically how they are setup, it is not the only way that a manufacturer could choose to implement them.
Building a database of devices might be another option.
Related
I would like to know if there is a way to detect if my app is running on a PDA (with android OS) or a conventional smartphone?
There is no difference between a PDA and a traditional smartphone, except for possibly the presence of a cellular radio (and even that's not assured, there may be one). THere's also no difference between a tablet and a smartphone. They're marketing terms, not actual differences between devices. Take any smartphone and smack on an assistant looking UI and you have a PDA.
BTW, not all Android phones have the play store either- its common in Asia for low price brands to not pay Google for it and just load a version of AOSP on it.
So if you want actual help, you need to describe what's different about this device that matters to your program, and then we might be able to help you find workarounds. But there's no way to tell "PDA" because "PDA" has no meaning.
Today, I found a strange phenomenon that my Android device scanned fewer devices when I turned on bluetooth compared to my mobile phone. Therefore, I want to improve the scanning time to obtain as many detected devices as possible. But I looked it up, and someone said it involved the Bluetooth protocol stack. I'm confused. Can someone help me?
There's a few things that may be going on here.
Firstly, your phone may not be showing devices it cannot support. For example, certain devices may not be meant for phones to connect to, so are not shown in the list of one device, but may be shown in another.
Secondly, some Bluetooth devices do not broadcast/advertise themselves to other devices, which may cause it to show up on one device and not another.
Most modern phones will continuously search for Bluetooth devices while you are on the Bluetooth menu, but I don't believe that time will be the cause of the difference in the list of devices.
There are some apps that will show all the Bluetooth devices around you, including some more hidden devices or unsupported devices, if you don't want to program your own.
If this is for some kind of app, let us know what language or device you are targeting and we can provide some language-specific support.
If I make one device (e.g. Android tablet) indefinitely discoverable and make a second one (e.g. phone with BL 3.0 support) search for devices, it seems like I'll be able to extract server device name (http://developer.android.com/guide/topics/connectivity/bluetooth.html). By device name, I can deduct where in the world is the second device. What is wrong with sucn an approach? (I'm completely new to Android, just validating feasibility of some idea).
The problem with BLE is - 70% of android devices still have OS version < 4.3.
You can certainly do it within limits - I have some software running on my Mac that automatically locks the screen when my Bluetooth phone goes out of range. It doesn't use BLE.
One issue that you will have is the power consumption is greater than BLE, so battery life may be affected.
Another is that as the transmit power of the older Bluetooth can be higher than BLE you may find that the devices stay "in contact" for longer than you would like - It can certainly give you an idea of 'proximity/presence' although not really 'location'.
Also, if you pair the devices then they should be able to scan for one another without needing to be 'discoverable' - this is the approach used by the Mac software I mentioned. I am not familiar enough with the Android BT APIs to know whether you can detect a paired device but then not connect.
Also, taking the device MAC from the advertisement rather than name is probably 'safer' - A user may rename their device, but they won't change the MAC.
I'm looking for a way to scan for android devices in my area.
It should work without internetaccess nor gps.
Just knowing the mac-address is enough for this app.
The first way I was thinking of was to use bluetooth.
It's possible to scan for bluetooth devices, but it isn't possible to make your own device visibile forever (Android docs say that's possible, but it's limited to max 300 seconds).
The next what came up in my mind was to scan for wifi networks.
Almost every android phone uses wifi.
It's possible to scan wifi networks.
But is it possible to set my device as an accesspoint?
It can with systemsoftware but I would like to do it programmatically.
Does someone know if that's possible? Is there another way to let devices 'see' eachother?
Thnx
But is it possible to set my device as an access point?
This is possible by reflection, but not recommended. However you cannot force others to join your Wifi network. That is entirely their prerogative.
Is there another way to let devices 'see' each other?
Yes it is possible to see other device on the network. Check out these answers. If you have your apk installed on their device you can even try WiFi multicasting.
When I use Bluetooth on my computer, I have a choice of a few different types of devices to look for. One choice is "headset".
I want to make an application that will connect to another device as though it is nothing but a headset. So the audio and microphone will route from the Android phone to the other device.
Is this possible within the Bluetooth API? If so, is the Bluetooth Chat example the best thing to start with for something like this? Most of the information I can find deals with the opposite situation (using an actual headset with an Android device.)
Most phones are only bluetooth masters, cannot act as devices... I am afraid you are out of luck... Unless what you are doing is on a completely different device and in that case, no, the API will not handle that case.