2

XML is great if you know beforehand what the layout is going to be. But some applications need to generate a dynamic GUI. For example, a Domain Specific Language (DSL) that places high-level custom GUI objects on the screen under the control of a script.

Is there an API reference - with examples - for programmatically coding a GUI in Java?

4 Answers 4

2

No Deference,No API Reference Between XML Layout and Programmatically....

Just Like.... For Example, If You Use <TextView /> in your XML File Its TextView Class is Already in Package import android.widget.*; of Android Library.

And if you Use TextView as Programmatically Its Same .But Some RunTime and Custom GUI We use....

See this http://saigeethamn.blogspot.in/2010/12/creating-android-ui-programmatically.html

Sign up to request clarification or add additional context in comments.

Comments

1

Every tag we are Declaring in layout XML has equivalent Class in Android SDK.

Every attribute you set in xml tag is the equivalent property of that class mostly with the same name.

So either you develop UI from XML or by code it is mostly the same except the XML layout design reduces a lot of effort.

The Android developer site has complete reference for XML attributes and Properties for Each widget.

Comments

0

Look at the ApiDemos app shipped with SDK - it has some good examples for dynamic layouts.

Comments

0

But you have official API's :

http://developer.android.com/reference/android/widget/package-summary.html

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.