title: How do I use AIDL tool from command line using SDK sample code?
body: <p>My question concerns using aidl.exe (on a Windows system) from the command line.  This question has nothing to do with Eclipse, Netbeans, etc.</p>
  
  <p>Included with the Android SDK are the following three AIDL definition files:</p>
  
  <p>IRemoteService.aidl
     IRemoteServiceCallback.aidl
     ISecondary.aidl</p>
  
  <p>located in the following directory:</p>
  
  <p>C:\android-sdk-windows\platforms\android-2.1\samples\ApiDemos\src\com\example\android\apis\app</p>
  
  <p>For the sake of simplicity, I copied aidl.exe into the above directory.  Then, from a console Window, I successfully used the following two commands to generate .java files:</p>
  
  <p>C:\Android-project\ApiDemos\src\com\example\android\apis\app>aidl IRemoteServiceCallback.aidl
     C:\Android-project\ApiDemos\src\com\example\android\apis\app>aidl ISecondary.aidl</p>
  
  <p>Invoking these commands produced the files IRemoteServiceCallback.java and ISecondary.java, respectively.  So far so good.</p>
  
  <p>I note that both .aidl files are simple; they include no 'import' statements.</p>
  
  <p>The remaining .aidl file, IRemoteService.aidl, does include the following import statement on line 19:</p>
  
  <p>import com.example.android.apis.app.IRemoteServiceCallback;</p>
  
  <p>The problem arises when I run the AIDL tool on this file:</p>
  
  <pre><code>  C:\Android-project\ApiDemos\src\com\example\android\apis\app&gt;aidl IRemoteService.aidl
  </code></pre>
  
  <p>Doing so causes the following error message to be printed in the console window:</p>
  
  <p>IRemoteService.aidl:19: couldn't find import for class com.example.android.apis.app.IRemoteServiceCallback</p>
  
  <p>The AIDL tool evidently could not locate the IRemoteServiceCallback.aidl file in the same directory in which it was running.  According to the AIDL tool's "usage" message, there is a command that apparently can be used to resolve this problem:</p>
  
  <pre><code>  -I&lt;DIR&gt;    search path for import statements.
  </code></pre>
  
  <p>The problem: I have not been able to specify -I in such a way as to avoid the error message and have the AIDL tool generate a .java file from the .aidl file with an 'import' statement.  (Note: I set the Windows environment variable 'path' to my current directory.)  Here are a few variations I've tried:</p>
  
  <pre><code>-Ic:\com\example\android\apis\app
  -Ic:/com/example/android/apis/app
  -I.\
  -I.
  </code></pre>
  
  <p>I must be missing something simple.  Surprisingly, even though I've seen variations of this question posted in various places, I have yet to see an answer or any documentation about AIDL command line usage (other than the aidl.exe USAGE info).  Can someone clue me in?</p>
  
  <p>Thanks,
  Matt</p>