Monday, May 6, 2013

Android Application Development - Brightness Bar Success & My Learning Approach

Without many problems, I've surprisingly already got a working brightness seek bar! I took a bit of a preview at some of the video tutorials and Android e-books and I noticed they all basically teach the exact same thing, like how to install the SDK and create your first project (which I was already much farther ahead of before I even started gathering learning resources). So since there is so little time for the culminating, and the books and video tutorials are extremely long, I thought I would try a different learning approach that has worked for me personally with many other things very well. I'm thinking I'm going to try a bit of a 'self teaching' approach, where I look at little examples of code here and there and see how others got other things to work and kind of teach myself the patterns of the code as much as I can (I find I retain this kind of information much better than if I read or hear it), and if I happen to get stuck at a certain point I can then refer to my books and videos.

 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