Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8394429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:03:35+00:00 2026-06-09T20:03:35+00:00

I am working on a mp3 player app, which plays .mp3 files present anywhere

  • 0

I am working on a mp3 player app, which plays .mp3 files present anywhere inside an internal SD card.

I have used the following codes to fetch the .mp3 files present in internal storage.

ArrayList<File> inFiles = new ArrayList<File>();
File list[] = file.listFiles();
//Log.i("DIR", "PATH" +file.getPath());
for (int i = 0; i < list.length; i++) 
{
    // myList.add( list[i].getName() );
    File temp_file = new File(file.getAbsolutePath(),list[i].getName());
    //Log.i("DIR", "PATH" +temp_file.getAbsolutePath());
    if (temp_file.listFiles() != null) 
    {
        //Log.i("inside", "call fn");
        listfiles(temp_file);

    }
    else 
    {
        if (list[i].getName().toLowerCase().contains(".mp3"))
        {
            inFiles.add(list[i]);
        //Log.e("Music", list[i].getName());
        }
    }
}

How do I similarly get the .mp3 files from external SD card as well?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T20:03:38+00:00Added an answer on June 9, 2026 at 8:03 pm

    Trying using this:

    File root = Environment.getExternalStorageDirectory();
    

    That will get you the root of the external storage, provided that there is one. Then you can filter out files that aren’t .mp3

    Also consider looking at this: List all of one file type on Android device?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a music player, which receives a playlist with remote mp3 files
I'm working on a project which will have millions of small mp3 files that
Does anyone have any useful advice/links to information about working with mp3 files in
I'm working on a MP3 application in which I'd like to index the files
I'm working with some Audio files in my app (mp3, wav, ..etc) I was
I have a php-script (it fetches mp3-files from MySQL database) and flash-player for listening.
I'm working on a website that requires a flash mp3 player. I have absolutely
I'm currently working on an app that lets the user choose an MP3 audio
I have an mp3 encoding server running on Ubuntu (natty). This has been working
I am working with AS3 to build a very simple mp3 player on my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.