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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en