Dynamic vs XML layout in Android?
I'm new to Android development and have started creating my own UI. I see that you can either create it dynamically something like this ( Dynamic Layouts ): @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ScrollView sv = new ScrollView(this); LinearLayout ll = new LinearLayout(this); ll.setOrientation(LinearLayout.VERTICAL); sv.addView(ll); TextView tv = new TextView(this); tv.setText("Name"); ll.addView(tv); EditText et = new EditText(this); ll.addView(et); Button b = new Button(this); b.setText("Ok"); ll.addView(b); } but I also see that