Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternatives to xml by developing android app layout? [closed]

I would like to know if there is some other alternative or propper way for developing the UI of an android app. I know that XML is used, and also why - but are there any other methods even if they are not very efficient?

like image 595
Bobb Avatar asked Jan 10 '15 18:01

Bobb


People also ask

Is XML required for app development?

Every app project must have an AndroidManifest. xml file (with precisely that name) at the root of the project source set. The manifest file describes essential information about your app to the Android build tools, the Android operating system, and Google Play.

Which layout is best for Android development?

Use FrameLayout, RelativeLayout or a custom layout instead. Those layouts will adapt to different screen sizes, whereas AbsoluteLayout will not. Definitely right. I recommend RelativeLayout since it keeps the view hierachy flat.

Can Android application have activity without layout?

The answer is yes it's possible. Activities don't have to have a UI. It's mentioned in the documentation, e.g.: An activity is a single, focused thing that the user can do.

Does Android still use XML?

Android applications use XML to create layout files. Unlike HTML, XML is case-sensitive, requires each tag be closed, and preserves whitespace.


1 Answers

You are welcome to create your UI by creating Java objects directly and stitching them together into their parent-child relationships, including the layout managers needed to control things like sizing and positioning.

And, given that, you are welcome to invent your own means of defining an UI (parse some JSON, use a random number generator, etc.), as in the end it is all just Java objects.

like image 133
CommonsWare Avatar answered Nov 14 '22 23:11

CommonsWare