Nathan K
Nathan K

Reputation: 15

Android XML Layout or Java Coded

I am starting to delve into Android Development and there is a lot of material online. The question is... What are the pro's and con's against the drag and drop XML design method vs coding the view manually? The only reason I ask on here is because online the views are mixed and they don't really back up what they're defending.

If I use the drag and drop method will I have issues further onto my development adventures? That is the thing that worries me the most... I don't want to learn the drag and drop method and then editting the XML to cater for my needs and then be handicapped by it.

Upvotes: 1

Views: 79

Answers (1)

Ait Bri
Ait Bri

Reputation: 587

For the beginner(s), I highly recommend not to use Drag and drop. We need to understand XML, to be comfortable with android widget. Understanding XML will come handy in future when creating custom styles and themes.

Here are few pointers before you dive in android XML layout

  • Try sticking with match_parent and wrap_content while defining android:layout_height or android:layout_width if possible
  • Make sure you have good understanding of RelativeLayout, LinearLayout and FrameLayout and how its child views are arranged.
  • Forget about ConstraintLayout, AppbarLayout and similar advance layout at current.
  • Try exploring TextView, EditText, Button, ImageView and ProressBar as far as possible.(This are most common widgets/views)
  • Try avoiding any tutorial related to ListView, its deprecated. Try using RecyclerView instead, it is one of the important widget that would be used in regular basis.

Upvotes: 2

Related Questions