Closed Bug 959203 Opened 11 years ago Closed 4 years ago

Experiment: Try using only XXHDPI resources

Categories

(Firefox for Android Graveyard :: Theme and Visual Design, defect)

All
Android
defect
Not set
normal

Tracking

(fennec+)

RESOLVED INCOMPLETE
Tracking Status
fennec + ---

People

(Reporter: ibarlow, Unassigned, Mentored)

References

(Blocks 1 open bug)

Details

I was chatting with an Android developer friend of mine from a previous job, and he said that they found in their app development that using multiple resolutions for resources was pretty unnecessary, and that simply scaling XHDPI assets for HDPI and MDPI devices worked fine. We should try this. Seems like it would be a nice little win for app file size, and also for design production peace of mind :) Not sure how much effort this is from engineering, but I would suggest making a build with large assets only, and taking before and after screenshots for each device resolution to see how the assets hold up.
Blocks: fatfennec
OS: Mac OS X → Android
Hardware: x86 → All
Whiteboard: [mentor=rnewman][good first bug]
Looks like we have about 240KB of PNGs in non-XHDPI directories. I didn't dig any deeper into which ones were only present in non-XHDPI, and thus can't be deleted, but that's probably a ballpark figure.
Mentor: rnewman
Whiteboard: [mentor=rnewman][good first bug] → [good first bug]
Blocks: 1042363
No longer blocks: fatfennec
Random comment: Wouldn't this increase decode time and possibly memory consumption compared to simply using smaller images? Shouldn't this be a wontfix now the splitapk work is making decent progress?
(In reply to Chris Kitching [:ckitching] from comment #3) > Random comment: Wouldn't this increase decode time and possibly memory > consumption compared to simply using smaller images? It'll reduce APK size, and that might be enough of a win. Shouldn't increase memory consumption if our bitmap loader is directed correctly. > Shouldn't this be a wontfix now the splitapk work is making decent progress? Not necessarily. Considering that relatively few devices would use the >9 APK with h/mdpi images, this might be worth doing.
I'm interested in working on this.
Wesley: most of the work here will be in doing builds with various files deleted, and then testing and measuring the output on various devices. Do you have an array of Android devices available to you? If not, this might not be the best bug to start with.
I have an HTC One, a Samsung Galaxy S3, and a Nexus 7 tablet. Are three devices enough to test and build with? If not, I'll look for something else to which I could contribute.
I do have a number of devices available and am experienced with emulators, since I'm an android developer. If no one's taking this, I can surely work on it.
I do have a number of devices available and am experienced with emulators, since I'm an android developer. If no one's taking this, I can surely work on it.
Esentially we only need hdpi and xhdpi or xxhdpi assets - as Commonsware mentions here http://stackoverflow.com/a/19196749/264276, the system will downscale from the largest given asset. You will, however, need to specify an hdpi asset, as neither xhdpi nor xxhdpi existed for API Level 7 and below. The only potentially subjective bit of this task is working out whether the assets look good downscaled, I've personally never had an issue with it.
Murtaza, Wesley: Either of you fancy taking this on?
Flags: needinfo?(wes.g.clark)
Flags: needinfo?(murtaza.666im)
I would like to work on this bug if nobody is assigned.
Flags: needinfo?(mhaigh)
(In reply to Mihai Pop from comment #14) > I would like to work on this bug if nobody is assigned. Go for it! Feel free to bug rnewman or mhaigh if you need help :)
Assignee: nobody → mihai.g.pop
Flags: needinfo?(wes.g.clark)
Flags: needinfo?(murtaza.666im)
Flags: needinfo?(mhaigh)
(In reply to Martyn Haigh (:mhaigh) from comment #12) > Esentially we only need hdpi and xhdpi or xxhdpi assets - as Commonsware > mentions here http://stackoverflow.com/a/19196749/264276, the system will > downscale from the largest given asset. You will, however, need to specify > an hdpi asset, as neither xhdpi nor xxhdpi existed for API Level 7 and below. We don't support API level 7 (only >= level 9). Does this mean we only need xhdpi or xxhdpi? Relatedly, I just want to note that I filed bug 1104366, which is for the xxxhdpi on the Nexus 6 - I'm not sure how this factors into this discussion.
Flags: needinfo?(mhaigh)
> Does this mean we only need xhdpi or xxhdpi? That's my understanding, yes. Note, however, that for Gingerbread constrained builds we ship only <=hdpi, because it's a significant size saving, and we'd rather save size than have higher quality. http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/Makefile.in#357 Until we drop Gingerbread support, or decide to re-add weight to the APK, we can't avoid creating lower density assets. We might consider using a mirror of that approach -- ship only {x,xx,xxx,xxxx}hdpi -- for 10+ builds in our aapt invocation. It'll be a small saving (240KB of PNGs), at the cost of creating xhdpi+ assets for stuff that's currently only hdpi or mdpi. This should be pretty easy to test: just ape that AAPT invocation in the Makefile.in, and see what breaks when you exclude hdpi/mdpi.
Flags: needinfo?(mhaigh)
liuche got me digging in. We're killing GB soon – we can probably switch over to all xxhdpi assets at that point. [1] indicates this works (read the comments). Note rnewman's comment 17 that we have to build assets for stuff that's only in hdpi (or we can ship only these hdpi assets but it could get tricky to keep track of what we actually want to keep in the hdpi folders). [1]: http://stackoverflow.com/a/21484100
Depends on: 1220184
Summary: Experiment: Try using only XHDPI resources → Experiment: Try using only XXHDPI resources
Assignee: mihai.g.pop → nobody
This sounds like it would be good to fix, but it doesn't need to track a release. We can do this as part of the general work to clean up after dropping Gingerbread support.
tracking-fennec: ? → +
Hello! Is this bug still relevant? Can I work on it?
Flags: needinfo?(rnewman)
Mentor: rnewman → s.kaspari
Flags: needinfo?(rnewman) → needinfo?(s.kaspari)
It's still relevant: We want to reduce the APK size and only shipping XXHDPI resources would be helpful for that. However currently I'm not able to mentor this. The big question here is whether xxhdpi will be used by all supported devices (currently our minSdkLevel is 15). Flagging antlam: With the upcoming UI refresh we might update a lot of the resources - so only using xxhdpi could be part of that refresh.
Flags: needinfo?(s.kaspari) → needinfo?(alam)
Whiteboard: [good first bug]
Flags: needinfo?(alam)
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.