Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7433735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:43:10+00:00 2026-05-29T09:43:10+00:00

I am writing a little note pad app, where users can enter text notes,

  • 0

I am writing a little note pad app, where users can enter text notes, which are saved to the file system.

I am wondering what is the right balance between persistence and battery life (in terms of frequent I/O)

I want to ensure that a user will experience minimal loss in the event of a power outage.
That requirement suggests that a flush to the file system should be performed after every few characters are typed (using some throttling)

On the other hand, that strategy would use too much battery.

So what should be the right blend of durability and performance?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:43:11+00:00Added an answer on May 29, 2026 at 9:43 am

    Infrequent File I/O won’t do much to hurt battery life. Even at once every 10 seconds, battery drain won’t be that big if you do it correctly (ie. disable the timer [or whatever] when your app goes off screen, check that you really need to save when the timer fires, etc.).

    That being said, File I/O after every keystroke is excessive. Here are some ideas:

    • Periodic saving (just like any other app), say once every 5 minutes [if changes have been made].
    • Manual save button if the user wants to save more frequently, put it in the corner or something so it is out of the way but still visible
    • Register a broadcast receiver for battery events, when the battery is getting low, save immediately. Perhaps ramp saving up as the battery drains lower.
    • 50% – Immediately save
    • 25% – Save, timer fires every 10 minutes
    • 20% – Save, timer fires every 5 minutes
    • 15% – Save, warning (no change to timer)
    • 10% – Save, warning (no change to timer)
    • 5% – Save, timer fires every minute
    • 1% – Save, close app (or ramp the timer up full blast, every 10 seconds.)

    Here’s a link to a very simplistic Battery Changed intent filter:

    https://web.archive.org/web/20200721185308/http://www.tutorialforandroid.com/2009/01/getting-battery-information-on-android.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a little test app which connects to a SQL Server database
I'm writing a little desktop app that should be able to encrypt a data
I'm writing a little debug app for a bit of kit we're developing and
I'm writing a little tile-based game, for which I'd like to support light sources.
I am currently writing a little bootstrap code for a service that can be
I am writing a little app similar to omegle. I have a http server
I'm currently in the process of writing a little blog / generic posting system
I'm writing a C# app to read a file that another application holds open.
Im writing a little python program that goes through an XML file and does
I'm writing a little program to read a .wav file. According to the wav

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.