Best Way to Cache Data in Android

前端 未结 3 2002
日久生厌
日久生厌 2021-01-30 05:52

I have an ArrayList of custom, simple Serializable objects I would like to cache to disk and read on re-launch. My data is very small, about 25 object

3条回答
  •  逝去的感伤
    2021-01-30 06:25

    It's hard to know without profiling but my guess is your poor performance is down to using ObjectOutputStream. Have you tried writing your own writeObject(ObjectOutputStream) and readObject(ObjectOutputStream) methods as this may help performance.

    You could use the traceview tool to see exactly where the application is running slow. Have a look at this question for instructions on how to use traceview.

提交回复
热议问题