performance - Android - Loading multiple text files into a RecyclerView -
i'm writing notetaking application android, , have recyclerview display grid of notes. each note has respective class called note.
the note class knows/has:
- the filename (notes title)
- the file path note
- a loading method reads , returns text inside file
the recyclerview reads arraylist of note. list populated scan of files in app's note directory, , note object created each file. i'm trying find best way load text recyclerview, displays preview of notes. i'm wondering if theres best way, or least stupid way this. ways can think of doing are:
- load every note's content @ once during initial scan , save string in note class in ram, downside being high ram usage alot of notes , text.
- load note's text in recylerview's onbindviewholder method, i'm worried if user scrolling through notes fast, , viewholder , note unbound before text loaded, there possible issues here.
- load each note's text in threadpool, increases performance same issue above.
is there best way this, or recommended/standard way handle alot of files loading dynamically recyclerview?
start off first one, optimise needed. if theyre text files, wont take memory. if find take memory or take long load can @ strategies fix that, dont waste time optimising before know problem
Comments
Post a Comment