Can we create all ui coding in activity without using xml?
Ui can be completely created through programming. But that is not recommended. There should be clear separation between design and the logic. That is the reason why android has given res folder to create all the designs like layouts, menus, icons, and styles. If project demands some dynamic changes to the UI, which can't be done in the xml files, then programmer can use any View or ViewGroup classes to design the UI through programming.
lLayout = new LinearLayout(this);
tView = new TextView(this);
tView.setText("Hello, This is a view created programmatically!");
Back To Top