title: Android Local Service Sample, bindservice(), and ServiceConnection()
body: <p>I have a question which is related to this <a href="https://stackoverflow.com/questions/2842080/android-bindservice">question</a> that was asked by @mnish about a year ago.</p>
  
  <p>Please have a look at his question and code. He implements a ServiceConnection() and passes it to bindService(). This follows the Local Service Sample in the <a href="http://developer.android.com/reference/android/app/Service.html" rel="nofollow noreferrer">Service</a> documentation near the top.</p>
  
  <p>I want to implement the Local Service Sample, so I am trying to add some details from @mnish question/answer. In ServiceConnection() @mnish has this line that confuses me:</p>
  
  <pre><code>mService = ILocService.Stub.asInterface(iservice);
  </code></pre>
  
  <p>I understand @mnish wrote this code, but does anybody have any idea what ILocService is and any idea how I might go about creating my own ILocService? Where is this construct documented and do I need it? Also where does the value for IBinder iservice come from?</p>