Q:

Understanding the Android XML @ prefix

I'm trying to understand how the @ symbol in android XML files are parsed. 
For example: 
<item type="layout" name="activity_item_list">@layout/activity_item_twopane</item>

The @layout references the Layouts in the system. 
or 
<FrameLayout android:id="@+id/item_detail_container" android:layout_width="0dp"
    android:layout_height="match_parent" android:layout_weight="3" />

The @+id seems to via some magic add the ID to the system in a manner that I can reference in code :
R.id.activity_item_detail

My searching is leading me to a number of random articles that don't seem to help my understand how these characters are parsed. are these just treated as some form of macro \ where can I learn a little more about his?
Thanks
Warrick

A:

At http://developer.android.com/guide/topics/ui/declaring-layout.html you can read:

The at-symbol (@) at the beginning of the string indicates that the
  XML parser should parse and expand the rest of the ID string and
  identify it as an ID resource. 
The plus-symbol (+) means that this is
  a new resource name that must be created and added to our resources
  (in the R.java file).
There are a number of other ID resources that
  are offered by the Android framework. When referencing an Android
  resource ID, you do not need the plus-symbol, but must add the android
  package namespace, like so: android:id="@android:id/empty"

Does it help?

A:

@layout, @string, etc. are for accessing resources, see http://developer.android.com/guide/topics/resources/accessing-resources.html
@+id is id declarations, you can use the id below the declaration in the xml file, e.g. in layout_toLeftOf property, and access the UI element in code from R.id package

