Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-24660

Android: openPhotoGallery is not working for downloads

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Release 6.0.0
    • Fix Version/s: Release 6.1.0
    • Component/s: Android
    • Labels:
    • Story Points:
      5
    • Sprint:
      2017 Sprint 01 SDK, 2017 Sprint 10 SDK

      Description

      content://com.android.providers.downloads.documents is currently not supported in TitaniumBlob.java, this prevents obtaining file information for images selected in the Downloads category of Titanium.Media.openPhotoGallery.

      TEST CASE

      var w = Ti.UI.createWindow({backgroundColor : 'grey'}),
          b = Titanium.UI.createButton({
              title : 'OPEN GALLERY',
              top : '10dp'
          }),
          iv = Ti.UI.createImageView({
              top : '65dp',
              width : '95%'
          }),
          sp = 'android.permission.READ_EXTERNAL_STORAGE';
       
      function openGallery() {
          Ti.Media.openPhotoGallery({
              mediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO],
              success: function(e) {
                  iv.height = e.media.height * (iv.rect.width / e.media.width);
                  iv.image = e.media;
       
                  alert('filename: ' + e.media.file.name);
                  alert('filesize: ' + e.media.length);
              },
              error: function(e) {
                  Ti.API.error(JSON.stringify(e));
              }
          });
      }
       
      b.addEventListener('click', function(e) {
          if (Ti.Android.hasPermission(sp)) {
              openGallery();
          } else {
              Ti.Android.requestPermissions([sp], function(e) {
                  if (e.success) {
                      openGallery();
                  } else {
                      Ti.API.info('ERROR: ' + e.error);
                  }
              });
          }
      });
       
      w.add(b);
      w.add(iv);
       
      w.open();
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                smohammed Samir Mohammed
                Reporter:
                dfoxinator David Fox
                Reviewer:
                Yordan Banev
                Tester:
                Samir Mohammed
              • Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-10658
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration