title: Can I pass in a member variable for an Android Service to use?
body: <p>I would like to reuse some service layer code in another project.  I do want to be able to change one of the member variables the service uses, without having different service code.  I don't see how this can be done as I don't "create" the service; the manifest and the system do that.  Thus I can't pass something in a constructor.</p>
  
  <p>I have a hard time finding the write words to ask this question, so perhaps a quick example is best.  I have a service, such as:</p>
  
  <pre><code>public class MyService extends Service implements MyCommunicatorListener {
  
  ICommunicator _comm = new BlueToothCommunicator(); // great for project 1, not for project 2!
  
  public void shutUpCommunicator()  // example of using communicator
  {
      _comm.Shutup();
  }
  
  // MyCommunicatorListener methods
  @Override
  public void onPageReceived(Page page) {  // example of listening to communicator
      Log.d(TAG,"onPageReceived");
  
  }
  }  // class greatly simplified...
  </code></pre>
  
  <p>All works well.  The service is started my virtue of the fact that it's declared in the manifest:</p>
  
  <pre><code> &lt;service android:name="com.acme.servicelayer.MyService" android:process=":remote" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="com.acme.servicelayer.MyService" /&gt;
              &lt;action android:name="android.intent.action.BOOT_COMPLETED" /&gt;
              &lt;category android:name="android.intent.category.HOME" /&gt;
          &lt;/intent-filter&gt;
      &lt;/service&gt;
  </code></pre>
  
  <p>I'd like to keep this service code and reuse it another project.  In the other project, I don't want to use:</p>
  
  <pre><code>ICommunicator _comm = new BlueToothCommunicator(); // great for project 1, not for project 2!
  </code></pre>
  
  <p>I want to use:
      ICommunicator _comm = new WiFiCommunicator(); // great for project 2, not for project 
  1!
  How can I do this and keep the same code base?  Is there someway to pass arguments through the manifest?
  Thanks,
  Dave</p>