Wednesday, November 30, 2016

Android Programming

I’m Juris Balodis, and this is my blog post. I've work on code with my old man and my uncle, Jackson. Everything I've made has been on the computer. One thing I’ve learned after 6 years – you never know what you're going to learn next. In this case it was Android Programming.

I first took a liking towards programming in 5th grade when the game Minecraft was extremely popular. My favorite part of the game was the endless amount of possible puzzles, games, and other fun things. Building these took a logic that I used to think was a lot like programming, realizing that they were very different when I actually started programming with the Python platform with my dad.  I stopped around 7th or 8th grade until last summer when my uncle started taking computer science classes and offered to teach me some java. Coincidentally I ended up with a Java class i don't remember signing up for (but glad I did), also  a coincident Android apps are based on Java.

The book I got from the library was a bit out of date *cough* 4 years *cough* in the programming world a book can become completely obsolete after just 4 months. The application the book recommends to use for programming no longer supports the file extensions needed to turn the program into an Android app, because of this I had to do a bit of research, hit a few dead ends  and found out i needed to get Android Studios on my home computer.

Before I get into what I did to make my program I should probably say what my program is. My program is a game based off of Cookie Clicker called Chocolate Clicker. Simple enough right? Well maybe if every thing went your way. I did manage to make the button (circled in red) using this simplified code from the book:

button = (Button) findViewById(R.id.button1);
button.setOnClickListener(new MyOnClickListener(this));
textView = (TextView) findViewById(R.id.textView1

I also set a background,  and made a, hopefully, temporary score system that goes up to 256 then crashes. Here is what the game looks like so far:

 
 The 3 is there as a test to try to make the scoring system go up to at least 2048. One of the first pieces of advise the book gives you is "...if you can't figure out what is wrong or you don't understand something take a break, relax, coding can be hard to figure out but if you take the time to step back and think it should come to you." And that is what chose to do, so until i figure out a simpler system for scoring I'm going to have to step back and think.

No comments:

Post a Comment