How to use Wi-Fi Direct (P2P) on Android 3.x devices? - android

Android developer documentation states (for example here: http://developer.android.com/guide/topics/connectivity/wifip2p.html) that Wi-Fi P2P is available since API level 14, i.e. on Android 4.x devices.
However, a few days ago I found a device, Samsung P6800 Galaxy Tab, which runs on Android 3.2 and has full support (in the system options, i.e. not via a custom app) for Wi-Fi Direct! (as seen for example here: http://www.gsmarena.com/samsung_p6800_galaxy_tab_7_7-4136.php but I did check it personally, too)
So I'm wondering how is this possible, is there a way how to use this API/functionality even in earlier versions?

Related

Do all android devices above a certain api support mtp?

I need to develop an app for windows for data transfers to android devices via mtp. That is when android is connected to windows via USB cable and android offers mtp menu as protocol for USB.
Can someone tell from which android version onwards can I assume that the device definitely has mtp support. Can this assumption be even made ?
Secondly is it android feature or does the mtp support depends on manufacturer regardless of android version ?
If you check the Android Compatibility Definition Document for Lollipop/Android 5.0 section 7.6.2 states that:
Device implementations MAY use USB mass storage, but SHOULD use Media Transfer Protocol
As it doesn't read 'MUST', I'm afraid there are no guarantees that devices which would have Google Play would have MTP, but I would be surprised if the major manufacturers didn't follow it and have an MTP implementation.
You can check the documents for older version of Android here:
http://source.android.com/compatibility/downloads.html
The [MTP] was added since Android API 12,
which Platform Version is [Android 3.1.x].
so, the [above a certain api] may be android 3.1
and ,this is the android feature,and I think the manufactur has no reason to unenable it.
Android API : developer.android.com

Wi-Fi Direct and Android Support

I am wanting to use Wi-Fi Direct in a solution but am unsure which platforms will support it.
Is Wi-Fi Direct dependent on phone type or Android version?
I need to know if I can develop an App with Wi-Fi direct features on a Xiaomi running MIUI version of Android 4.2.2
Android Developer site Wifi-Direct tutorial
Wifi Direct support was added in API level 14, i.e. ICS, so the phone you specify is likely supporting the feature.

Scan a 4.0 Bluetooth device it's not working

Im doing an android app to pair a non-android device with bluetooth 4.0 LE, but my 4.0Bluetooth-android-phone doesnt discover the device anyway. I discover other devices like phones, or tablets.
The question is: Do i have to add some extra code if i want to work with bluetooth 4.0 devices?
Thanks.
Bluetooth 4.0 (or BLE) is not supported in Android at the moment. It will be supported in Android 4.3 (API level 18). Among other places, you can read more about it here and here. Several Android devices has already been certified with Bluetooth 4.0 support, but it won't work before the update is released.
That said, according to this post some devices does support it, but they need custom BLE libraries that the companies have developed.

Atheros Bluetooth 4.0 Support API for Android

I am involved in a Android Project that connects the sensor using Bluetooth 4.0. AFAIK android didn't support Bluetooth 4.0. I tried with my laptop bluetooth 4.0. I tried with Broadcom using this. Later i came to know my Laptop Bluetooth 4.0 is Atheros Bluetooth 4.0 and later i searched for Atheros Bluetooth 4.0 API using android mobiles and tablets. I saw Qualcomm having Bluetooth 4.0 tablet. I want to know, is Atheros giving API for Bluetooth 4.0 for Android SDK.
Finally, long way of search, i found that up to today(23/12/12), Atheros not giving Bluetooth API for developers. But they are providing other API's for Audio, Camera, Device Info and Sensor(mobile shake). So, can't try on laptop also. Dgel comment and link helped me a lot and made me, come to the conclusion.
Android Bluetooth (and other) API's are not specific to the hardware (or software stack).
They are generic and fairly high-level, and Yes they include Bluetooth 4.0.
The actually support for BT 4 depends on the device. Recent Nexus devices support BT4 (both in hardware and in software) as long as they have the Android 4.2 update.
If you root your device you can get to the 'raw' vendor API's, but I don't know what that looks like for BT4, or wheteher any of that is published. In most cases that is Broadcom based, not Atheros.
EDIT:
I just saw this:
http://code.google.com/p/broadcom-ble/
I'm not familiar with this, but I suspect that it was just a stop gap measure before BT4 was added to the official Android API in 4.1.

Bluetooth Smart (4.0) / GATT support in Android 4.0?

I'm trying to find way to work with Bluetooth 4.0 (AKA Bluetooth Smart) devices using modern Android smartphones, namely - HTC One V.
As I understood, there is some issues using GATT profile even in Android 4.0 with Bluetooth 4.0 hardware because of API limitations.
I saw Motorola released it's own API for BT LE, but not sure it will work for other vendors.
My goal is to get universal support for all smartphones with appropriate hardware.
Any suggestion for solution are highly appreciated.
Alexey
PS: Yes, I saw Android API for HDP, but it seems to be used only with 'classic' Bluetooth devices (not low energy ones, as BT LE does).
Unfortunately there are no Android native GATT APIs simply because Android currently does not support Bluetooth Low Energy at all. This may change in upcoming Android releases, but today manufacturers instead integrate 3rd party Bluetooth stacks with Low Energy support from vendors like Qualcomm, Broadcom or CSR. Those come with their own set of APIs, obviously limiting compatibility to the set of phones using that particular vendor's stack.
The good news is that on other platforms like iOS or Windows 8 there are native GATT BLE APIs, and those are well supported. For Android, we will have to wait until Google decides to integrate the Linux/BlueZ work that has been done on BLE with Android.
After some research I can only say this:
Motorola has sided with Broadcom to develop a proprietary API. It would seem it is extremely limited since it states there's support for existing profiles only. Check it out here.
Samsung fails to provide any information regarding its BLE API, which I can verify exists and is called samsung.bluetoothle. I actually decompiled some apps from Google Play that use the SGSIII's BLE capabilities and found a couple of methods that do not exist in Android's native BT API, and they're names clearly state they're BLE related. I've tried using them through java reflection and am currently working out the possibility of developing a library. But tests I've run so far have had shakey results at best. There is also a thread on Samsung's developer forum, I would suggest making some pressure here if you're interested.
Google has made almost no remarks in this aspect. There's a thread regarding this issues in the Galaxy Nexus, which you should star, with a lot of people complaining. The closest thing to an answer from Google can be found here.
[UPDATE]
Samsung has also modified a couple of Android's classes, more especifically:
BluetoothAdapter
BluetoothDevice
[UPDATE]
Since I've put this issue aside for a while due to lack of support from both Google and Samsung I'll post what I've learned so far:
BluetoothAdapter new methods:
public boolean android.bluetooth.BluetoothAdapter.leTestEnd()
public boolean android.bluetooth.BluetoothAdapter.setAvStreaming(boolean)
public boolean android.bluetooth.BluetoothAdapter.setScanLE(boolean)
public void android.bluetooth.BluetoothAdapter.setScoPathChange(int)
public boolean android.bluetooth.BluetoothAdapter.startLeDiscovery()
To use them do the following:
BluetoothAdapter ba = new BluetoothAdapter();
Method starteLeDiscoveryMethod = null;
starteLeDiscoveryMethod = ba.class.getMethod("startLeDiscovery");
starteLeDiscoveryMethod.invoke(ba);
NOTE: This method in particular works somewhat like the regular startDiscovery() method but, at least for me, it discovers the BLE device 2 out of 5 times.
And remember, this is only for the SGSIII. I haven't gotten around to extracting the new methods in BluetoothDevice but when I do, I'll post them here.
SDK 18 has support for it now. Docs are here:
http://developer.android.com/guide/topics/connectivity/bluetooth-le.html
Testing on my Nexus 4 is crashing the bluetooth stack.
HTC has had BLE support since last year with HTC One X+, Droid DNA and of course the HTC One. Initially the HTC BLE API was upon request but it's now been freely downloadable at http://htcdev.com.
Yes the new standard Android BLE API from Google in Android API Level 18 is coming very soon (see preview from IO video) - but you can wrap third party APIs (HTC, Samsung, etc) in a compatible way to support the new standard API as all the APIs are quite similar in their support of the GATT profile (similar to IOS).
BluetoothGatt api available in andorid
https://developer.android.com/reference/android/bluetooth/BluetoothGatt.html
As discovered, 4.3 has support for BLE, but it so broken, especially on Nexus devices.
At my opinion, it's not ready for production.

Categories

Resources