Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7685405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:14:37+00:00 2026-05-31T19:14:37+00:00

This question has been bugging me for some time. I’ve already developed a couple

  • 0

This question has been bugging me for some time. I’ve already developed a couple of apps on the Android platform and somehow always find myself resorting to Java code in order to construct the layouts. In a professional development environment, is this acceptable? Or should XML files be the go-to approach? I usually find XML a more tedious approach and often, these layouts don’t look the same on all devices. I just don’t get it. From a professional viewpoint, has anyone really been able to develop apps with complex views purely using XML files? This question is killing me because Google recommends using XML but the UI never looks the same on all devices unless done programmatically. Or am I doing something wrong?

Note that I’m referring to Android 2.2 and 2.3, which majority of the users use.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T19:14:39+00:00Added an answer on May 31, 2026 at 7:14 pm

    I use XML layouts on pretty much every fragment and activity of every app I write. I very rarely see any need to create Views dynamically, tho configuration of ListViews, showing/hiding views, etc needs doing in code. For me the advantages of XML are:

    • Ability to use layout editors (Eclipse)
    • Easier to preview layouts
    • Possible to benefit from auto-localisation of layouts
    • Easily maintain different parallel layouts for difference devices (screens)
    • Can get a sense of the layout by looking at it (easier than code)
    • Easy to break layouts down into pieces (fragments, includes, etc) to remove duplication
    • Keeps a separation between the visual design, and the functionality behind it

    I can’t think of any good reasons to put all my layouts into code – that sounds like hell.

    I expect the reason your layouts don’t look the same is because your XML is not defining the layouts correctly. Bear in mind the Android tools convert XML layouts into code, so there’s no inherent problem with using XML layouts versus dynamic – both end up as code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question has been bugging me for some time. I always picture launching my
Have a question regarding something which has been bugging me for some time now.I'm
This is a question that's been bugging me for some time now: In photoshop/GIMP,
Being new to test based development, this question has been bugging me. How much
It's not a programming questions. But this question has been bugging me for awhile.
This is a question that has been bugging me for a while. I started
This question has been puzzling me for a long time now. I come from
This question has been bugging me for a while. I am looking for a
This is a question that has been bugging me for a while and I
This is a simple question that has been bugging me. In XCode 4.2, is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.