title: Dealing with implicit intent future deprecation in Lollipop
body: <p>To transmit data to other applications I've been using implicit intents as in examples below:</p>
  
  <pre><code>Intent intent = new Intent();
  intent.setAction("com.example.OpenURL");
  intent.putExtra("URL_TO_OPEN", url_string);
  sendOrderedBroadcastAsUser(intent);
  
  Intent intent = new Intent();
  intent.setAction("com.example.CreateUser");
  intent.putExtra("Username", uname_string);
  intent.putExtra("Password", pw_string);
  sendBroadcast(intent);
  
  Intent intent = new Intent();
  intent.setAction("com.example.BackupUserData");
  intent.setData(file_uri);
  intent.addFlags(FLAG_GRANT_READ_URI_PERMISSION);
  sendBroadcast(intent);
  </code></pre>
  
  <p>But this behavior is not recommended anymore in Android 5.0</p>
  
  <p><a href="http://developer.android.com/about/versions/android-5.0-changes.html">http://developer.android.com/about/versions/android-5.0-changes.html</a></p>
  
  <blockquote>
    <p><strong>Binding to a Service</strong></p>
    
    <p>The Context.bindService() method now requires an explicit Intent, and throws 
        an exception if given an implicit intent. To ensure your app is secure, use an 
        explicit intent when starting or binding your Service, and do not declare intent 
        filters for the service.</p>
  </blockquote>
  
  <p>From android source code more precisely "ContextImpl" class : </p>
  
  <pre><code>private void validateServiceIntent(Intent service) {
          if (service.getComponent() == null &amp;&amp; service.getPackage() == null) {
              if (getApplicationInfo().targetSdkVersion &gt;= Build.VERSION_CODES.LOLLIPOP) {
                  IllegalArgumentException ex = new IllegalArgumentException(
                          "Service Intent must be explicit: " + service);
                  throw ex;
              } else {
                  Log.w(TAG, "Implicit intents with startService are not safe: " + service
                          + " " + Debug.getCallers(2, 3));
              }
          }
      }
  </code></pre>
  
  <p>How can I deal with this ?</p>