A Few Questions


Last Updated:

  1. JJackson

    JJackson Active Member This Topic's Starter

    Joined:
    Jul 22, 2010
    Messages:
    25
    Likes Received:
    0
    Hello,

    I am interested in learning to develop Android apps. I'm sure it is not a simple task, but I am willing to take the time to learn. My problem, however, is that 1) I don't know which language I should be learning and 2) I am unsure of the programs I need to download for app development.

    Could someone please shed some light on the subject? I would appreciate any assistance!
     

    Advertisement
  2. James McMurray

    James McMurray Member

    Joined:
    May 5, 2009
    Messages:
    18
    Likes Received:
    0
    The first place to go is straight to the source. :)

    Unless you intend on getting down into the Android internals, Java is the language you'll want, and Eclipse is the development environment of choice. The android developers site has setup instructions and tutorials.

    I highly recommend (once you're comfortable with basic Java syntax) getting the API Demo that comes with the SDK and poking around in it on the phone to see what it does, then looking at the code to see how it does it.
     
  3. JJackson

    JJackson Active Member This Topic's Starter

    Joined:
    Jul 22, 2010
    Messages:
    25
    Likes Received:
    0
    I installed the required Java applications, the Android SDK, and Eclipse. When I attempt to create a new project, I click "File >> New >> Android Project". After creating the project Eclipse does not populate the data. So I must be doing something wrong. I have tried multiple tutorials but I can't find one that is 100% step-by-step that I am able to easily follow.
     
  4. James McMurray

    James McMurray Member

    Joined:
    May 5, 2009
    Messages:
    18
    Likes Received:
    0
    What "data" is it not populating? Did it create the source files and (assuming you told it to create an activity) the xml layout files in res/layout?
     
  5. JJackson

    JJackson Active Member This Topic's Starter

    Joined:
    Jul 22, 2010
    Messages:
    25
    Likes Received:
    0
    I was actually attempting to create it without "Activity" ticked, but when I tried clicking Activity, here's the error I got:

    http://i31.tinypic.com/e6rpmc.png

    Additional details: The application title was "Latest Texts" and the package title was "com.latest.texts".

    Thank you for your assistance!
     
  6. andywhoa

    andywhoa Well-Known Member

    Joined:
    May 15, 2010
    Messages:
    105
    Likes Received:
    13
    Scratch that, I'm not really sure as it appears your tree is entirely empty
     
    JJackson likes this.
  7. JJackson

    JJackson Active Member This Topic's Starter

    Joined:
    Jul 22, 2010
    Messages:
    25
    Likes Received:
    0
    I thought installing and configuring the software would be the easiest part. :(
     
  8. andywhoa

    andywhoa Well-Known Member

    Joined:
    May 15, 2010
    Messages:
    105
    Likes Received:
    13
    I'm assuming you opened the Android SDK & AVD Manager and downloaded the APIs, yes?

    [​IMG]


    The tree there in Package Explorer is entirely empty, right?
     
    JJackson likes this.
  9. JJackson

    JJackson Active Member This Topic's Starter

    Joined:
    Jul 22, 2010
    Messages:
    25
    Likes Received:
    0
  10. andywhoa

    andywhoa Well-Known Member

    Joined:
    May 15, 2010
    Messages:
    105
    Likes Received:
    13
    Try doing Project > Clean... and then trying to run it again
     
    JJackson likes this.
  11. andywhoa

    andywhoa Well-Known Member

    Joined:
    May 15, 2010
    Messages:
    105
    Likes Received:
    13
    If it still doesnt resolve R, try adding "import com.latest.texts;" to your import list.

    I'm new to Android, but it seems to me that if you've just started a fresh project with the Android SDK, your starting package in src and your starting package in gen (that contains R.java) would be named the same

    Or rather try right clicking com.latest.texts.com.latest in the Package Explorer and going to Refactor > Rename and changing the name to com.latest.texts
     
    JJackson likes this.
  12. JJackson

    JJackson Active Member This Topic's Starter

    Joined:
    Jul 22, 2010
    Messages:
    25
    Likes Received:
    0
    Still not working... :(
     
  13. andywhoa

    andywhoa Well-Known Member

    Joined:
    May 15, 2010
    Messages:
    105
    Likes Received:
    13
    Same problem with R?
     
  14. JJackson

    JJackson Active Member This Topic's Starter

    Joined:
    Jul 22, 2010
    Messages:
    25
    Likes Received:
    0
    R cannot be resolved to a variable is what I am getting.
     
  15. andywhoa

    andywhoa Well-Known Member

    Joined:
    May 15, 2010
    Messages:
    105
    Likes Received:
    13
    Did you rename your package?
     
  16. JJackson

    JJackson Active Member This Topic's Starter

    Joined:
    Jul 22, 2010
    Messages:
    25
    Likes Received:
    0
    I'm going to try recreating it. Which build target should I use? How should the Package Name be formatted? Do I put anything beside "Create Activity" and should that box be ticked? And last of all, which Min SDK Version should I use?

    Thank you for your help.
     
  17. andywhoa

    andywhoa Well-Known Member

    Joined:
    May 15, 2010
    Messages:
    105
    Likes Received:
    13
    [​IMG]

    Copy this


    Project name is unrelated to your application as it pertains to the phone. It's just the project's name in Eclipse.

    The build target is the version of Android you want to build for. I'm developing my current project against 2.1. This can be changed at a later date if you want to.

    Application name is what will show up in Android as the name of your application.

    Package name is the name of your first package. Package names are domain urls backwards. If you don't have your own webpage, just make one up like I have for you.

    Create Activity will generate an Activity class for you named what you've typed.

    Min SDK Version should be the value of the API column in the Build Target list for the earliest version of Android you've checked. I'm sure there's a more in-depth explanation, but I don't have it (I'm new to Android, too). I think it's just to require Android device users to have that version or greater. The checkboxes themselves don't require this. I can check 1.5 and run it on a 2.1 device as long as the APIs used aren't deprecated.
     
  18. JJackson

    JJackson Active Member This Topic's Starter

    Joined:
    Jul 22, 2010
    Messages:
    25
    Likes Received:
    0
    I typed all that in and it came up with more errors, then Eclipse crashed...
     
  19. andywhoa

    andywhoa Well-Known Member

    Joined:
    May 15, 2010
    Messages:
    105
    Likes Received:
    13
    Lollll... maybe it just wasn't meant to be
     
  20. andywhoa

    andywhoa Well-Known Member

    Joined:
    May 15, 2010
    Messages:
    105
    Likes Received:
    13
    I would go through whatever setup instructions you went through again and make sure you set everything up
     
  21. JJackson

    JJackson Active Member This Topic's Starter

    Joined:
    Jul 22, 2010
    Messages:
    25
    Likes Received:
    0
    I tried deleting the files and reinstalling the software but it seems that simply deleting the files doesn't fully erase the data. Any idea what I should do for an absolute clean install?
     
  22. JJackson

    JJackson Active Member This Topic's Starter

    Joined:
    Jul 22, 2010
    Messages:
    25
    Likes Received:
    0
    What exactly do I input for "path"?
     
  23. Christofer Nal

    Christofer Nal New Member

    Joined:
    Feb 20, 2011
    Messages:
    1
    Likes Received:
    0
    Hi, I am new to Android. I had the same error "R cannot be resolved to a variable". This can be caused by many things. It is very important to check everything under res, especially things you changed when the problem first occured. What I had wrong was one new picture with name Car1.png but this isn' t valid name. So I changed it to car1.png and the error disappeared. Also you should check carefully your xml files for example sometimes "+" before id and if you forget you ll have R error.
     

Share This Page

Loading...