Saturday, May 25, 2013

Android Application Development - Progress Update

Changes so far:
- Brightness adjuster now saves as soon as you stop sliding it
- Brightness adjuster % no longer ends with ".0" or something like ".999999998"
- Added a on/off button (still needs coding) and an options link button for Wifi, Bluetooth, Airplane Mode, and vibrate
- Reorganized XML layout code and Java code a little more (will post source code with comments once project is finished)
- Fixed problems with the layout in Landscape Mode (screen sideways)


I've been working on adding volume adjusters and toggle buttons for various services, but I find that is already being enough of a challenge and a learning experience already, so it is all I'm going to attempt to add for this stage. In the process of learning how to do volume adjusters, I've actually figured out a few more things to improve the brightness adjuster from the first stage, which improvements are always good. Since the original apps activity or "screen" is becoming quite full as it is, I've been trying to add the volume adjusters and toggles on 2 more separate activities, which I've discovered causes a problem with the functioning of the Java code (although I'm thinking it's a simple line of code that I'm missing or a small setting that isn't set just right). The code compiles and runs completely fine, and I'm able to switch between activities without any problems, but the code literally has absolutely no effect on the app at all even though I get the normal and proper errors for the code if something isn't right. The code works perfectly fine if I copy everything to the apps main activity, which makes me believe that it's a small thing such as a missing line or setting that I haven't figured out quite yet, but I imagine I'll get there.

Also, if you're a beginner and are having difficulty understanding a few things, here's a list of a few definitions that I had trouble with in the beginning of this project or when I've worked with other languages before:

onCreate - This basically means "when the app starts", this is where you put all the things you want to happen when the app starts, like getting certain values, or defining certain items.

; (semicolon) - This is what you put at the end of a line, not just every line, but only a line that's finished, so there are some times that, usually for organization purposes, you will have a line or two that don't end with a ';' because these group of lines are actually read as one line by the computer (in a certain way). I think of it like a period in a sentence, a sentence can be 3 lines on a page, but just because it reaches the end of the line on the page doesn't mean the sentence is finished, it's only finished when you see the period at the end.

= and == - Though these are both "equals" they actually mean two pretty different things. '=' is what you would use when you're setting or declaring something, and '==' is used when your searching to see if something is something specific (whatever you put after the '=='). So '=' is like saying "is" and '==' is almost like saying "if it is".

!== - means the same as '==' just the '!' makes it mean "if it isn't".

public, protected, private - This is a little harder to explain, try checking out this link.

void - goes after the modifiers in the definition above (i.e. public void). This means that the function doesn't return anything to the code that called it. It's like someone calling you saying "Dinner is ready" and you heard them, they know you heard them, but yet you don't reply, because no reply is needed.

float - a number that can only go from 0.00(...) to 1.0.

int or Integer - a number without a decimal on the end.

String - text, which can also include numbers, and therefore can sometimes be converted and used like an integer (you'll see an example of this in my source code once it's posted).

When it comes to small things like this that the books don't always talk about or fully define and you get stuck on something, you just have to remember that Google is your friend.

No comments:

Post a Comment