Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
enter0
Visitor

Best practices re: number of user bookmarks to save

When storing a new bookmark so that a user can resume a video they have left half watched, I've written a function which checks whether the user has reached an arbitrary maximum number of bookmarks and, if so, deletes the oldest bookmark before saving the new one, so as to not waste huge amounts of registry space with if the user happens to leave every video in the app unfinished.

These registry entries include the deep linking video GUID, info about when the bookmark was saved in UNIX epoch format, and—obviously—the point at which the user stopped watching the video. The latter two are saved in a single string separated by a delimiter character, which I split up using the ifStringOps Tokenize function when I'm processing the data from the registry.

Currently I have the max number of bookmarks set to 7, which seems to me like it generates a list that's small enough not to be overwhelming (the "resume–able" videos are displayed in a "Keep Watching" category on the home grid), while still being large enough to not be entirely useless.

My question is this: I know that there are memory/storage differences between different Roku devices, so would it be beneficial to vary that max bookmarks number depending on the device/model number on which the app is running? In other words, is there any reason to set maxBookmarks to, say, 4 on model number 1XXX and 2XXX, 7 on 3XXX and 4XXX, and 10 on 5XXX? Or am I overthinking this, and the amount of device storage space I'd use on the function itself would cancel out the negligible benefits of doing this anyway?
0 Kudos
5 REPLIES 5
squirreltown
Roku Guru

Re: Best practices re: number of user bookmarks to save

I believe the amount of space in the registry is 16k per dev ID and is the same on all boxes. 
Kinetics Screensavers
0 Kudos
enter0
Visitor

Re: Best practices re: number of user bookmarks to save

Thanks, I guess it was kind of a silly question—I just was surprised to learn about the significant hardware differences when I got my initial cert results back, so I wanted to make sure I wasn't overlooking a storage question that would present an impediment to my app working well.
0 Kudos
Komag
Roku Guru

Re: Best practices re: number of user bookmarks to save

I'm sure Roku thinks 16k is plenty of space for that sort of thing, but I have had to compress and optimize like crazy to fit all my save date in there for my action/RPG game, it's been quite a challenge.
0 Kudos
marcelo_cabral
Roku Guru

Re: Best practices re: number of user bookmarks to save

You can also use the File System, since firmware 8.0 there is a cache area that unlike tmp:/ will be persisted between executions of the channel, and even between reboots if the user has an SD Card on his device. A strategy could be have a limited amount of bookmarks on Registry and an expanded on cachefs:/

https://sdkdocs.roku.com/display/sdkdoc/File+System
0 Kudos
destruk
Streaming Star

Re: Best practices re: number of user bookmarks to save

While you can use cachefs, I wouldn't rely on it saving much of anything as any other channel would have access to it, and when it fills up older data is pushed out to make room for new data, thus the name "cache filesystem".  You would need to check if what you're looking for is there, if it is then use it, if not you won't have it unless you save it again.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.