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 8770259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:31:35+00:00 2026-06-13T17:31:35+00:00

I just started learning Android development and I read there was basically 3 main

  • 0

I just started learning Android development and I read there was basically 3 main approaches to ‘build a view’ which are :

  • Java-based: Use Java to define Strings, lay out window, create GUI controls, and assign event handlers. Like Swing programming.
  • XML-based: Use XML files to define Strings, lay out window, create GUI controls, and assign event handlers. The Java method will read the
    layout from XML file and pass it to setContentView
  • Hybrid: Use an XML file to define Strings, lay out window and create GUI controls. Use Java to assign event handlers

What are the benefits and limitations of these 3 different approaches ?

Which one should be rather used by a beginner or a confirmed programmer ?

I’m not asking for subjective answer here ( before being flagged 🙂 ).
There must be some facts that make these approaches different from one another (speed, maintainability, readability…)

  • 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-06-13T17:31:36+00:00Added an answer on June 13, 2026 at 5:31 pm

    XML-based is like using CSS for a webpage. Using XML separates concerns neatly into the MVC (Model-View-Controller) pattern. If everything is specified in XML, then your activity can utilize different layout files for different screens, and the presentation of these elements can easily be updated by just changing to new XML files. This is good software development practice and greatly helps when it comes time to redesign or reuse components. In some cases you may still need to dynamically set some things in Java, but you should try to put all presentation-related stuff in the XML files.

    The event handlers should still be set and defined in Java, in my opinion. That is not related to presentation and thus does not belong in the XML files. I do not use the onclick XML attributes. Also, if you set it in the onclick attribute, you can break the connection if you refactor the method name in Java but forget to update the XML file.

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

Sidebar

Related Questions

I'm familiar with C++ but never used Java. I've just started learning Android development.
I've just started learning Android development and as a little project, I'm building a
I just started learning Android application development and I noticed the following issue while
So I just started learning Android and I am reading the commonsware android development
I Have just started learning Android, this is the code of my java file.
I just started learning Android development. I am writing an Android program to scan
I just started a new Android project, WeekendStudy to continue learning Android development and
I just started learning C++ (coming from Java ) and am having some serious
I have just started learning to write apps for android using Eclipse. Where can
I'm a total newbie to programming and just started learning JAVA i order to

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.