Xamarin axml, xml Intellisense not working - android

I started using Visual Studio 2017 Enterprise Edition with Version 15.7.4. and Xamarin Version 4.10.0 and need to work on Xamarin native android application.
But Auto fill suggestions not coming in xml and axml files. Intellisense working for widget names(Like TextView, EditText etc.) In layout axml files. But, for widget properties (Like android:layout_width, android:gravity etc.) it isn't working. Where as in styles.xml, menu.xml suggestions not coming at all. I check with following ways.
1) XML - Schemas > android-layout-xml.xsd and schemas.android.com.apk.res.android.xsd files are exists
2) File opened as XML (Text) Editor
3) I didn't find Resharper in Tools
Also, Is there any way to change Xamarin keyboard shortcuts to Android Studio or Eclipse?

Being a Xamarin developer for almost two years I have come to terms with the fact that the Xamarin Android intellisense has never worked as it is expected.
It has a lot of bugs and issues (Links below) which have made it a real pain in the neck, But there are workarounds which you have already mentioned above and if those do not work for you trust me nothing will.
https://forums.xamarin.com/discussion/118384/android-designer-does-not-work-well
https://forums.xamarin.com/discussion/125879/designer-not-loading-layout-at-all
https://forums.xamarin.com/discussion/76851/visual-studio-2015-android-designer-not-working
https://forums.xamarin.com/discussion/82082/android-designer-not-working-in-visual-studio-enterprise-2015
https://forums.xamarin.com/discussion/6258/android-designer-doesnt-work-in-vs-2012
https://developercommunity.visualstudio.com/content/problem/99268/xamarin-android-designer-not-working.html
My suggestions:
Android studio provides you with a very strong designer and hence I would simply suggest you use Android studio to write down your XML and then just copy paste it to your Xamarin AXML/XML files and it should work like a charm, Same can be done for any other time of files such as strings or styles XML.
For changing the visual studio shortcuts you can simply check the following guide

Related

What is the difference between XML and AXML in Xamarin.Android Apps?

Since VS2019, I have noticed that every new project has regular XML as its resources like native Android Studio applications, but previously (2015 or 2017) it created AXML files.
Internally, the files looked exactly the same, but recently I'm getting new bugs in Xamarin.Android in each new release in VS2019 (Windows or Mac), for example:
Link assemblies is crashing
Build with Linking is Crashing in Xamarin.Android 9.5
Perhaps, I should use AXML files as an uncommon comment came yesterday:
The linker removes classes that are needed and apparently doesn't
parse the axml to see that they are in fact needed
This situation makes me wonder if there is any specific difference between them because when I run my app it works perfectly fine while it's not for Release or certain configurations like linking all assemblies.
Important note:
As my title of the question says: I'd like to know the difference between both extensions since for any reason the extension changed without any notice. The previous situations only raised my curiosity about this situation, they are not necessary linked.
.axml is nothing more than an extension hack that was used to render Android Layout Files i.e. Android flavored .xml files inside Visual Studio. It literally meant .axml (Android XML).
We previously lacked infrastructure to interpret flavored versions of .xml files coming from all different types of workloads. However in 16.2 and 8.2 respectfully (Visual Studio and Visual Studio for mac), you can use .xml seamlessly in your application and be provided a layout editor, rich intellisense, and more.
If you don't require a layout editor, you have been able to use .xml since the first release of MonoDroid as .axml is processed the same way as .xml at the end of the day.
First, the linker does not do anything with your layout files. So .axml or .xml, it just won't touch it or parse it. The linker only work with the classes represented by the layout files, not the layout files themselves.
Now, regarding the ".axml" versus ".xml" I believe the ".axml" extension is just a legacy thing from MonoDroid. The only goal of that specific extension was probably to identify android layout files, from regular xml files, without any advanced logic (it's only a supposition).
Long story short, if you're facing issues in your project regarding the linker, it's probably not related to your extension choice for layout files. You should keep whatever Visual Studio defines as the default.
First of all, Link all assemblies is prone to crashing and while those crashes can be fixed with some level of effort and knowledge, exactly because it causes more trouble than what it helps it isn't recommended option by Xamarin. So those are not 'bugs', those crashes are expected behavior.
Second, that comment on github that you linked doesn't tell there is any problem with axml files. It says that your axml file requires some library to be present and that it cannot be determined by the compiler which removes it and causes crashes.
Basically it has nothing to do with the question in your title.

Can't edit anything or drag widgets in Android Studio

I started off with a black activity and whenever I try using Android studio, I get stuck in this screen. I cant drag any widgets, enter any text, or make any changes to the user interface. Is there anything I am missing? I downloaded all the Android Studio bundle and I have all the required SDK tools. I have attached a screenshot of what I am currently stuck with.
A screenshot of what I am seeing:
Recently I encountered the same problem myself. After some research I found that you must now use the "content_activityname.xml" file in order to edit the ui of an activity.
In your case this file is located in the layout folder, right under your activity_main.xml in the picture provided.
According to this thread: What is the role of content_main.xml in android studio 1.4? the main.xml now contains the global look of the ui, and also contains the content.xml file which again contains the components of the ui.
You should think of uninstall and reinstall Android Studio and after that creating a new Project. You also are able to look at some tutorials created by the creators of AS. They can be found at Android Developers.

Unable to open designer view in visual studio xamarin

i have an existing project on others pc, however, when i move the project files into another computer, the project itself unable to show the drag and drop view in the xaml file, it show the code view instead of drag and drop, how should i do to make let me see the designer view??
Are you using the Core Framework of xamarin or Xamarin Forms ? (I'm asking because you are talking about xaml files instead of xml)
If you are using the Core Framework juste have a look to this link coming from the xamarin documentation :
https://developer.xamarin.com/guides/android/user_interface/designer_overview/designer_walkthrough/
One last thing, instead of copying the files use a version management tools if is not the case (like github or bitbucket)
The installed Android SDK is probably too old. Consider updating it.

.axml highlighting and intellisense not working in monodroid

I recently installed mono for Android and today I tried to get started. In all of the tutorials I have seen, intellisense and highlighting both work in visual studio when editing .axml files, but after an install, uninstall, and re-install, mine still isn't working. I guess I could go on like this, but it is just driving me absolutely nuts.
If you are using the default VisualStudio editor for XML, then the intellisense should come from the namespace import: xmlns:android="http://schemas.android.com/apk/res/android"
If you are using the Xamarin designer and its XML editor, however, then I don't believe that you will get any intellisense - that's a work in progress from the Xamarin team.

Mono for Android - Layout Designer Issue

I'm using Mono for Android 4.2.4 with VS 2010. The layout designer does not refresh properly if you change the theme, API version, orientation or device name from the designer toolbar. MonoDevelop works fine.
Is there a resolution for this?
I have not seen one. There are other issues as well, if you modify a xaml file and change widows without saving it, your changes will disappear! While Monodroid is an awesome tool, there are still a few bugs

Categories

Resources