[TIMOB-3164] Android: Expose MediaScannerConnection
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T02:01:05.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.7.0, Sprint 2011-11 |
Components | Android |
Labels | android, feature, release-1.7.0, rplist |
Reporter | Dawson Toth |
Assignee | Don Thorp |
Created | 2011-04-15T03:38:28.000+0000 |
Updated | 2011-04-17T02:01:05.000+0000 |
Description
Problem
When you save an image to the SDCard, the media scanner won't pick it up until the next time it runs (when the phone restarts).
Solution
Exposing the MediaScannerConnection would let developers get the image into the gallery right away.
Android Documentation
http://developer.android.com/reference/android/media/MediaScannerConnection.html"> http://developer.android.com/reference/android/media/MediaScannerCo...
Associated Helpdesk Ticket
http://developer.appcelerator.com/helpdesk/view/69031">http://developer.appcelerator.com/helpdesk/view/69031
Attachments
File | Date | Size |
---|---|---|
fj.jpg | 2011-04-15T03:38:29.000+0000 | 114242 |
(from [8e7685715cea203abbe9df1c9e2f42f6aafe3e0a]) Doc for scanMediaFiles [#3164] https://github.com/appcelerator/titanium_mobile/commit/8e7685715cea203abbe9df1c9e2f42f6aafe3e0a"> https://github.com/appcelerator/titanium_mobile/commit/8e7685715cea...
(from [b4a40009d732f8a233f7fce967c7874c3f817790]) Expose the Android media scanner's file scanning service via Ti.Media.Android.scanMediaFiles. [#3164] https://github.com/appcelerator/titanium_mobile/commit/b4a40009d732f8a233f7fce967c7874c3f817790"> https://github.com/appcelerator/titanium_mobile/commit/b4a40009d732...
QE testing:
Here is a good test app.js:
Put the attach fj.jpg in your Resources folder. Run the app, click the button and confirm that you get a URI in the little console label at the bottom. "No Uri" means it didn't work. After you see that the uri is there, you can go to the Android Gallery application and see the photo (a picture of the casket of Emperor Franz Josef of Austria).
Tested with Titanium SDK version: 1.7.0 (03/22/11 09:36 42d2187) on
Emulator 2.1
Samsung Nexus S 2.3.2