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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:03:55+00:00 2026-05-26T08:03:55+00:00

So I’m making this android application, that needs to read data from user-provided CSV

  • 0

So I’m making this android application, that needs to read data from user-provided CSV files.

The CSV files are more confortably edited on a desktop computer, so I have no editor in the app, which is ‘read-only’ ; I assume there is a file on the phone’s SD card.

Following the Data Storage documentation, I managed to write a dumb version that reads the file from external storage, hard coding the folder location relative to whetever getExternalStorageDirectory returns. So for the moment I have :

 private static final String CSV_FILE = "/Android/foo/bar.csv"
 ...
 File f = new File(Environment.getExternalStorageDirectory(), CSV_FILE);

Then I would connect my phone to a PC, create a “foo” folder in the “/Android” folder (that exists on my phone), copy the “bar.csv” file, and everythings goes fine.

Now obviously, this is not acceptable if I want to distribute the application. So I have a few questions :

  • The natural solution is to softcode the file location, and in any other system I would rely on a built-in “file manager” or something, to let the user browse to the right file.
    Surprisingly I could not find such a control, and it seems like there are lots of third-party File Browser app. Does it mean it is not “customary” to ask a user to choose a file on their phone ? Should I write my own ‘file browser’ ?

  • Are there conventions about how I should name my “foo” dir ? I’ve seen apps creating dir with a name that looks like a java package, am I mistaking it with internal storage ?

  • There is also a getExternalStoragePublicDirectory method that takes a “directory type’ constants. In my situation, would it make ‘sense’ to assume the file is in DIRECTORY_DOWNLOADS ? (or in some subfolder of DIRECTORY_DOWNLOADS ?)

  • Should I bother about how a lambda user will put a file on their phone ? To me plugging the phone on my PC is simple enough, but is that really easy on all droids ?

Sorry if all of that sounds trivial, just trying to clear my mind before doing something stupid.

Thanks.

  • 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-26T08:03:55+00:00Added an answer on May 26, 2026 at 8:03 am

    Does it mean it is not “customary” to ask a user to choose a file on their phone ?

    Correct. Android, like iOS, tries to get away from “files” as much as possible.

    Should I write my own ‘file browser’ ?

    There are certainly plenty of third-party applications for file browsing, some of which support ACTION_PICK or similar operations (e.g., OI File Manager). I will be surprised if nobody has written a reusable component for this.

    Are there conventions about how I should name my “foo” dir ? I’ve seen apps creating dir with a name that looks like a java package, am I mistaking it with internal storage ?

    No, you are probably seeing the results of getExternalFilesDir(). If you are only supporting API Level 8 or higher, I’d just use that. If you are supporting earlier versions of Android, you might consider finding out the appropriate directory for your app that would be used via getExternalFilesDir() and use that “manually” for older Android versions.

    There is also a getExternalStoragePublicDirectory method that takes a “directory type’ constants. In my situation, would it make ‘sense’ to assume the file is in DIRECTORY_DOWNLOADS ? (or in some subfolder of DIRECTORY_DOWNLOADS ?)

    That is for downloads — more accurately, things the user downloaded that they want to hang onto independent of any installed app. It does not sound like this fits your scenario.

    Should I bother about how a lambda user will put a file on their phone ?

    What is a “lambda user”? To quote the Bard, “but, for mine own part, it was Greek to me” 🙂

    To me plugging the phone on my PC is simple enough, but is that really easy on all droids ?

    It is somewhat more painful on Android 3.x and higher, as Android moves away from USB Mass Storage mode (think USB thumb drives) and to MTP (think MP3 player) for its USB file transfer protocol. While this has overall benefits, it is annoying for OS X and Linux users, as neither have built-in MTP support. Also, it assumes the user has a USB cable handy. Your overall setup also assumes the user has a desktop OS handy.

    Nowadays, more developers would probably go the route of creating a Web app rather than a desktop app, and syncing the data to the device over the Internet. This eliminates the need for fussing with cables and does not tie the user to one specific “desktop” machine for data entry. It does, however, require Internet access, which may or may not be suitable for your situation.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a bunch of posts stored in text files formatted in yaml/textile (from
I have some data like this: 1 2 3 4 5 9 2 6
Does anyone know how can I replace this 2 symbol below from the string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into

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.