I had setup intent filter in manifest.xml, such as follows:
<activity
android:name="indexgifto.android.ui.viewcontrollers.SplashScreenActivity"
android:label="#string/application_name"
android:launchMode="singleTop"
android:windowSoftInputMode="adjustNothing"
android:theme="#android:style/Theme.Translucent.NoTitleBar"
android:screenOrientation="portrait" >
<intent-filter>
<data android:scheme="gifto"/>
<data android:scheme="http" />
<data android:host="www.gifto.net"/>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
When I execute 'am start http://www.gifto.net/go.php?c=xlh201' application successfully opens with required data. But, when same URL opened via Chrome, just server page opens. In the android 4 in both cases my app was able to start from this url. What I must fix in android 6?
Chrome for Android, versions 25 and later, you should implement a user gesture to launch the app via a custom scheme, or use the “intent:” syntax described in this article.
https://developer.chrome.com/multidevice/android/intents
this worked for me you to try once if worked for u.
<intent-filter>
<action android:name="android.intent.action.VIEW"></action>
<category android:name="android.intent.category.DEFAULT"></category>
<category android:name="android.intent.category.BROWSABLE"></category>
<data android:host="www.youtube.com" android:scheme="http" android:pathPrefix="http"></data>
</intent-filter>
Related
I'm trying to implement deeplinks in my, so users will be able to open the application from a browser. So, I've added deeplinks in my application in a Manifest.xml. And this code is working from adb, but when I'm trying to open this link in browser, the application does not opens. What can cause this error? I can even can't see an Intent in my code
<activity
android:name=".ui.main.MainActivity"
android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="http"
android:host="example.com"
android:pathPrefix="/"/>
</intent-filter>
</activity>
Use Firebase deep link ( Hope Help-full )
https://firebase.google.com/docs/dynamic-links
I want to start my Android app by using scheme, this is my code:
<activity
android:name="com.myapp.SplashScreenActivity"
android:alwaysRetainTaskState="true"
android:label="#string/app_name"
android:noHistory="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="www.myhost.com"
android:pathPrefix="/company/"
android:scheme="http" />
<data
android:host="myhost.com"
android:pathPrefix="/company/"
android:scheme="http" />
</intent-filter>
</activity>
Then run : myhost.com/company/ on browsers and results:
Default internet browser: App open normally
Chrome: does not work
Firefox: does not work.
I don't know how to solve it, please help me and explain me about it.
You should not use "http" as the scheme, because Chrome and Firefox can handle this kind of URL they will not call other app to handle it. Instead, you can use a self-defined scheme such as "myprotocol" which can not be handled by those browser, they will call your app to handle it. You can run "myprotocol://myhost.com/company/" on Chrome to test it.
I have a problem implementing Oauth in Android using signpost library. Everything is fine except the final part when it should return to the application itself after granting access.
Below is my activity callback declaration in manifest:
<activity android:name="ro.locationsApp.android.login.LoginScreenActivity"
android:screenOrientation="portrait"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="myCallbackHost"/>
</intent-filter>
</activity>
And I pass the Callback URL from code like this:
new OAuthHelper("mySite", "secret",
"https://www.googleapis.com/auth/userinfo.profile", "http://myCallbackHost");
Where myCallbackHost it's a real and functional link(it's also used for callback after a web site authentication - now I want mobile too).
The problem is that my android app is not called after this. I also tried
<data android:scheme="customScheme"/>
and
new OAuthHelper("mySite", "secret",
"https://www.googleapis.com/auth/userinfo.profile", "customScheme:///");
but without success.
Thanks,
Alex.
Changing http with something else works.
Here is how my manifest looks now:
<activity android:name="ro.locationsApp.android.login.LoginScreenActivity"
android:screenOrientation="portrait"
android:launchMode="singleTask">
<intent-filter>
<category android:name="android.intent.category.LUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="alex" android:host="me"/>
</intent-filter>
</activity>
and code:
new OAuthHelper("mySite", "secret",
"https://www.googleapis.com/auth/userinfo.profile", "alex://me");
works like a charm.
I want from the android browser be able to launch my application if it's installed, or launch my website in the other case.
So in order to make it work, I put :
<activity android:name=".MMLogin" android:label="MeetMe" android:theme="#android:style/Theme.NoTitleBar" android:screenOrientation="portrait">
<intent-filter>
<data android:scheme="http" android:host="meet-me.com" android:path="/signin" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
in the Manifest, and I created a dummy link to test; and it's not working.
I've tried with and without: BROWSABLE and DEFAULT
I've tried with meetme://datas and change the scheme; nothing worked.
I used threads on stackoverflow like :
Launch custom android application from android browser
What am I doing wrong, or is there a special thing to do to make it work ?
My application suppports from API 7.
Cheers
I used :
Intent Filter to Launch My Activity when custom URI is clicked, I think what was missing is this block :
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.EDIT" />
<action android:name="android.intent.action.PICK" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/myapp" />
</intent-filter>
There are many answers in stackoverflow showing how to lauch app from a web browser ,but I am not sure what went wrong with my code, that never seems to be doing the intended.
I am trying to launch my app by a URL from any other app like web browser,initially
my manifest file looks like this
<activity android:name=".Main">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<data android:scheme="http" android:host="ebay.com" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
And When I typed http://ebay.com in the browser that never started my app.Obviously,how does the browser know about my app?,then i tried the other way around and added another Activity called MyActivity and altered the manifest file as
<activity android:name=".Main">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MyActivity">
<intent-filter>
<data android:scheme="http" android:host="ebay.com" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
and tried in my Main Activity
startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse("http://mycityway.com")));
Thus producing the intended result.I can also start another application Activity using this method.
But most of the answers here says that the later is possible.What is the mistake i am doing,I couldn't launch my app from browser.Please guide me.
And When I typed http://ebay.com in the browser that never started my
app.
It gets started when a matching link is clicked not when you type the url in the browser.
Try it by sending yourself an email containing http://ebay.com and click the link in the email application.