1. Download our Official Android App: Forums for Android!

Apps Save app state by writing to file

Discussion in 'Android Development' started by Karl Andersson, Sep 26, 2017.

  1. Karl Andersson

    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    7
    Joined:
    Sep 26, 2017

    Sep 26, 2017
    7
    0
    15
    I'm writing an app. I intend to save the state of the app by writing the state to a textfile, since apps sometimes crash. The user will then be given an option to restore the last game when restarting the app. Is it a good idea? The file may be written 1000 per hour. I know Linux spreads out the writing to disk by shifting the pages which are written. Will it ruin the phones flash disk?
     

    Advertisement

  2. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,842
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,842
    11,443
    1,988
    Male
    Software developer
    South West of England
    You're ok writing to internal storage. 1000 times an hour seems like a lot of saves though. Why do you need to do it so often? A common strategy is to save at certain designated checkpoints.
     

Share This Page

Loading...