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 9137723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:09:46+00:00 2026-06-17T09:09:46+00:00

In Android Development, how can we wipe out the whole SD card through coding?

  • 0

In Android Development, how can we wipe out the whole SD card through coding? I need to format the SD card contents through my application.

  • 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-17T09:09:47+00:00Added an answer on June 17, 2026 at 9:09 am

    I found the answer,
    just call wipeMemoryCard();

    public void wipeMemoryCard() {
        try {
            File deleteMatchingFile = new File(Environment.getExternalStorageDirectory().toString());
            File[] filenames = deleteMatchingFile.listFiles();
            if (filenames != null && filenames.length > 0) {
                for (File tempFile : filenames) {
                        if (tempFile.isDirectory()) {
                            wipeDirectory(tempFile.toString());
                        } else {
                            tempFile.delete()
                        }
                }
            }
        } catch (Exception e) {
        }
    }
    
    private void wipeDirectory(String name) {
        try {
            File directoryFile = new File(name);
            File[] filenames = directoryFile.listFiles();
            if (filenames != null && filenames.length > 0) {
                for (File tempFile : filenames) {
                        if (tempFile.isDirectory()) {
                            wipeDirectory(tempFile.toString());
                        } else {
                            tempFile.delete()
                        }
                }
            }
        } catch (Exception e) {
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anybody please tell me that how closely Android Application Development is associated with
I am new to Android Development and trying to create a sample application. Can
Just getting started with Android development and I can't figure out why this won't
I'm new to android development. I can't figure out why this is crashing in
I'm a newbie on Android development platform. Can a third party application (say the
In Eclipse (Android development) you can go to project properties and then: Open Android
In Android Development, I can simply start another Android App with data from my
Is Android development restrictive in any way like the iPhone , or can you
I'm quite new to Android development. My understanding is that you can create several
When doing Android Development where can I find a list all the valid XML

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.