1. Download our Official Android App: Forums for Android!

Apps How to edit R.raw.file and update it

Discussion in 'Android Development' started by viniciusfreitas, Jul 6, 2010.

  1. viniciusfreitas

    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    1
    Joined:
    Jul 6, 2010

    Jul 6, 2010
    1
    0
    5
    Hi!

    I have a R.raw.file, and there a important data there, but sometimes i need to update this data and could not find an way to do this.
    I tried FileOutputStream and other way. Like below.
    String value = "123456"
    buffer = value.getBytes();
    this.getResources().openRawResourceFd(R.raw.file).createOutputStream().write(buffer);

    But I got a Bad File Number exception.

    Anyone knows an way to update R.raw.file content?

    thanks
     

    Advertisement

  2. cp1

    cp1 Android Enthusiast
    Rank:
    None
    Points:
    53
    Posts:
    375
    Joined:
    Apr 30, 2010

    Apr 30, 2010
    375
    35
    53
    I don't think you can change these files -- it's part of your signed apk isn't it? If you can, then you're probably missing a permission in your manifest.

    If you need to store a few values, try using a preference instead.
     

Share This Page

Loading...