This is pretty common with XML systems with a lot of tags, especially
if they're meant to be expanded or mashed up.

If you create your own View types, you can extend the XML DTD to
include
your namespace.  Third-party libraries can add all of their features
with their own namespace.  It's the combination of these namespaces
and
DTD rules that allow the XML scanning process to find errors or
mistyped
parameter names.  No namespace, weaker protection from errors.

You might see the official reply in this bug tracker entry:
  http://code.google.com/p/android/issues/detail?id=7123

On Jan 24, 9:31 pm, Naren <nare...@gmail.com> wrote:
> Hi,
> I am a beginner to android development and wanted to ask a question to
> the developer community.
>
> What is the significance of specifying "android:" in front of every
> attribute.?
>
> be it view or layout, I know that I am already in android, then I feel
> its kind of redundant to prefix an attribute with android colon.
>
> <TextView android:id="@+id/mastersname"
> android:layout_width="wrap_content"
>                 android:layout_height="wrap_content" android:text="Master of
> Computer Applications">
> </TextView>
>
> Cant this be expressed as follows?
>
> <TextView id="@+id/mastersname" layout_width="wrap_content"
>                 layout_height="wrap_content" text="Master of Computer 
> Applications">
> </TextView>
>
> However the one reason that I can think of is specifying the package
> name (android:) as a prefix to resource will help to retrieve the
> resource easilly. But still, this need not be prefixed in every
> attribute. This should have been able to be specified in only one
> header or similar at the top.
>
> I think this might help in bringing down the code size and also for a
> quicker parsing.
>
> Let me know if I am missing something.
>
> Thank you
>
> Further,
> the attributes itself also can be very well shortened.
> ex:width as "w" height as "h" and layout_width as "lw" and
> layout_height as "lh"
>
> Thank you,
> Naren P

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to