What is better: add your views using XML or code? [closed] - android

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
What is better for performance in Android application: add your View-elements using XML or Java code?

Difference in performance is not really observable, but for developing sake its better to keep it in XML. Then it's easier for You to develop adaptative UI supporting many screens. What's more it seperates code implementation from designing UI, what is always a nice thing and makes your code easier to read.

As long as you declare the XML layout properly there is no noticeable difference.
But i will suggest to use the XML because using that you can actually show what the layout is going to look like and it give you more clear idea about your UI.
One more advantage is that when you are giving the multiple resolution support for you application UI it will help you a lot.

Related

Learning xml for android development [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
Is it recommended to learn xml to create user interfaces for android apps?
It's pretty easy to do in the layout editor of android studio, but I feel like it would be better to learn to write the layout code myself so I'm not dependent on the editor.
Yes, it is recommended to learn the xml.
You won't be able to use the visual editor for every layout you use. When you are using the visual editor it may use hardcoded values and add some unwanted attributes, giving the users an bad UI depending on their devices.
Currently, the only layout that using the visual editor might be a good idea is the ConstraintLayout. But even for it, you might need to fix some generated xml code.
I think it's ALWAYS important to learn the basics of any "coding or language" instead of just playing around with the IDE, this should help you in the future for looking for errors or any changes. In case of XML it will help you to use it in other programming languages too.

Pros and cons of ConstraintLayout? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
A new version of Android Studio was released.
In the version 2.3 there are some news. One of those is the new ConstraintLayout.
Which are pros and cons of ConstraintLayout?
Pros:
You can develop highly complex interface, using constraint layout.
It reduces the nesting, thus overall improving the performance of your app.
It helps to be seamless across wide range of screen.
Cons:
Sometimes the result is not as expected as you want.It sometimes feel a little to track of all the all the constraint. It might get a little overwhelming for a new developer to understand the code.
Sometimes you might want to create another layout for landscape mode for adjusting the views and widgets as it may not be as you would want.

When to use Constraint Layout & How to use it efficiently? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
Google recently comes with another layout called ConstraintLayout However, I have few questions which is still very confusing.
I reviewed the talk related with this portion from google IO'16 and got an understanding that it would be really helpful as developer to create flat UI and performance would be better than any other layouts.
Questions:
1. In which case, We should use constraint layout?
2. Does introduction of ContraintLayout means that we should not use LinearLayout,RelativeLayout..etc anymore?
3. What is the efficient way to use ContraintLayout?
You probably shouldn't have been so eager to jump on your question here since IO is still going on
I suggest you go watch the session called Android Layouts: a new world (currently not available at time of writing) where they go into detail about ConstraintLayout
ConstraintLayout appears to be an easier way to create layouts without dealing with xml. Constraints layout is based off of RelativeLayout and is not meant to kill off other layouts since they are still very useful.
This being said as #CommonsWare said this is very very new and has no official documentation so its very difficult to come to a real conclusion about it. I would say it is like other layouts where it is usage is going to be based on what you want your design to look like

Android Better UI Design [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I've just recently started getting into Android development, and know about all the basic features of it such as permissions, basic UI, adapters, activities and interacting with a backend. How do I proceed if I want to further develop my UI/UX skills? Apps like Instagram and twitter have an interactive and attractive layout involving user inputs such as swipe. What's a good place to start to get more familiar with fancy layouts that are favourable to users?
Thanks in advance for any help!
I see 2 topics being discussed here: design and implementation.
Design includes UI/UX, interaction & motion.. You can find more types of design in this stackoverflow answer.
Implementation is a process of converting (usually) a static design to an interactive application. In your case you're doing this in Android. But the fancy layouts are general, not specific to Android.
Lastly, if you're interested in simply seeing some examples of Android UI and maybe their code, try this github repo
Almost everything about the layout in android is made with XML. If you want your layout to look better, you can also use different themes (either a custom one or a template one)
Editing an UI with XML also offers more possibilities than the graphical UI designer. You should get more information about designing UIs with XML on the internet.

best practice for android screen switch [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I am aware of the different methods for switching back and forth between android screens. I was wondering wich method, if any, is the best practice for doing so. Switching activites seems to be the most popular, but how processor friendly is it?
EDIT:
This question seems too objective, so I guess I will modify it by asking if anyone knows what method is most processor friendly.
Yes, apps are typically separated by multiple activities. These days, the activities contain fragments to better support multiple devices, layouts, etc. They are popular for a reason!
It's all very friendly. ;)

Categories

Resources