I've recently started designing apps in Android Studio, and I've noticed that the same operations (for example, using a widget) can be completed by either going into the activityname_java file and creating the widget as a java object, or by going into the activity_activityname.xml and using the combination of drag-and-drop plus HTLM to make the widget.
My question is, how do these different methods work together(Java and HTML)? I don't see one file change when I edit the other one, so must I primarily rely on just one of them? Is there any way I can keep the other file updated as I edit one? Is there any advantage to using one type over the other? Any information would be greatly appreciated.
It's not HTML but XML you are referring to.
Android will create UIs for you if you define them in XML, which is much easier than doing it "by hand", (you have to hardwire and correctly initialise everything). You might need to go the "manual way" (code) if you have to dynamically create such UI from scratch, which is not usual for beginners (although even then, often you will be able to reuse XML resources).
Not the answer you're looking for? Browse other questions tagged java android html application-design android-development or ask your own question.
Why is it (or was it) important to separate CSS from HTML?
How to approach this legacy Java project?