1. Download our Official Android App: Forums for Android!

Apps First post - Noob questions

Discussion in 'Android Development' started by überfuzz, Jul 27, 2011.

  1. überfuzz

    überfuzz Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    9
    Joined:
    Jul 27, 2011

    Jul 27, 2011
    9
    0
    5
    I'm totally fresh as an android developer and now after some days of tinkering, in Eclipse, I've got some questions.


    1. Layout - I'd like to set up a bunch of buttons in an tidy manner. Lets say I have buttons and I like to arrange them like 5x5 buttons, 5 rows 5 columns. But I don't have a clue of do's and don'ts. Is there any 'good' way and are ways I should avoid? I'd like to set them up to fill the window with a small margin |left[5 buttons]right| top bottom the wrap the row.
    2. Drag and drop - I use android SDK, basically I just followed the set up suggested on android developer site. From what I understand I should be able to drag and drop items in the Graphic Layout. When I drag and drop stuff I just get empty tags, like <Button></Button> Is it possible to fill my items with attributes, not type it all out by myself?
    3. R.java stuff - Is there some kind of standard here, or do I just set up my R-subclasses as I please?
    4. res dpi-folders - How do I know where to put which, size or resolution, picture.
    If anyone could shed some light on this I'll be --> :).
     

    Advertisement

  2. hooked82

    hooked82 Newbie
    Rank:
    None
    Points:
    16
    Posts:
    19
    Joined:
    Jul 23, 2011

    Here's some info for you:

    1. Gridview may be the way you'd want to go, depending on your approach.
    Grid View | Android Developers. You could also just use a LinearLayout in horizontal orientation mode with 5 buttons in it. You could then set the android:layout_weight of each button to "1" and it will evenly distribute the buttons across the width of the page.

    2. I don't know of a way to do this, hopefully somebody else can chime in on it.

    3. When you create folders in your /res folder, the classes in R.java will be automagically created for you. No need to do anything on your end.

    4. If you only plan on using one image for all screen resolutions/sizes (not recommended), then you can just put the assets into /res/drawable. If you want to have images scaled per the size/resolution, then you would create different sized assets and place them in the respective folder. More info can be found here: Providing Resources | Android Developers

    HTH
     
    überfuzz likes this.
  3. QuackWare

    QuackWare Newbie
    Rank:
    None
    Points:
    16
    Posts:
    22
    Joined:
    Jul 14, 2010

    For #2:

    Buttons and other views should be filled out with basic attributes like id and text and layouts which you are probably going to change anyway. It's strange that it is not working for you. If you don't want to edit the values in XML you can edit them thought the graphic interface by right clicking on the view and editing the properties that way.
     
    überfuzz likes this.
  4. überfuzz

    überfuzz Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    9
    Joined:
    Jul 27, 2011

    Jul 27, 2011
    9
    0
    5
    Thanks for the input. It really helped!
     

Share This Page

Loading...