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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:06:45+00:00 2026-05-26T01:06:45+00:00

In my app, I am intending to store user generated files in a custom

  • 0

In my app, I am intending to store user generated files in a custom directory (that I intend to create) within the user’s SD card storage.

I am doing that using:

String pathToExternalStorage = Environment.getExternalStorageDirectory().toString();
File appDirectory = new File(pathToExternalStorage + "/" + "AppName");
// have the object build the directory structure, if needed.
appDirectory.mkdirs();

Would you recommend taking this approach? Will this folder and files persist if the user deletes my application?

Because, the Android documentation says:

If you want to save files that are not specific to your application
and that should not be deleted when your application is uninstalled,
save them to one of the public directories on the external storage.
These directories lay at the root of the external storage, such as
Music/, Pictures/, Ringtones/, and others.

I would need the files to persist even if the user uninstalls the app, but I did not wanted to clutter an existing folder my adding my files there – I thought creating a separate folder would be better. I am targetting API v9 and above.

  • 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-05-26T01:06:45+00:00Added an answer on May 26, 2026 at 1:06 am

    Seems like a pretty good way to do it. I do it in a similar way, except I keep everything in the data folder, i.e. sdcard/data/{packagename}.

    Update:

    You shouldn’t do it like that. Use Environment.getDataDirectory() instead.

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

Sidebar

Related Questions

I'm intending to create a flash app that pulls images from facebook and displays
app.get(/:name?/:group?, function(req, res){... is matching files that are in my public directory. So if
Our app uses a component that requires a license file in the directory with
I'm working on a app that has a UITableView that uses custom UITableViewCells. When
I am intending to build an iPhone/iPad app that has a feature allowing users
App store approval guideline says that Apps that send Push Notifications without first obtaining
My app is expanding, but the reqs dictate that there should be only one
My app was built with SDK 2.2.1 version even before 3.0 beta appear. User
My app has several buttons which trigger different events. The user should NOT be
Google App Engine is a cloud computing architecture that supports java based web services

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.