I have a little problem.
I have an Android Activity, and I want to run it from one link on the browser.
This is what how I have declared my Activity on the Manifest file:
<activity android:name=".Wul4"
android:windowSoftInputMode="adjustPan"
android:configChanges="keyboardHidden|orientation"
android:launchMode="singleInstance"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="wul4" android:host="com.wul4.wul4"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
On the webApp, the link to launch the application is the following one:
wul4://com.wul4.wul4?codOperacion="+respuestaActual.idOperacion
The point is that It is working from the following browsers: "Opera" and "Google Chrome", but it is not working for the rest..........(for instance, it is not working on the default browser of the phone).
Anyone knows why???
Thanks a lot!
Try this one, using HTTP instead of your own schema:
<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="com.wul4.wul4"
android:scheme="http:" />
</intent-filter>
When a link with this domain is clicked in an Android device, the user is presented with a dialog to choose between your App (if installed) or the Browser.
Related
Launch app when click on url if app installed on device. if app not installed on device, open playstore.
<activity android:name=".ui.NewsCardActivity">
<intent-filter>
<data android:scheme="app" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
You have to deep link your app, add following lines in activity (Manifiest.xml) which you want to launch
<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="screen" android:scheme="appname"/>
</intent-filter>
in browser when ever you click appname://screen your app activity will be launched,
replace appname and screen as per your requirement
Note if you type this url in browser it will search in google ,for this to work you have to write link in html page
Some text
If not working the add android:exported="true" in activity
<activity
android:name=".activity.MainActivity"
android:exported="true">
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 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>
I want to launch my application from web browser in Android using Intent-Filter based on scheme, host in the DATA tag like this.
<activity android:name=".activity.LogoActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activity.phone.MainActivityPhone" android:configChanges="orientation|keyboard"
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="my" android:host="mystore" />
</intent-filter>
</activity>
<activity android:name=".activity.tablet.MainActivityTablet" android:configChanges="orientation|keyboard"
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="my" android:host="mystore" />
</intent-filter>
</activity>
As you see, There are two Main Activities for phone and tablet, and in LogoActivity determine which Main Activity will be opened by screen size. But the problem is when user clicks my://mystore link in web browser, there are two choices to launch that MainActivtyPhone and MainActivityTablet.
What I want is there is only one proper intent-filter works for uri my://mystore .
Any help? Thanks.
On the first run of your application, use PackageManager to disable the activity you do not want to use.
Please do not invent custom schemes. Please use HTTP URLs instead:
<data android:scheme="http" android:host="yourdomain.com" android:path="/something/or/another" />
That way, you can actually put a real Web page at http://yourdomain.com/something/or/another, so if somebody gets your link but does not have your app installed, they will see your Web page, instead of getting an error.
Also, please remove android:configChanges, or handle all configuration changes.
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.