How to enable intellisense or auto completion for AXML?

cdytobycdytoby ✭✭USMember ✭✭

I already implemented the related xml schemas files from internet, android-layout-xml.xsd and schemas.android.com.apk.res.android.xsd,
But I still don't get any intellisence tip.

How to enable it?

One more thing, I can't find EditText in Toolbox.

Best Answer

Answers

  • cdytobycdytoby ✭✭ USMember ✭✭
    edited May 2016

    OK, figured out myself by searching everywhere:

    download this rar, it contains a xml and 2 xsd files. Unarchive, and copy the 3 files to
    (your visual studio location)/Xml/Schemas folder.

    And then restarts the visual studio.

    open the axml file as (xml editor), and you'll get the intellisense for it. The Visual Studio's android designer won't get intellisense when edit the code.

    This works for my Visual Studio 2015.

    The following article doesn't work for visual studio 2015 (at least for me), please edit it.
    https://kb.xamarin.com/customer/portal/articles/1920119-how-do-i-enable-intellisense-in-android-axml-files-

  • ReznokReznok USMember

    Same issue, tried your fix, still not working.

  • JosephMartinezJosephMartinez ✭✭ USMember ✭✭

    cdytoby,

    Where do I get the RAR that you refer to?

  • cdytobycdytoby ✭✭ USMember ✭✭

    @JosephMartinez said:
    cdytoby,

    Where do I get the RAR that you refer to?

    Is the rar in the second post not visible to you?

    If so, I'll create a dropbox link for it.

  • cdytobycdytoby ✭✭ USMember ✭✭
  • cdytobycdytoby ✭✭ USMember ✭✭
    edited May 2016

    @Reznok said:
    Same issue, tried your fix, still not working.

    I'm not a pro, so I don't know why it doesn't work.

    As I said, right click axml file, open with application, use xml editor instead android designer, because only xml editor have intellisense.
    And click the "XML" in menu bar, then click xml schemas, check if the namespace shows there. The files in that folder will be loaded automatically.

    The other fix doesn't work for me is because there should be a schemacatalog file in the same folder, which is included in the rar I provided.

  • JosephMartinezJosephMartinez ✭✭ USMember ✭✭

    Got it, thanks!

  • HenkPewPewHenkPewPew USMember

    Don't know how you've found this, but I've been trying to find this for a couple of days.
    Indeed this third file did the trick for me as well! Thanks a bunch.

  • HenkPewPewHenkPewPew USMember

    Just wondering tho, because you have to use the XML Editor, this'll mean you can't use the designer. How do you guys solve this? Or are u just opening with the different programs (android designer/xml editor) each time?

  • cdytobycdytoby ✭✭ USMember ✭✭

    @HenkPewPew said:
    Just wondering tho, because you have to use the XML Editor, this'll mean you can't use the designer. How do you guys solve this? Or are u just opening with the different programs (android designer/xml editor) each time?

    No, there is a setting in visual studio, you can set "axml" files default open program just like windows explorer, but it's for visual studio only.

  • HenkPewPewHenkPewPew USMember

    @cdytoby said:

    @HenkPewPew said:
    Just wondering tho, because you have to use the XML Editor, this'll mean you can't use the designer. How do you guys solve this? Or are u just opening with the different programs (android designer/xml editor) each time?

    No, there is a setting in visual studio, you can set "axml" files default open program just like windows explorer, but it's for visual studio only.

    I know, but if you set it default to xml editor, which I do, you can not see the designer. So if you want to use both, the designer AND intellisense, you have to switch between the android designer and xml editor I guess.

  • BorisDonevBorisDonev ✭✭ USMember ✭✭

    @andrewsaad said:
    Hi everyone, i managed to get the auto completion to work within the android designer.
    First step, i downloaded and extracted the archive file provided by cdytoby, Thanks so much.
    Second, open visual studio and open any AXML file. In the menu bar at the top, click on XML, then choose Schemas

    Now click on the Add button and choose the two .xsd downloaded before, after adding them make sure that they are both marked as "Use" as shown in the picture
    .
    That's it ! now auto completion should be working in the android designer.
    Hope that i helped.

    Thanks for providing this solution, it works!

    I will just add that you need to "Remove" the schemas that were previously used by Visual Studio before or after adding the new ones, otherwise this solution will not work after restarting Visual Studio.

    image

  • achmadsudibyo.7501achmadsudibyo.7501 USMember

    In my case is, intellisense for standard control is working (check pic), mostly, but when i tried to add appcompat or design library thing like drawerlayout is not shown, while in xamarin the intellisense is worked like charm even all resource are accessible via intellisense. I envy xamarin studio..and its a shame apparently this ide will be left out in favor of VS

    I am using visual studio 2015 community edition Update 3 newest xamarin vs, and bunch of web essentials extension

  • farzadmoomenifarzadmoomeni USMember

    fallow this article step by step :)

  • SumeetDaradeSumeetDarade USMember

    Still does not work for me ! Tried all xsd files. nothing works. Help is appreciated

  • moataznoneedmoataznoneed USMember

    I solve it by adding an import tag at the top of schemas.android.com.apk.res.android.xsd file:

    <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'
    targetNamespace='http://schemas.android.com/apk/res/android'
    xmlns:android='http://schemas.android.com/apk/res/android'>
    
    <xs:import schemaLocation="android-layout-xml.xsd" />
    
    </xs:schema>
    

    But I still need to delete [ProjectFolder]\bin & [ProjectFolder]\obj (not the ordinary cleaning), to make it work.

    I also noticed that just after opening the .axml file (designer mode, not source), these .xsd files are cached to the ProjectFolder again, which disables the intellisense.

    So, I need to clean again, funny isn't it ?

  • diegoxleondiegoxleon ✭✭ ESMember ✭✭

    None of the above solutions are working for me in Visual Studio 2017

  • moataznoneedmoataznoneed USMember
    edited April 2017

    @diegoxleon said:
    None of the above solutions are working for me in Visual Studio 2017

    It works, but its kind of pain. I'm using VS2017c too, Please read my previous answer carefully..
    Whether you're using cdytoby's rar files above or import tag method, When one works for you, avoid opening the .axml file in designer mode (open as xml instead) like in here, or you'll have to clean again, to easy check it, from the .axml press ctrl+space.

    I copied the 2 .xsd files to (but of course it depends on your version):
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Xml\Schemas\

    Another awesome extension that works with .axml in designer mode is RapidDesign, but its trial for 14 days, so make sure you backup you Windows before install, to re-install it later after restoring Windows.

  • diegoxleondiegoxleon ✭✭ ESMember ✭✭
    edited May 2017

    Everything works now (by default) with Visual Studio 2017 15.3 preview

  • mojtabaZolfagharimojtabaZolfaghari ✭✭ USMember ✭✭

    i have same problem and i fixed it
    you must download the archived file on > cdytoby reply and then you must go to project and open any of xaml file and on menu select xml and Schemas and set all of checked file to DO NOT USE THIS and click on add button then open 2 file of xsd file of 3 file and then restart visual studio
    enjoy it :smile:

Sign In or Register to comment.