I am new to android development and confused about the following prefixes:
- xmlns:android
- xmlns:app
- xmlns:tools
- android:something
- app:something
- tool:something
I am confused about them because sometimes I use one, and android studio marks it as red underline which means i should use another one, and when sometimes i use another one android studio marks it with red line which means i should use the other one and so on, which makes me confused. And even in some cases i noticed that we are not allowed to use any one of them for example style attribute, layout attribute etc.
What each represents?
Which one is used for which purpose?
Which one is the parent, child and sub child, or may be i am wrong about this logic?
Is there anymore than them? If yes please share the resource or link
Why sometimes we don't use these prefixes for example style, layout etc?
I want to know about them to use them with understandable and proper way. Thank you very much !!!
 
                        
as Henry said, these are called namespaces.
the
toolsnamespace is used to make changes to components without it being applied at runtime. it is useful for designing and testing different layouts or components without it affecting your code when you run the app.the
androidnamespace is usually used for an android attribute, meaning that it comes from the Android SDK itself.the
appnamespace is used for support library components, so that it works for various different versions of android.xmlnsis simply a namespace specifying that it is an xml document, these are used for making changes to the xml document itself.