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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:33:13+00:00 2026-06-07T00:33:13+00:00

I installed the ADT plugin for Android for Eclipse, and I don’t like it.

  • 0

I installed the ADT plugin for Android for Eclipse, and I don’t like it.

I would like use my own Grid Layout the way I want and design windows by code (the same way as JFrame in Java, because I already know how to do this) not by click and drag.

How to do this in Android?

  • 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-07T00:33:15+00:00Added an answer on June 7, 2026 at 12:33 am

    While I don’t think it’s a great idea to write the UI code in java, here’s how you would do it.

    First, you’ll want to look at the android.view.* and the android.widget.* packages in the Android Reference docs.

    Everything the the Xml corresponds to a View (or Subclass). So, if you see LinearLayout in the Xml, then there will be a LinearLayout java component as well.

    So, in your Activity's onCreate() method, where normally you’d just set the content resource xml view, you can instantiate a Widget and set it directly.

    public void onCreate(Bundle state) {
       TextView tv = new TextView();
       tv.setText("Hellow World);
       setContentView(tv);
    }
    

    You might also need to the set the LayoutPararms as well, since most widgets need to know if they should wrap content or fill the parent.

    Many of the Layout widgets are analogous to Swing Containers, ie, they accept children, so you can call addChild() with another view to create a widget hierarchy.

    This should be enough to get you started.

    As a final note, I’d like to reiterate that while you can build the complete UI in Java code, the Xml layout does offer some other benefits. For example the Xml layouts allow you to support multiple screen sizes, or different layouts (landscape vs portrait, etc), which is much harder to do (but not impossible) in Java. Also, you might be tempted to think that because the Views are in Xml, then they will be “slow” to be created on the device. But, Android optimizes the Xml resources, and in fact, I don’t think they are even Xml at the time they are compiled into your App. So the resource Xml files are very efficient, and writing direct Java code for the Views probably won’t get your much extra in terms of performance.

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

Sidebar

Related Questions

Is there any way to make Eclipse + Android SDK + ADT Plugin offer
I'm using Eclipse and android SDK (with ADT Plugin), I don't know if it's
I followed every step to install android ADT plugin installation with Eclipse IDE. I
I've installed the Android SDK and the ADT plugin, but Android doesn't show up
I just installed the latest galileo eclipse release. I added the latest adt plugin
I develop an Android App using eclipse, the Android Development Tools (ADT) plugin and
I am new to android and I am setting up eclipse with ADT plugin
I'm using Windows and Eclipse 3.7 Classic with ADT plugin for Android development. I've
I am using Eclipse Gallieo and trying to use the Android Plugin.But i am
I'm setting up Eclipse for Android and when attempting to install the ADT plugin,

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.