[TIMOB-1799] Android: Add API Support for Clipboard
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:57:12.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.5.0 |
Components | Android |
Labels | android, feature |
Reporter | Don Thorp |
Assignee | Don Thorp |
Created | 2011-04-15T03:02:43.000+0000 |
Updated | 2011-04-17T01:57:12.000+0000 |
Description
See ticket #648 Creating an android specific ticket for better tracking.
Feature from Brion
Spent a little weekend hacking time and threw together a quick
port of the Titanium.UI.Clipboard module interface from
Desktop:
http://github.com/brion/titanium_mobile/tree/clipboard">http://github.com/brion/titanium_mobile/tree/clipboard
API docs, KitchenSink demo, Android, and iOS implementations are on
that branch in separate commits.
The Android clipboard is limited to plaintext, which appears to
work nice enough in my initial testing.
On iOS, in addition to text, there is theoretical support for URLs
(marked as 'URL' or 'text/uri-list' as per Desktop, and using
strings on our side) and images (as 'image' or actual MIME type). I
haven't actually tested these code paths yet. :) Other data types
may or may not be properly converted by the system libraries from
the MIME type to the native clipboard UTI, and will also expect
data in blob form.
Note: There is an example in KS at the end of the platforms tab.
(from [1cb0d8d9924777ca851e3192e395dc975f23a7fd]) [#1799 state:fixed-in-qa] Initial Ti.UI.Clipboard module for Android, following the Ti.UI.Clipboard API from Titanium Desktop.
Since the Android clipboard only appears to support plain text strings, only text is supported. The getData(), setData(), and hasData() functions will pass text through if given 'text/plain', and otherwise do nothing.
http://github.com/appcelerator/titanium_mobile/commit/1cb0d8d9924777ca851e3192e395dc975f23a7fd"> http://github.com/appcelerator/titanium_mobile/commit/1cb0d8d992477...
1.4.2.5935b3 g1 1.6, 2.2 sim. new record for iOS parity