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

  • Home
  • SEARCH
  • 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 9221891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:40:55+00:00 2026-06-18T03:40:55+00:00

I am working on a task to read SD card files and I am

  • 0

I am working on a task to read SD card files and I am showing a progress bar with calculated percentage based on SD card files like some antivirus software in Android. I don’t know how to implement this functionality. My SD card read files code shown below:

File root = new File (Environment.getExternalStorageDirectory().getAbsolutePath());
scan(root);

Scan function code shown below:

   public void scan (File path) {

            for (File f : path.listFiles()) {
                if (f.isFile()) {
                   Toast.makeText(getApplicationContext(),f.getAbsoluteFile().toString(),Toast.LENGTH_SHORT).show();
                }
                else {

                }
            }
        }

Can you show me how to do this?

  • 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-18T03:40:57+00:00Added an answer on June 18, 2026 at 3:40 am

    I guess that a file list has a length. You can use this length in your loop to compute a percentage of number of files completed so far. Perhaps something like:

    File[] files = path.listFiles();
    for (i=0; i<files.length; i++) {
        // Report i / files.length percent done
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my working task is to read sd card files and i want to show
I'm working on a task system and I'd like to be able to submit
hey guys im working on a task to make my story's links like this
I'm working on an ASP.NET MVC task list and I'd like to get fancy
I'm working on a Method which does some task asynchronously. Let's call it: AsyncMethod();
Hi i've been working on a task of porting some code from some old
My company is working on a project that needs to read XML files within
Im working on a java project where i need to read some objects from
I am using a Task to read some data from the Database etc. Let's
I'm creating a JSon jQuery caller to read the accomplishment percentage of a task.

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.