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?
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.
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.
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.
Android applications use XML to create layout files. Unlike HTML, XML is case-sensitive, requires each tag be closed, and preserves whitespace.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With