Hello, Android (Ongoing Review)

Discussion in 'Android Hacks and Help' started by silverx10, Dec 12, 2009.

  1. silverx10

    silverx10 Member

    Joined:
    Nov 22, 2009
    Messages:
    196
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Virginia Beach, VA
    Ratings:
    +0
    So as I said I was going to, this is the thread for my progress on the book, Hello, Android.

    When applicable, I fully intend on publishing the completed apps (after sufficient testing on my own device, mind you) on the Marketplace, much to the chagrin of a certain lurking individual, I believe.

    In any event, I thought I'd go ahead and post something that seems to be a rather large issue at the offset (only now popping up in chapter three):

    It would seem that a common problem in each book I've read thus far (either because it's a change in the Android platform, or the IDE I'm using is the issue, or something else, perhaps...) is that at one point or another, there's an issue with a resource being unable to be resolved.

    That being said, a Google search has found that the solution to this is the following:

    Remove the initial

    Code:
    Import android.R;
    Line from the beginning of your files and rebuild.

    This'll make sense if and when you read the book.
     
    Last edited: Dec 12, 2009
  2. Backnblack

    Backnblack Premium Member Premium Member

    Joined:
    Nov 18, 2009
    Messages:
    11,262
    Likes Received:
    17
    Trophy Points:
    453
    Ratings:
    +17
    Subscribing to this....
     
  3. silverx10

    silverx10 Member

    Joined:
    Nov 22, 2009
    Messages:
    196
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Virginia Beach, VA
    Ratings:
    +0
    I'm foreseeing some minor problems here, as the book specifically states that it was written with Android 1.5/1.6 in mind. However, to this point, I'm not seeing too many problems that I haven't been able to fix by either messing around on my own, or checking out Google.

    The first two chapters of the book introduce you to key concepts of the Android programming world, including key terms, the "Android lifecycle", and even how to create your first "Hello, world!" application. Which, in Android and with the help of Eclipse, is probably the easiest hello world app I've ever created (even more so than Visual Basic, primarily because Eclipse itself creates the app as the default workspace).

    Chapter three sees you beginning work on an app that you'll develop more and more throughout the book: a working copy of a Sudoku game. I've got mixed feelings on this one because I'm not too big on Sudoku, but I do (obviously) want to learn how to develop apps on Android. And since I'm sure everyone loves games to one extent or another, Sudoku seems (in theory) like a pretty simple way to get into that particular area as well.

    Currently, I've designed the main menu interface, as well as the About dialog and have just implemented the coding required to show the difficulty options when the user clicks "New Game". Unfortunately, there's a problem in the code that I haven't been able to figure out just yet, but I haven't consulted the almighty Google just yet.

    So far, the book does seem pretty solid, and an excellent starting place for people new to the development scene. Both Android and otherwise.

    More to come.
     
  4. silverx10

    silverx10 Member

    Joined:
    Nov 22, 2009
    Messages:
    196
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Virginia Beach, VA
    Ratings:
    +0
  5. silverx10

    silverx10 Member

    Joined:
    Nov 22, 2009
    Messages:
    196
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Virginia Beach, VA
    Ratings:
    +0
    That problem that I'd thought I ran into? The error turned out to be between the chair and the keyboard.

    Yeah, operator error.

    In the end, this is an ongoing problem I have: impatient, and usually inattentive to details.

    That being said, lesson for this chapter learned? Read everything, and make sure that all your code goes within the class tag for each Java file.

    Remember this.
     
  6. Varking

    Varking Member

    Joined:
    Nov 5, 2009
    Messages:
    577
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Winston Salem
    Ratings:
    +0
    I believe there is one of those "Android Development for Dummies" coming out in early 2010 if you want to take a look into that. I, like you, am now just starting to read this to try and produce some free apps for the community. Anyways, I look forward to reading more on your journey, I have this thread bookmarked.
     
  7. silverx10

    silverx10 Member

    Joined:
    Nov 22, 2009
    Messages:
    196
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Virginia Beach, VA
    Ratings:
    +0
    o rly?

    That's outstanding news, really. What's more, I've taken the time to visit the forums for Hello, Android, and the author of the book confirmed that he'll be re-writing the book for Android 2.0+. Though ultimately, it's not problems with compatibility I'm facing: this is some seriously in-depth code, with not-so-in-depth explanation. He explains a good deal of what he codes, but not all of it.

    Just enough to leave questions.
     
  8. silverx10

    silverx10 Member

    Joined:
    Nov 22, 2009
    Messages:
    196
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Virginia Beach, VA
    Ratings:
    +0
    Alright, just finished up the first incarnation of the Sudoku game. And I have to say, despite the fact that I understand almost none of the code involved with it, there's a definite sense of accomplishment with having manually typed up all that crap.

    Of course, the next step is to actually go back and digest the code and figure out what it all means.

    If nothing else, I've gotten to the point where I now know how to intercept input (i.e., keypresses, touches, etc.).

    's a start.
     
  9. silverx10

    silverx10 Member

    Joined:
    Nov 22, 2009
    Messages:
    196
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Virginia Beach, VA
    Ratings:
    +0
    And the Sudoku app is completely finished, including the Continue, music, and preference saving functionality.

    Though I can't say much for the app itself (as I have no idea how to play Sudoku (I know the rules, just not how to play)), I can say that I've learned quite a bit from examining the code since completion, and I've no doubt I'll learn more as I get through the rest of the book.

    I will say this, however: I'm getting more than just a little tired of having the book tell me, and I quote, "To do this, it's but a simple three lines of code in Android."

    Because it's never just three lines of code. It's three lines of code PLUS the other forty lines to support those three.

    Getting my hopes up, only to dash them moments later.

    /sigh
     
    Last edited: Dec 14, 2009
  10. silverx10

    silverx10 Member

    Joined:
    Nov 22, 2009
    Messages:
    196
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Virginia Beach, VA
    Ratings:
    +0
    So I just finished the book (more or less), and in the end, I would most definitely recommend it to aspiring Android programmers. It does walk you through the creation of a fully-functional (though very baseline) Sudoku app, and explains a good deal of it, though in the end, there are still gonna be a good bit of gaps in there that you'll need to do additional research on.

    The next book on my reading list is Sam's Teach Yourself Java in 24 Hours, which I prolly should've read first, but... what the hell. I'm sure in the end, it won't make too much of a difference.
     
  11. silverx10

    silverx10 Member

    Joined:
    Nov 22, 2009
    Messages:
    196
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Virginia Beach, VA
    Ratings:
    +0