A Small Update

I had part of a post written up a few weeks ago, but I guess it didn’t save. Been a while… I pretty much haven’t done any work on coding in the past month, but motivation struck again, so here I am. I keep ideas for things I want to code or additions I want to make for the apps I have planned to make, but I don’t know how to implement them. I previously said I would be updating twice a week, but I’m going back on that. It felt like a job at that stage and when something came up that meant I couldn’t meet my self imposed deadline, I got discouraged. I’m learning to code FOR FUN, so from now on updates will come when they come.

So here I am. Back at MyBringBack going over tutorials.

The first tutorial I checked out was Number 18 on creating a scroll view. Nothing real magical here. It was pretty basic. I’ll just put up a picture of the code and the result.

The code for Scroll View (Both the linear layout and scroll view tags are closed after a series of buttons

The scroll in Action, although a bit hard to show in a still image

Advertisements

Designing a GUI

<BlogPost>
<CheesyAnnouncerVoice>
      Hello and welcome to the next ‘chapter’ in my Quest to become a code monkey. When we last left our hero he was slightly disenfranchised with his grand journey. He was not learning much and needed to find something       new.
</ CheesyAnnouncerVoice>
I mentioned Hello, Android and that is what I have been focusing on. I think I’m falling into a nice rhythym with it. I’m not going quickly but what I do is read through a section (usually on coffee breaks at work) and then later go back and follow along while doing the actual coding. I think it’s working pretty good and is even making more sense. There are still parts where I stratch my head and wonder why that code was written and exactly what it means. But I think with more practice and use it will start to become more clear.
The GUI for a tutorial app with Title Text and Four Buttons

The Launch Page of the App Hello, Android is teaching me to build

So far I’ve been learning about UI set up. With that I have set up a launch page UI including title text and four buttons as seen above. I feel pretty solid about that code and how it works. When we start linking the buttons to actions I get a little bit lost. onClickListener is what checks to see if the button is hit or not, but I need to go back and at the surrounding code to get a better handle on it. We also learnt about setting up the UI for different screen orientations so that everything looks nice regardless of whether the user is in landscape or portrait mode. This allowed us to set up our first table view so we get the nice columns in landscape mode. I also set up an About page which is triggered by hitting a button. This page is styled with a Theme so that it appears as a pop up with the original activity visible behind it. That was pretty cool.
The About Button triggers a Pop Up with Text describing the App

The About Page themed as a Pop Up box

Finally we started setting up the settings options. I’m pretty sure this is just magic. I didn’t really set much up and yet, there’s the page. I guess we haven’t set up the results for it yet. We don’t have music to turn on and off and we don’t have hints yet, so maybe when those features get implemented we’ll see how they link up.
A settings page with 2 check box options

The Settings Page

It’s been fun doing this coding and seeing the results on the emulator. I wish I had made coding more of a priority this week. It would have been great to have the basic game play coded so that while my mother is visiting this weekend she could check it out since she used to play a lot of sudoku. Oh well. Can’t win them all.
</ BlogPost>

Finally

I love it when a plan comes together. The last issue I ran into (there being no options for SDK when creating a new Android project in eclipse) was caused by an empty Android SDK. I thought I had downloaded a few API’s but I guess I had not. That must have been on one of the numerous previous installations of the Android SDK. By the way, SDK = Software Development Kit. So, with that little issue out of the way late last night, I was able to wake up this morning and succefully create a sample Android Project. I was in a pretty good mood as I headed out to work for the day. I couldn’t wait to get home and start working through tutorials.
First thing at work I’m told I have to become Apple Online Sales Gold Certified by 2 pm. I’m not exactly what you would call an Apple Fan so this didn’t put me in a great mood… From 9:30 am to 1:55 pm I did nothing but read Apple training and answer questions. Then after mentioning to my manager that I got the Gold level just before the deadline he tells me I have to hit the next level (Apple Product Professional) before I head out for the weekend… Great. I hit that level as well and I guess I get a pin for it. Yay… OK, so that last part wasn’t important to the story of becoming an Android Application Developer…
My current set up where I develop. The PC powering the monitors is an Acer with an i7, 8gb RAM and decent GFX Card. And 80gb HDD...

Ah, Android and Windows. 🙂

It felt really good to get home and create an Android Emulation Device and run my sample program in it. After I got that out of the way I went through the first lesson on Google’s Android Developer page. In it I learned how to create a basic User Interface including an Edit text field and a button, start a new activity (which makes a new screen), and get to the new screen from the first one while taking information from the first one with you to the second one. It really wasn’t that hard, and this is actually my second time going through this lesson. The first time was on my tablet using AIDE and it resulted in 34 errors. I’m happy to announce that this time, using Eclipse IDE, I came up with zero errors and an App that works as it is supposed to. After going through the lesson 2 times I still could not reproduce it on my own. Or in other words if you came up to me and said, “Hey, I want you to build an Android App where a user enters text on one screen and then the app displays that text on a new screen.” I wouldn’t know how to do it. Even though I have already built that app I couldn’t do it at this point with out the step by step instruction. At the moment I will assume that in time I will be start to truly put together what I am doing and part of it will become memory. I understand what almost all the code I used means so that isn’t the problem. It’s just knowing what to use when and where without the instruction. Again, I assume that will come with practice. Patience my young apprentice.
I’d like to take a moment to mention that the troubles I had setting up Eclipse for Android Development are apparently not the norm. I’ve got a friend that’s into development, but hadn’t done much if any Android work until I mentioned I was going to work on it. After hearing about my woes with environment set up he said he had no problem installing the SDK and ADT Plugin for Eclipse. I wanted to mention that so it didn’t discourage any one out there from looking into Android Development.
I wonder if this will work... ?

First Activity of my first App

It worked!!

Second Activity

My next steps are to continue the lessons on Google’s Android Development site and see if a completed program’s source files can run in AIDE on my tab. 🙂

Road Blocks

 

 

July 21, 2012

 

 

 

I started trying to learn how to code Java application 20 days ago when I had an idea for an Android App I would like have and use. Since no one else has made it I thought that I should learn how to and make it myself. I like to think I’m pretty smart guy. After all I’m employed as a PC Technician… How tough could this be?

Image

Turns out, it’s pretty tough. I hated math in school and it turns out it’s used a lot in Java Programming. I started out by trying to jump right into Android Development. Now, what is a Computer Technician to do if he wants to learn a new school? Yup, you guess it! http://www.google.com. The first few android developement tutorials I came across assumed I had a fully working understanding of Java Development. I did not… Back to google I went. This time searching for java development. I quickly learned that youtube video’s were going to be the best way to learn. I found what I thought was a good java tutorial video series and followed Oliver’s directions to install NetBeans. Pretty soon I had coaxed my code to print out the simple phrase “Hello World!” Since would be the first time of many that I would code those words. Hmmm, well that’s pretty simple. By the 13th lesson I was getting input from the user. Now, I start to see something that I will need in am own app. I know I am still a very long way from being able to make it. Soon I was getting data from a file saved on my computer and writing data to a different file. Things were looking up and I was feeling pretty good about my chances of being able to make a working app one day. I found myself becoming consumed with learning all I could about java. Reading tutorials at work, watching youtube video’s on my coffee breaks and looking forward to getting home to netbeans to try it out. I didn’t understand everything I was reading, or even everything I was watching, but when I was able to try it out in netbeans while following the program I could get it to work. Almost always…
 
One morning before work I got up and set to work on the 17th video in the series. I had watched the video a few times the day before and although it was more complex than anything I had before I thought I had a handle of how it worked. It was a basic calculator program that could perform basic mathematical operations that the user input. The only issue is it didn’t work for me. Something was wrong, and before I could work it out I had to leave for work. It would bug me all day, but I had to move on. My main work PC was down, limiting what I could do during the work day. With no manager in to approve a new PC I found other ways to keep my self amused. I installed {AIDE} on my Galaxy Note and found a tutorial to start coding for Android. This seemed like a win, so I wasted away the wait times in my day as diagnostics ran on the few PC’s in my shop. The guide was for using eclipse, but I figured it was be similar to use {AIDE} since you can import projects from eclipse anyway. I started a new project and went to work on making my PC output the word’s, “Hello World!” Hmmm, where have I seen that before? The guide went on to show how to change the colour of those words. I changed to them green, and recompiled the .apk. After discovering the the guide had some syntax errors I got the text to change colours. Next the guide went on to add a new layout element: A text input field. This would be needed in my eventual app, so I was excited to learn about. Sadly, this is were the guide started to lose me. I found that it didn’t explain what the code it was adding meant, but I tried to copy it into {AIDE} just as it appeared in the guide. After I had copied it all in I was presented with 37 errors! Including some in the blocks of code that had worked just fine a moment ago. Suddenly it was telling me their should not be a ‘/’ in ‘string/hello’ but that would mean it would not pull the string up from the res folder. That’s not what I need. I re-read the guide, started over and tried again and again always to get hung up at that spot. My work day came to an end. Once home, I synced the broken app from my phone into my 10.1″ Acer iconia A500 and attached my keyboard. I pulled up the guide and started trying again. This time with more concentration and less distractions. Still no luck. I deleted the project and started again, hoping that I would some how avoid the issue this time. This time as I went I made other changes to test things out. I added to the main “Hello World!” string so that it displayed: “Hello World! Testing 1, 2, 3” and compiled and ran the app. It worked! That got me a bit excited. I had found out how to do something on my own. Encouraged by this small victory, I went back and added more onto the string. I added: “It worked! That means I can add this and it’ll appear in the app as well.” Compile, install, run. “Hello World! Testing 1, 2, 3. Wait a minute! Why didn’t it work? Went back and checked the code… maybe I didn’t save it before compiling. No, it’s there. Well this makes no sense. 
 
So here I am with 3 different beginner Java Programming issues. Who knew copying down code someone else wrote for people just getting started in programming could be so hard. Now this wannabe code monkey is left wondering if he really wants to be a code monkey or if he should just stick to simple repairs. It’s an interesting dilemma since he’s only coding for a side project and really doesn’t aspire to make any money off it. I don’t think we’ve seen the end of this wannabe’s journey into codeland.