Saturday, May 11, 2013

Android Application Development - First Stage Complete!

The app in Android 4.2.2
The app on my phone (Android 2.2.2)

























The first stage of the app is finished, with a fully working (and fixed) brightness adjuster, SD Card options link & SD Card status, and a battery status.
The two photos above aren't quite the current layout, but they're pretty close, the only difference is the test pattern image for the brightness at the bottom is now right below the brightness adjust seek bar, and the app is able to be scrolled down (had to do this so you could see everything when in  landscape mode).
I improved the brightness seek bar by fixing a problem where when the bar was dragged to 0% the screen would turn off (which is a problem that is pretty hard to get out of since the screen is completely off) by forcing the brightness value to go to 1% whenever it was brought down to 0% so it is impossible to cause the brightness to turn right off. I was luckily able to do this by a simple 2 lines of code, where many other people were trying to do this and this. I also had it display the percentage of the brightness instead of the decimal/float of it (50% would pop up as "0.5" on the screen) and the percentage doesn't show up until the bar is moved.
My plans for the SD card eject button had to be changed when I found out that Android doesn't allow apps to change and use SD card settings and actions (such as eject SD card) because it is a security risk to the user, so instead I just had the button bring the user into the storage settings menu where the "Eject SD Card" button can be found.
The battery level part was more difficult than I expected since it isn't as simple as "call BATTERY_LEVEL to get the battery's %" but it's actually more like a 'call to a call', like "call BATTERY_MANAGER to call BATTERY_LEVEL" which is a little more difficult to deal with.
I included the test pattern image so I could fill in some of that extra space, and it also helps the user adjust their brightness to something they're comfortable with.
After a few little tweaks and improvements to the current stage, I will start posting my second stage plans and layouts here, as well as a link to all the code I used and (hopefully) a video of the app.

No comments:

Post a Comment