moko-resources icon indicating copy to clipboard operation
moko-resources copied to clipboard

Add in readme examples of files resources

Open moffpage opened this issue 3 years ago • 4 comments

Android has a limit 32,767 on strings encoded in UTF-8 in our APKs (it's gonna replace the original string with "STRING TOO LARGE" notice). If we need to load a string locally (like user agreement), for now we have to either split the string into multiple parts and put each in their own text view, or use some kind of IO API. Are you interested in adding an implementation that we could use in commonMain using your library, without needing to use expect/actual mechanisms or korio (or kotlinx-io) library which I don't have experience with?

moffpage avatar Jul 27 '21 04:07 moffpage

@moffpage you can use files support of moko-resources - as here https://github.com/icerockdev/moko-resources/tree/master/sample/mpp-library/src/commonMain/resources/MR/files https://github.com/icerockdev/moko-resources/blob/master/sample/mpp-library/src/commonMain/kotlin/com/icerockdev/library/Testing.kt#L115

Alex009 avatar Jul 27 '21 06:07 Alex009

Thanks! Sorry, missed the Files support mentioning in the documentation, it's included in the features list (in the first feature). It's easy to forget about though. Maybe you could update the README.md file with 10-th case?

moffpage avatar Jul 27 '21 06:07 moffpage

yes, we should add it into readme :)

Alex009 avatar Jul 27 '21 06:07 Alex009

Thank you!

moffpage avatar Jul 27 '21 06:07 moffpage