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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:59:48+00:00 2026-05-28T07:59:48+00:00

my app is supposed to store some data in a text file. Every time

  • 0

my app is supposed to store some data in a text file. Every time when the app is started the data is read and every time the app is closed the data is wiped out from the text file and new data about the last session is saved.

Now I don’t have problem reading in data:

InputStream is = getResources().openRawResource(R.raw.myFile);
BufferedReader br = new BufferedReader(new InputStreamReader(is));

The trouble is when I write to the file. Obviously it has to be accessed somehow by the resources but R.raw.myFile results only in InputStream and I have to pass a string to the openFileOutput. This is the code in question:

FileOutputStream fos = openFileOutput(getResources().openRawResource(R.raw.myFile), MODE_PRIVATE);

So it seems that this won’t work. Is there any other way to write to the file in the raw folder?

  • 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-28T07:59:49+00:00Added an answer on May 28, 2026 at 7:59 am

    If you want to write to a file packaged in the raw folder, you will have to copy it to the local file system first. Resources contained in your raw directory in your project will be packaged inside your APK and will not be writeable at runtime. Consider looking at the Internal or External Data Storage APIs.

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

Sidebar

Related Questions

Actually i want to know how to store data from my app in the
App Store We have been developing an app for quite some time now for
I need to store some data files for my blackberry app. These are usually
I'm writing an app that supposed to copy a bunch of files from one
I've got an iPhone App that is supposed to send POST data to my
I’m trying to write a web app using 4-tier design pattern ( Data Store,
I am trying to install Xcode 4.2.1 from App Store on my iMac running
In an N-Tier app you're supposed to have a business logic layer and a
I have a python app which is supposed to be very long-lived, but sometimes
In my app, the user is supposed to insert a phone number, which is

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.