Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Couldn't update a file in android app assets folder

I want to update a file in assets folder when the user click a button.

my listener is a classic

OnClickListener myUpdateListener = new OnClickListener() {
    public void onClick(View v) {
        updateAllParams();
    }
};

The new file is to an url in this form

http://sample.test/android/params.dtf

the file in assets folder is

params.dtf

But I don't know how to do replace this file with the new version on the site.

like image 437
AndreaF Avatar asked Oct 02 '12 17:10

AndreaF


2 Answers

I want to update a file in the assets folder

No, you cannot.

The assets folder is read-only, you cannot write or update any file present there.

like image 147
Sunny Kumar Aditya Avatar answered Nov 14 '22 04:11

Sunny Kumar Aditya


You cannot update the assets folder after the application has been packaged and installed. You can, however, store to the device's memory and read in your file from there. More on this subject can be found at http://developer.android.com/guide/topics/data/data-storage.html#filesInternal

like image 26
Phil Avatar answered Nov 14 '22 05:11

Phil