title: Declare namespace from jar lib in Android
body: <p>I am creating an Android SDK as jar. It contains some custom views with custom parameters. I want to create a drop-in solution, where developers don't need to do anything other than dropping the jar in their libs folder. I cannot go with a real library project, it's a business requirement. </p>
  
  <p>Everything actually works fine, and this is not my first android project, that ships as jar. But in this one, I need to have custom attributes for custom views. This means that Android needs to be aware of the attribute set supported by the views trough an xml schema.</p>
  
  <p>The easy solution is to have the users put a predefined attr.xml in they resources folder. However I have seen that libraries like admob work without a custom attr.xml. For example by admob you declare:  </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"&gt;
  &lt;TextView android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="@string/hello"/&gt;
  &lt;com.google.ads.AdView android:id="@+id/ad"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         ads:adSize="BANNER"
                         ads:adUnitId="AD_UNIT_ID_GOES_HERE"
                         ads:testDevices="TEST_EMULATOR,TEST_DEVICE_ID_GOES_HERE"
                         ads:loadAdOnCreate="true"/&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>but you don't need to add an attr.xml in your application. 
  If i try to use it like they do (i have the view in a jar) and have the same layout as above with my own custom attributes, then aapt complains:</p>
  
  <ul>
  <li>error: No resource identifier found for attribute 'XXX' in package 
   'com.XXX.XXX'</li>
  </ul>
  
  <p>I have already looked into admobs jar file, and i cannot find anything special in the com.google.ads package, that looks like an xml definition. Any idea how they managed to do this / how does aapt know which attributes are supported by admob's view?</p>
  
  <p>Thanks!</p>