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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:18:21+00:00 2026-05-16T15:18:21+00:00

I want to create a file on the SD-Card and later save a CSV

  • 0

I want to create a file on the SD-Card and later save a CSV file in it.

From surfing around I noticed that there seem to be two ways about going about it:

http://developer.android.com/guide/topics/data/data-storage.html#filesExternal

If you’re using API Level 8 or
greater, use getExternalFilesDir() to
open a File that represents the
external storage directory where you
should save your files. This method
takes a type parameter that specifies
the type of subdirectory you want,
such as DIRECTORY_MUSIC and
DIRECTORY_RINGTONES (pass null to
receive the root of your application’s
file directory).

If you’re using API Level 7 or lower,
use getExternalStorageDirectory(), to
open a File representing the root of
the external storage. You should then
write your data in the following
directory:

/Android/data//files/

And http://www.anddev.org/working_with_files-t115.html :

FileWriter f = new FileWriter("/sdcard/download/possible.txt");

What way should I use? If the first, how do I write my application to be compatible with both API level <=7 and >=8? Is there some good tutorial for doing it the first way?

  • 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-16T15:18:22+00:00Added an answer on May 16, 2026 at 3:18 pm

    Well if you need compatibility with API level 7 and lower, use getExternalStorageDirectory() method. Also note that staring from API level 4 you have to request permission to write onto SD card:

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a single shape file from multiple mxd's that have multiple
I want to create a table from xml spreadsheet or csv file in MySQL.
I want to create XML file from my Excel file through .NET (c#). My
I want to create a file that only resides in memory... In looking through
I want to create a .txt file inside Temporary Internet folder.For that I am
Alright I want to create a .csv file in C#. I have been looking
I want to create an app that reads and displays a big text file,
I want to create a file on the webserver dynamically in PHP. First I
I want to create a file using C++, but I have no idea how
Language used: C# Theory: I want to create a file with the flag FileOptions.DeleteOnClose

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.