title: How to open specific app's specific activity clicking on an external link?
body: <p>I am developing an android app, in which user must need to login first to use it's features. So as usual user must need to login using provided user credential. </p>
  
  <p>But I don't want user always enter username and password again and again, so that I am just sharing a URL with user and if user click on shared link from anywhere in phone (via mail, or WhatsApp, or Facebook, etc.) phone must prompt to choose my app and app should automatically extract the URL and directly redirect the app to my Home Screen by hitting the login api if username and password are correct. </p>
  
  <p>The shared url will be look like this - <a href="http://www.myurl.com/sso?username=Scb56745&amp;password=!l0Aeu0yQazxssx" rel="nofollow noreferrer">http://www.myurl.com/sso?username=Scb56745&amp;password=!l0Aeu0yQazxssx</a></p>
  
  <p>For now I have managed to prompt the dialog using this code in my AndroidManifest file - </p>
  
  <pre><code> &lt;activity
           android:name="com.my.par.activities.UserActivity"
           android:label="@string/app_name"
           android:screenOrientation="portrait"
           android:windowSoftInputMode="stateHidden"&gt;
           &lt;intent-filter android:autoVerify="true" tools:targetApi="m"&gt;
                      &lt;action android:name="android.intent.action.VIEW" /&gt;
                      &lt;category android:name="android.intent.category.DEFAULT" /&gt;
                      &lt;category android:name="android.intent.category.BROWSABLE" /&gt;
                      &lt;data
                          android:host="www.myurl.com"
                          android:path="/sso"
                          android:scheme="http" /&gt;
                      &lt;data
                          android:host="www.yoururl.com"
                          android:path="/sso1"
                          android:scheme="https" /&gt;
           &lt;/intent-filter&gt;
   &lt;/activity&gt;
  </code></pre>
  
  <p>I am getting this clicked URL link in my UserAcitivity's on getIntent() method, like this - </p>
  
  <pre><code>Uri uri = getIntent().getData();
  String path = uri.getPath();
  </code></pre>
  
  <ul>
  <li><p>So my real question is how to extract the username and password separately and so that I can call my login api by sending this username and password from this url (for ex. <a href="http://www.myurl.com/sso?username=Scb56745&amp;password=!l0Aeu0yQazxssx" rel="nofollow noreferrer">http://www.myurl.com/sso?username=Scb56745&amp;password=!l0Aeu0yQazxssx</a>). - <strong>Done</strong></p></li>
  <li><p>And how can I put a dynamic URL or host name, path and scheme in AndroidMenifest file? - <strong>Done</strong></p></li>
  <li><p>How can we force our app to always directly open the app,(don't need to show the chooser dialog) because no use of it even user click on browser nothing gonna happen.</p></li>
  </ul>
  
  <p>Happy coding :-)</p>