Type: New Feature
Affects Version/s: Release 126.96.36.199, Release 3.3.0
Titanium SDK version: 188.8.131.52
Platform & version: Android 2.2+
Host Platform: Mac OSX 10.7.2
Titanium Studio version: 184.108.40.206112132151
Using the current array of functions available to Ti.Android.Intent, there is no way to get binary data from a Ti.Android.EXTRA_STREAM extra. Ti.Android.EXTRA_STREAM wants to return an Android URI, which we have no means to return. In addition, URIs will be tough to resolve on the developer's end unless they are just passing them to another Intent.
For example, a very common case is that a developer would like to use an Android Intent Filter in their Titanium app to be able to receive SEND Intents for things like images. Often a user will want to show that image in their Titanium app immediately. A URI isn't going to do them much good, unresolved. To that end a Ti.Android.Intent.getBlobExtra() function would be extremely useful.
As this code reacts to an Intent, it will require that an Intent Filter is setup to receive it. Use the filter below in a custom AndroidManifest.xml. Make sure this Intent Filter is inside the main activity.
To test, long press on an image in the android gallery and select "share". This test code should then appear as an option in the Intent Filter list.
- TIMOB-3448 is a very similar issue. That issue requests access to the underlying URI to be able to pass it to another Intent. What I am proposing would be to take it a step further by resolving the URI behind the scenes and returning the data as a blob.
- TIMOB-7249 should be addressed before, or shortly after, this feature request is included in titanium_mobile.
TIMOB-7249shows that the getData(), getAction(), and getType() functions do not return the appropriate values. This will be a problem for any app that uses an Intent Filter that attempts to handle more than one type of data.