How to get internal shared storage and sd card file paths of document files?2019 Community Moderator ElectionHow to delete a file from SD card?How can I get external SD card path for Android 4.0+?Unable to retrieve the image from SDCardHow do I get the file name from a String containing the Absolute file path?How to get full path of selected file on change of <input type=‘file’> using javascript, jquery-ajax?Get path of Specific file from SD CardStore video files on SD card in Android 5Do I need to store paths to my files or can I simply note their storage type?What is the expected behaviour of Adoptable Storage on Android M and how it should be handled by apps?Device Admin and SD card as internal storage

Sometimes a banana is just a banana

Are small insurances worth it

How can I handle a player who pre-plans arguments about my rulings on RAW?

Can a space-faring robot still function over a billion years?

Where is this quote about overcoming the impossible said in "Interstellar"?

When was drinking water recognized as crucial in marathon running?

If nine coins are tossed, what is the probability that the number of heads is even?

Correct physics behind the colors on CD (compact disc)?

Difference between 'stomach' and 'uterus'

Would the melodic leap of the opening phrase of Mozart's K545 be considered dissonant?

Why won't the strings command stop?

Practical reasons to have both a large police force and bounty hunting network?

Is every open circuit a capacitor?

How to mitigate "bandwagon attacking" from players?

How to kill a localhost:8080

Book about a time-travel war fought by computers

Rationale to prefer local variables over instance variables?

Why did the Cray-1 have 8 parity bits per word?

Formatting a table to look nice

Giving a talk in my old university, how prominently should I tell students my salary?

Can the Shape Water Cantrip be used to manipulate blood?

How to fix my table, centering of columns

PTIJ: Aharon, King of Egypt

Create chunks from an array



How to get internal shared storage and sd card file paths of document files?



2019 Community Moderator ElectionHow to delete a file from SD card?How can I get external SD card path for Android 4.0+?Unable to retrieve the image from SDCardHow do I get the file name from a String containing the Absolute file path?How to get full path of selected file on change of <input type=‘file’> using javascript, jquery-ajax?Get path of Specific file from SD CardStore video files on SD card in Android 5Do I need to store paths to my files or can I simply note their storage type?What is the expected behaviour of Adoptable Storage on Android M and how it should be handled by apps?Device Admin and SD card as internal storage










2















I am trying to get file paths of videos from internal shared storage and sd card.



I have randomly saved videos in random folders in internal shared storage and external storage.



 public ArrayList<String> getVideosPath(Activity activity,Context context)
{
listOfAllImages = new ArrayList<String>();
Cursor cursor;

final String[] columns = MediaStore.Video.Media.DATA, MediaStore.Video.Media._ID;
final String orderBy = MediaStore.Video.Media._ID;
//Stores all the images from the gallery in Cursor
cursor = getContentResolver().query(
MediaStore.Video.Media.EXTERNAL_CONTENT_URI, columns, null,
null, orderBy);
//Total number of images
int count = cursor.getCount();

//Create an array to store path to all the images
String[] arrPath = new String[count];

for (int i = 0; i < count; i++)
cursor.moveToPosition(i);
int dataColumnIndex = cursor.getColumnIndex(MediaStore.Video.Media.DATA);

//Store the path of the image
arrPath[i] = cursor.getString(dataColumnIndex);


Bitmap thumb = ThumbnailUtils.createVideoThumbnail(arrPath[i],
MediaStore.Images.Thumbnails.MINI_KIND);

// BitmapFactory.Options options = new BitmapFactory.Options();
// options.inSampleSize = 4;
// Bitmap b = BitmapFactory.decodeFile(arrPath[i], options);



bitmap.add(thumb);
// drawimages_onvideo.add(thumb);
Log.i("PATH", arrPath[i]);
listOfAllImages.add(arrPath[i]);



Although it gets the files from sd card and phone storage, the paths are different.



for e.g there are 2 video files one in android storage and one in sd-card and there path are



android storage : /storage/emulated/0/Movies/videoplay.mp4



and



sd-card : /storage/BBF7-A8D2/videos/videoplay.mp4



and i am getting these 2 files but the paths which are displayed to me are these:



/storage/emulated/0/Movies/videoplay.mp4
/storage/emulated/0/Movies/videoplay.mp4


What is wrong ?










share|improve this question









New contributor




A-J is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
























    2















    I am trying to get file paths of videos from internal shared storage and sd card.



    I have randomly saved videos in random folders in internal shared storage and external storage.



     public ArrayList<String> getVideosPath(Activity activity,Context context)
    {
    listOfAllImages = new ArrayList<String>();
    Cursor cursor;

    final String[] columns = MediaStore.Video.Media.DATA, MediaStore.Video.Media._ID;
    final String orderBy = MediaStore.Video.Media._ID;
    //Stores all the images from the gallery in Cursor
    cursor = getContentResolver().query(
    MediaStore.Video.Media.EXTERNAL_CONTENT_URI, columns, null,
    null, orderBy);
    //Total number of images
    int count = cursor.getCount();

    //Create an array to store path to all the images
    String[] arrPath = new String[count];

    for (int i = 0; i < count; i++)
    cursor.moveToPosition(i);
    int dataColumnIndex = cursor.getColumnIndex(MediaStore.Video.Media.DATA);

    //Store the path of the image
    arrPath[i] = cursor.getString(dataColumnIndex);


    Bitmap thumb = ThumbnailUtils.createVideoThumbnail(arrPath[i],
    MediaStore.Images.Thumbnails.MINI_KIND);

    // BitmapFactory.Options options = new BitmapFactory.Options();
    // options.inSampleSize = 4;
    // Bitmap b = BitmapFactory.decodeFile(arrPath[i], options);



    bitmap.add(thumb);
    // drawimages_onvideo.add(thumb);
    Log.i("PATH", arrPath[i]);
    listOfAllImages.add(arrPath[i]);



    Although it gets the files from sd card and phone storage, the paths are different.



    for e.g there are 2 video files one in android storage and one in sd-card and there path are



    android storage : /storage/emulated/0/Movies/videoplay.mp4



    and



    sd-card : /storage/BBF7-A8D2/videos/videoplay.mp4



    and i am getting these 2 files but the paths which are displayed to me are these:



    /storage/emulated/0/Movies/videoplay.mp4
    /storage/emulated/0/Movies/videoplay.mp4


    What is wrong ?










    share|improve this question









    New contributor




    A-J is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      2












      2








      2








      I am trying to get file paths of videos from internal shared storage and sd card.



      I have randomly saved videos in random folders in internal shared storage and external storage.



       public ArrayList<String> getVideosPath(Activity activity,Context context)
      {
      listOfAllImages = new ArrayList<String>();
      Cursor cursor;

      final String[] columns = MediaStore.Video.Media.DATA, MediaStore.Video.Media._ID;
      final String orderBy = MediaStore.Video.Media._ID;
      //Stores all the images from the gallery in Cursor
      cursor = getContentResolver().query(
      MediaStore.Video.Media.EXTERNAL_CONTENT_URI, columns, null,
      null, orderBy);
      //Total number of images
      int count = cursor.getCount();

      //Create an array to store path to all the images
      String[] arrPath = new String[count];

      for (int i = 0; i < count; i++)
      cursor.moveToPosition(i);
      int dataColumnIndex = cursor.getColumnIndex(MediaStore.Video.Media.DATA);

      //Store the path of the image
      arrPath[i] = cursor.getString(dataColumnIndex);


      Bitmap thumb = ThumbnailUtils.createVideoThumbnail(arrPath[i],
      MediaStore.Images.Thumbnails.MINI_KIND);

      // BitmapFactory.Options options = new BitmapFactory.Options();
      // options.inSampleSize = 4;
      // Bitmap b = BitmapFactory.decodeFile(arrPath[i], options);



      bitmap.add(thumb);
      // drawimages_onvideo.add(thumb);
      Log.i("PATH", arrPath[i]);
      listOfAllImages.add(arrPath[i]);



      Although it gets the files from sd card and phone storage, the paths are different.



      for e.g there are 2 video files one in android storage and one in sd-card and there path are



      android storage : /storage/emulated/0/Movies/videoplay.mp4



      and



      sd-card : /storage/BBF7-A8D2/videos/videoplay.mp4



      and i am getting these 2 files but the paths which are displayed to me are these:



      /storage/emulated/0/Movies/videoplay.mp4
      /storage/emulated/0/Movies/videoplay.mp4


      What is wrong ?










      share|improve this question









      New contributor




      A-J is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I am trying to get file paths of videos from internal shared storage and sd card.



      I have randomly saved videos in random folders in internal shared storage and external storage.



       public ArrayList<String> getVideosPath(Activity activity,Context context)
      {
      listOfAllImages = new ArrayList<String>();
      Cursor cursor;

      final String[] columns = MediaStore.Video.Media.DATA, MediaStore.Video.Media._ID;
      final String orderBy = MediaStore.Video.Media._ID;
      //Stores all the images from the gallery in Cursor
      cursor = getContentResolver().query(
      MediaStore.Video.Media.EXTERNAL_CONTENT_URI, columns, null,
      null, orderBy);
      //Total number of images
      int count = cursor.getCount();

      //Create an array to store path to all the images
      String[] arrPath = new String[count];

      for (int i = 0; i < count; i++)
      cursor.moveToPosition(i);
      int dataColumnIndex = cursor.getColumnIndex(MediaStore.Video.Media.DATA);

      //Store the path of the image
      arrPath[i] = cursor.getString(dataColumnIndex);


      Bitmap thumb = ThumbnailUtils.createVideoThumbnail(arrPath[i],
      MediaStore.Images.Thumbnails.MINI_KIND);

      // BitmapFactory.Options options = new BitmapFactory.Options();
      // options.inSampleSize = 4;
      // Bitmap b = BitmapFactory.decodeFile(arrPath[i], options);



      bitmap.add(thumb);
      // drawimages_onvideo.add(thumb);
      Log.i("PATH", arrPath[i]);
      listOfAllImages.add(arrPath[i]);



      Although it gets the files from sd card and phone storage, the paths are different.



      for e.g there are 2 video files one in android storage and one in sd-card and there path are



      android storage : /storage/emulated/0/Movies/videoplay.mp4



      and



      sd-card : /storage/BBF7-A8D2/videos/videoplay.mp4



      and i am getting these 2 files but the paths which are displayed to me are these:



      /storage/emulated/0/Movies/videoplay.mp4
      /storage/emulated/0/Movies/videoplay.mp4


      What is wrong ?







      filepath android-sdcard android-storage






      share|improve this question









      New contributor




      A-J is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      A-J is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 18 hours ago









      farbiondriven

      1,5192823




      1,5192823






      New contributor




      A-J is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 19 hours ago









      A-JA-J

      113




      113




      New contributor




      A-J is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      A-J is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      A-J is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          A-J is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55019423%2fhow-to-get-internal-shared-storage-and-sd-card-file-paths-of-document-files%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          A-J is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          A-J is a new contributor. Be nice, and check out our Code of Conduct.












          A-J is a new contributor. Be nice, and check out our Code of Conduct.











          A-J is a new contributor. Be nice, and check out our Code of Conduct.














          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55019423%2fhow-to-get-internal-shared-storage-and-sd-card-file-paths-of-document-files%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

          Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

          2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived