Closed Mini-Ware closed 1 year ago
You can store the files in mipmap
in res
, and access them through R.mipmap.(image name)
I see that you use https://github.com/Mini-Ware/Quoting-Words/blob/5edfca6deef38175d59ee65667d2f65430e750e9/app/src/main/java/com/github/miniware/quotingwords/Generator.java#L84-L98 to load the images, and add @drawable
in Feed.java
, which is not the recommended way of loading images. (You should use R.drawable.(image name)
instead, it will return the same thing.)
I can make a PR if you want (will be doing this soon)
If the problem persists, can try doing:
Oh I didn't know about that, I will try it and yeah sure you can make a PR too
For conversion of images, you should try right-clicking them in Android Studio and selecting "Convert to WebP". Depending on your application needs, you may opt for a more lossy encoding, which reduces space and memory usage but may cause reduced clarity. With lossless conversion to WebP, there are no space savings hence I did not convert them.
I see, thanks for letting me know. I am reviewing the PR now.
By the way, I don't know how the application performs on low memory devices, you should test for that(perhaps with an Android emulator)
You may want to keep this open until that is resolved.
But there are some things I see that can be improved(unrelated to image loading):
.equals()
, if not the compiler will check if the 2 strings occupy the same place in memory (and not that the strings are equal)DarkActionBar
to NoActionBar
in themes.xml
(res/values and res/values-night) (this is more of a minor optimisation, doing it programmatically is fine as well)findViewById
calls are expensive, try to load them once in onCreate
and store it in a variable (with your current layout it should still be fine, but as there is more (esp. nested) layouts, this may incur a performance hit)Alright, thanks for bringing those up too. Will work on them.
App crashes on phones with lower memory