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
Related
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.
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.
I have been checking since some time to mount external drives to android phone i.e., if I plug external drive(hard/flash/camera) to android device, the android phone should be able to access the storage file system.
There are apps in the market which controls external devices through phone.
I can use the USB Host mode { http://developer.android.com/guide/topics/connectivity/usb/index.html } to communicate with the usb device. But USB Host and Accessory modes are directly supported in Android 3.1 (API level 12) or newer platforms.
While an app named DSLR Controller { https://play.google.com/store/apps/details?id=eu.chainfire.dslrcontroller&hl=en } , requires Android 2.1 or above. Since the application is based on accessing the camera through android phone. If the app displays the correct info, then the task of accessing the storage of camera (or any other drive) seems to be possible.
But I want to use the application in lower version as well. Any kind of help will be appreciated.
Please comment,if need any more description of the problem.
Thanks.
You can create an application based on FileManager open source project on Github. You can specify there to identify your device. You can change these code according to your need.
Here is the link Adroid-File-Manager
If you just want to be able to access USB storage (like a flash drive) you can open the files the normal Java way (java.io.File, etc). Android ICS automatically mounts flash drives under /sdcard/usbStorage/, but I'm not sure about previous versions or other types of hardware. It might still work, though, so I'd suggest that you test it and see what happens.
The only sure way of getting this done is to use API level above 12, otherwise a few phones may have support for usb host but most of them wont support it.
The reason being first of all you need hardware support for usb host, even if that is present the drivers needed might not be compiled into the kernel, i did some work while trying to implement usb host on nook color, even though it had hardware support, getting usb host working took almost 2 months and a dedicated app. So its not something you will be able to do for every device. A few might support it out of the box but even those would need root and lots more work for mounting drives and all that..
the DSLR camera also does it the same way look at the requirements
- Android device with ARMv7-A or newer CPU architecture (most 1ghz+ devices)
- Not rooted: Android 3.1 or higher with USB host kernel+API support
- Rooted: Android 2.3.1 or higher with USB host kernel support
These are the only devices that can support USB host.
From the app description, Android 2.x devices need to be rooted. This suggests that they have some native implementation of the USB host code (possibly a pre-compiled kernel module they load).
Therefore, the solution for this varies based on the specific hardware and software (kernel, vendor modifications, skin) it is running.
I have noticed on the official Android blog that WiFi Direct APIs are supported on google phone which are having versions 4.0 or later. Also I have seen the code to access WiFi Direct API.
But I have doubt that on some blogs people have written that some 2.3 version android devices also support WiFi Direct. So same code we are writing for 4.0 or later , will work on the 2.3 version android devices which support WiFi Direct?. I have failed to find the code which is compatible to android version 2.3
Again I have noticed ,Alternate solution for this is "AllJoyn" (https://www.alljoyn.org/) , but don't know that is it the right way to use WiFi Direct ?
Can anybody please help me ?
The fact that a device supports WiFi Direct (eg: version 2.3) doesn't necessarily mean that you have access to the WiFi Direct API (available from 4.0)
On the version 2.3 examples, consider that the feature is there but the app developer can't
directly interact with it.
I think that on the blogs you are talking about, the guys have just enabled the WiFi Direct on 2.3 but don't do anything by code.
If you want to do something by code with WiFi Direct, you need a device WD enabled and which runs on 4.0 at least so you have access to the API.
AllJoyn won't solve your problem. AllJoyn provides a layer on top of the transport APIs so the developer doesn't have to care if the data will be transferred via Bluetooth, WIFi legacy or WiFi Direct.
Android has USB accessory or host mode in 2.3.4, 3.1 and higher versions.
But when I use Android 2.3.3 or 2.2, I can power the connected camera and also can access pen drive content.
Why is this happening and then? Is it just the library that we have in some of the versions and nothing about the internal hardware?
If not about internal hardware than is it possible to create our own driver for all version to have the device in host mode?
Android itself support host mode in almost all recent versions. So you can connect keyboard, mouse, usb-drive, etc to a android device. This is done on system level, but not exposed to user's apps.
In Android 2.3.3 (api level 10) was added interfaces to access usb device from userspace. So now you can write app that communicates with an usb device.
Technically, you can write JNI wrapper for libusb, and use host functionality in earlier Android releases, but there are many pitfalls, so I don't recommend you to do this.