Thanks for reminding me. Write to new file, delete old file, rename.

On Oct 19, 2:40 am, Dianne Hackborn <[email protected]> wrote:
> Also services *can* be killed.  It is best to do your file writing so that
> you avoid issues if you are killed (or the battery pulled or whatever) while
> running.  Using SQLite is one way.  For flat files, what we typically do in
> the platform is the standard trick of writing a new file, syncing it, and
> then atomically replacing the old file with the new one.
>
> On Mon, Oct 18, 2010 at 5:32 PM, Mark Murphy <[email protected]>wrote:
>
>
>
> > On Mon, Oct 18, 2010 at 8:28 PM, Stakka <[email protected]>
> > wrote:
> > > Thanks. I'll use a WakeLock in my IntentService.onHandleIntent.
>
> > You may wish to consider my WakefulIntentService pattern:
>
> >http://github.com/commonsguy/cwac-wakeful
>
> > It will help you avoid the case where the device falls asleep between
> > the startService() call and onHandleIntent() being called.
>
> > --
> > Mark Murphy (a Commons Guy)
> >http://commonsware.com|http://github.com/commonsguy
> >http://commonsware.com/blog|http://twitter.com/commonsguy
>
> > Warescription: Three Android Books, Plus Updates, One Low Price!
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]<android-developers%[email protected]>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Dianne Hackborn
> Android framework engineer
> [email protected]
>
> 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to