Editing Android XML Layout Files in Android Studio

Elements in Visual Studio provides integration with Android Studio, Google's official IDE for Android development that is used by Java language developers, to allow you to edit XML Layout Files and other Android-specific XML resource files (such as AndroidManifest.xml or strings.xml).

This allows you take full advantage of Google's visual designers for Android.

With an Android project open, simply right-click the project node in the Solution Explorer and choose "Edit User Interface Files in Android Studio":

Behind the scenes, Elements will create a wrapper Android Studio project folder with the relevant files, and then launch the Android Studio application (provided it is installed).

In Android Studio, you will see all the projects's XML files and can edit them with all the tools Android Studio provides, including the visual designers. As you make changes and save them in Android Studio, they will automatically reflect back into your Elements project inside Visual Studio.

Connecting Code and UI

The way Android user interfaces work, the UI you design in Android Studio has no direct knowledge of the classes in your code. Instead, your code has a one-way connection to all the resources in your XML files via the static R Class, covered in more detail in the The R Class topic.

As you design your UI and add new controls or other resources, the R class will gain new properties that allow you to access these resources from your code.

See Also

 

Version Notes

  • Integration with Android Studio for visual design of Android Layout files is new in Version 8.1.