Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Storing data on the SD card in Froyo - files deleted when upgrading
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Joseph Earl  
View profile  
 More options Jul 24 2010, 1:11 pm
From: Joseph Earl <joseph.w.e...@gmail.com>
Date: Sat, 24 Jul 2010 10:11:12 -0700 (PDT)
Local: Sat, Jul 24 2010 1:11 pm
Subject: Storing data on the SD card in Froyo - files deleted when upgrading
I have an application which resides on the phone memory but downloads
large data to the SD card on first launch (the app needs to be able to
work without an internet connection most of the time)

When using the recommend directory given in Froyo it seems all files
on the SD card are deleted when I install a newer version of the .apk.
I'd preferably like the files removed on uninstall, but not on upgrade
since the files on the SD card aren't going to change between
application versions, and forcing the user to re-download a large file
that is independent of the application version does not seem
reasonable.

At the moment it seems I'm forced to use a different directory to the
recommended one in order to stop Froyo deleting all the files when the
application is upgraded.

Am I doing something wrong, or is this how it is supposed to work (I'm
guessing it is)? (Or perhaps I misunderstood what getExternalFilesDir
is for)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dianne Hackborn  
View profile  
 More options Jul 24 2010, 3:57 pm
From: Dianne Hackborn <hack...@android.com>
Date: Sat, 24 Jul 2010 12:57:07 -0700
Local: Sat, Jul 24 2010 3:57 pm
Subject: Re: [android-developers] Storing data on the SD card in Froyo - files deleted when upgrading

Ergh...  that may be a bug. :(  To be clear, when doing the update your
internal data is not being erased, but the data on the SD card is?

On Sat, Jul 24, 2010 at 10:11 AM, Joseph Earl <joseph.w.e...@gmail.com>wrote:

--
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joseph Earl  
View profile  
 More options Jul 24 2010, 6:46 pm
From: Joseph Earl <joseph.w.e...@gmail.com>
Date: Sat, 24 Jul 2010 15:46:30 -0700 (PDT)
Local: Sat, Jul 24 2010 6:46 pm
Subject: Re: Storing data on the SD card in Froyo - files deleted when upgrading
Absolutely. Things like my preferences and my DB are fine.

But since 2.2 if  my large files are stored in the recommended
directory (from what I remember something like .../Android/data/
packagename/) then when I install a new version (currently I've only
tried through ADB and side-loading, NOT market - don't know if that
affects it) all of the files get erased.

Currently if this is the case I think I'm going to move to storing
data in .../data/packagename/ as I've seen a few other apps do this
and the less I mess up someone's SD card the better. At least a file-
copy and delete should be much quicker for the user than re-
downloading :)

But if you could check (or someone?) - I might be being an idiot. I
did however go through my code and make sure I didn't have a
deleteAllFiles() or something like that somewhere.

On Jul 24, 8:57 pm, Dianne Hackborn <hack...@android.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
john  
View profile  
 More options Jul 24 2010, 10:10 pm
From: john <john4...@gmail.com>
Date: Sat, 24 Jul 2010 19:10:27 -0700 (PDT)
Local: Sat, Jul 24 2010 10:10 pm
Subject: Re: Storing data on the SD card in Froyo - files deleted when upgrading
If you're using API Level 8 or greater, use getExternalFilesDir(null)
to save a File.

It will be deleted when you upgrade to a newer version.

On 7月25日, 上午3時57分, Dianne Hackborn <hack...@android.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joseph Earl  
View profile  
 More options Jul 25 2010, 6:07 am
From: Joseph Earl <joseph.w.e...@gmail.com>
Date: Sun, 25 Jul 2010 03:07:30 -0700 (PDT)
Local: Sun, Jul 25 2010 6:07 am
Subject: Re: Storing data on the SD card in Froyo - files deleted when upgrading
Hi John, thanks for the info, but essentially what I was hoping to
have was

1) Files on SD card NOT deleted during upgrade (they are independent
of the app version)
2) Files on SD card ARE deleted during final uninstall

However they get deleted in both those scenarios which is not useful
to me, as I cannot ask the user to re-download ~200MB of files again
if I need to release an upgrade to fix a bug or something.

On Jul 25, 3:10 am, john <john4...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dianne Hackborn  
View profile  
 More options Jul 29 2010, 6:37 pm
From: Dianne Hackborn <hack...@android.com>
Date: Thu, 29 Jul 2010 15:37:07 -0700
Local: Thurs, Jul 29 2010 6:37 pm
Subject: Re: [android-developers] Re: Storing data on the SD card in Froyo - files deleted when upgrading

Sorry yes this is indeed a bug in Froyo. :(

I have patch to fix this now in the Froyo tree:

https://review.source.android.com/16151

I can't tell you when it will appear on various devices, but hopefully we
can get it rolled out fairly quickly.  (Note -- do expect to see devices
updating to Froyo for a while without this patch, since there is a fairly
long natural lag between code going in and builds being created with it and
going through TA to be delivered to devices.)

On Sun, Jul 25, 2010 at 3:07 AM, Joseph Earl <joseph.w.e...@gmail.com>wrote:

--
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Clayton Sims  
View profile  
 More options Oct 26 2010, 5:26 pm
From: Clayton Sims <cs...@dimagi.com>
Date: Tue, 26 Oct 2010 14:26:13 -0700 (PDT)
Local: Tues, Oct 26 2010 5:26 pm
Subject: Re: Storing data on the SD card in Froyo - files deleted when upgrading
So this bug appears to still exist on the 2.2 devices that we work
with on the market (Motorola Droid with the latest 2.2 OTA) and even
on the Google API 2.2 SDK emulator. I think that it is wildly
unreasonable that this bug is not reflected in the main documentation
at

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

or developer docs at

http://developer.android.com/reference/android/content/Context.html#g...

Would it be possible for the documentation to be updated to reflect
the fact that you should only "write your data in the following
directory: /Android/data/<package_name>/files/ " if you are building
for an android environment which has the bug fixed (not sure if any
such environments currently exist...)

We started using the appropriate directory path (.../Android/data/
packagename/) before 2.2 was rolled out in anticipation of taking
advantage of it, meaning that we can no longer upgrade our application
(from the 2.1 installed version) without completely wrecking the
install, and I feel that it is unfortunate that despite the bug being
identified in July the documentation was not updated to reflect this
problem.

-Clayton Sims

On Jul 29, 6:37 pm, Dianne Hackborn <hack...@android.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »