I'm currently writing an application which displays items within a ListView
which then users can either add to or delete from. I am making this data persistent by writing out to a local JSON
file (I'm saving the data as a JSONArray
and then calling the toString()
method before Serializing
it and writing it, reading is basically the same process reversed).
Since I'm fairly new to developing for Android I'm not very clear on the best practices, and specifically I'm interested in what is the best method for accessing data stored within local files and resource files. Currently I'm Reading and writing from these using an AsyncTaskLoader
and am wondering if that's sensible for a local file or is not needed/recommended for local files. Is it OK to run on the main thread for accessing local files or is there some other class besides AsyncTaskLoader
I can use?
My main problem is that after implementing the AsyncTaskLoader
I am seeing some performance issues and being fairly new to development as a whole I suspect I'm not implementing this fairly complex class in an efficient way. If I can avoid it all together or substitute a less complex class to reach a similar result I think I'd be set. Thanks in advance for feedback and if having some code snippets would help clarify the question please let me know.