Is it possible to import an XML file with an interest in replacing XAML?

0

Good morning ladies and gentlemen,

It would be possible to work with XML file (layout) made in Android Studio to use in visual studio in the case of android development with xamarin. I would like to replace the AXML file that comes as the default in visual studio with the XML file that is generated by Android Studio.

PS: It sounds crazy but there is a google project that the developer only glues the XML code or writes and sees everything being done next by a smartphone without the need to use emulators, light and very practical.

link

    
asked by anonymous 04.07.2017 / 03:53

1 answer

0

Do not confuse XAML with AXML. AXML is a name given to the XML layout files of Android Studio in Visual Studio. An AXML file has XML inside it. A XAML file is also a layout file, but used in Xamarin Forms and other Microsoft applications, such as WPF.

If you are working with Xamarin.Android, ie a native project on Android through Xamarin, then yes, it is possible because the layout of Android in Visual Studio is defined through files called AXML which are nothing more than XML files.

If you are using Xamarin Forms, then no, it is not possible, as previously mentioned, Xamarin Forms uses XAML to define layouts.

XAML and AXML are completely different layout files and are interpreted differently by the compiler.

In conclusion, you can quietly copy an XML layout from Android Studio and paste it into the Android AXML layout of Visual Studio. Just note if it has some @string, @dimen, @style, or @color that references some other XML file created inside the 'values' folder, for example.

    
04.07.2017 / 19:53