Re: [android-developers] Re: Storing data on the SD card in Froyo - files deleted when upgrading

2010-11-01 Thread dipti seni
*www.ksrista.com* http://www.ksrista.com/
*search your life partner*

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Storing data on the SD card in Froyo - files deleted when upgrading

2010-10-28 Thread Clayton Sims
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#getExternalFilesDir%28java.lang.String%29

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:
 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.comwrote:



  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:
   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:

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:

 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 received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to
  android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.comandroid-developers%2Bunsubs
  cr...@googlegroups.com
 For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
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 received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, 

Re: [android-developers] Re: Storing data on the SD card in Froyo - files deleted when upgrading

2010-07-29 Thread Dianne Hackborn
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.comwrote:

 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:
  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:
 
   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:
 
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 received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to
 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.comandroid-developers%2Bunsubs
 cr...@googlegroups.com
For more options, visit this group at
   http://groups.google.com/group/android-developers?hl=en
 
   --
   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 received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
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 received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Storing data on the SD card in Froyo - files deleted when upgrading

2010-07-25 Thread Joseph Earl
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:
 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:

  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.comwrote:

   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 received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email to android-developers@googlegroups.com
   To unsubscribe from this group, send email to
   android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs
cr...@googlegroups.com
   For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en

  --
  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 received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Storing data on the SD card in Froyo - files deleted when upgrading

2010-07-24 Thread Joseph Earl
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:
 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.comwrote:



  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 received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 --
 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 received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Storing data on the SD card in Froyo - files deleted when upgrading

2010-07-24 Thread john
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:
 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.comwrote:





  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 received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs 
  cr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 --
 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 received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en