Simplify native-activity, remove now duplicate native-plasma.#1140
Merged
DanAlbert merged 4 commits intoandroid:mainfrom Sep 17, 2025
Merged
Simplify native-activity, remove now duplicate native-plasma.#1140DanAlbert merged 4 commits intoandroid:mainfrom
DanAlbert merged 4 commits intoandroid:mainfrom
Conversation
8b7eb65 to
0841961
Compare
enh-google
reviewed
Sep 17, 2025
enh-google
reviewed
Sep 17, 2025
enh-google
approved these changes
Sep 17, 2025
Collaborator
enh-google
left a comment
There was a problem hiding this comment.
signs you programmed old computers include looking at a manual fill of a whole screen's worth of pixels done as a nested for loop and think "surely that's too slow?!".
0841961 to
471954f
Compare
added 4 commits
September 17, 2025 13:32
We already have a separate sensor-graph sample. There's no need to complicate this NativeActivity hello world with accelerometer logspam. android#1139
We don't need OpenGL just to do a color fill. Save that for the OpenGL samples. Replace that with a trivial AHardwareBuffer based color fill. I've altered the old animation which didn't really work the way I think it was intended to. It looks like someone had intended for the accelerometer to alter the color, but it actually only animated between black and bright green. I've removed the sensor code as superfluous anyway, so just do something simpler: switch from red, to green, to blue every second. I kept some amount of animation rather than just clearing a solid color because if we only draw once and have no update cycle then choreographer and most of the event handling code also becomes useless, and without that the sample no longer bears any resemblance to a real app. android#1139
This is just native-activity with extra steps. Fixes android#1139.
471954f to
81cb169
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We don't need OpenGL just to do a color fill. Save that for the OpenGL samples. Replace that with a trivial AHardwareBuffer based color fill.
I've altered the old animation which didn't really work the way I think it was intended to. It looks like someone had intended for the accelerometer to alter the color, but it actually only animated between black and bright green. I've removed the sensor code as superfluous anyway, so just do something simpler: switch from red, to green, to blue every second. I kept some amount of animation rather than just clearing a solid color because if we only draw once and have no update cycle then choreographer and most of the event handling code also becomes useless, and without that the sample no longer bears any resemblance to a real app.
Fixes #1139.