On to the brightness bar though - thanks to anindita9's brightness adjust sample, I was able to use some of the Java code on my brightness seek bar to test it out, and once I succeeded I started to 'pick apart' the Java sample line-by-line to observe how it works and functions (like what classes it uses, what methods are used, what libraries are imported, etc.). I'm starting to see how the coder set the specific seek bar to control the backlight of the screen (BackLightControl) and just used a button to update the system setting almost like a "save" button, instead of having the brightness update and save in real-time which would most likely be a bit harder to code and could even suck up more resources in the process by having the app constantly listening for changes to the setting. What surprised me with this sample is how simply coded the "update" button was, and how it basically just took the integer created from the seek bar and overwrote the brightness integer in the device's settings.
I still might make some modifications to it and see if maybe I can improve it to work even better for what I'm trying to do. I could even have like 'quick buttons' below the brightness adjuster that just quickly set it to a certain value (i.e. dark, normal, bright) or something similar to that.
Also, if you're new to OOP (Object-oriented Programming) the image below has some basic definitions that could help you understand what you're reading if you're looking up something online, reading an error, or reading a book on this kind of thing.
No comments:
Post a Comment