How can I link from an e-mail to a Xamarin Android app without additional dependencies? -
i want link app e-mail. xamarin documentations describes how link app:
http://developer.xamarin.com/recipes/cross-platform/app-links/app-links-android/
however, referring additional component (rivets) , focuses on linking code:
rivets.applinks.navigator.navigate("http://location/of/your/html/file.html");
and requires publish page:
publish page somewhere on internet, or @ location android app can reach.
this feels complex solution simple problem. want link e-mail app in way works, if website not work , preferably without additional components. tried based on explanations focus on android java applications. https://stackoverflow.com/a/11526028 , https://stackoverflow.com/a/2958870
i did not succeed xamarin app. here androidmanifest.xml:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="androidlink.androidlink" android:versioncode="1" android:versionname="1.0"> <uses-sdk /> <application android:label="androidlink" android:icon="@drawable/icon"> <activity android:name=".mainactivity" android:exported="false"> <intent-filter> <data android:scheme="http" android:host="twitter.com" /> <action android:name="android.intent.action.view" /> </intent-filter> </activity> </application> </manifest>
when send myself e-mail following content http://twitter.com/status/1234
, click on link in gmail app, browser opened, instead of app.
hopefully, problem solvable xamarin android. please note that:
- i want link e-mail app.
- i prefer working solution, if website down.
- i prefer browser not opened.
in case, relevant, here c# code:
public class mainactivity : activity { int count = 1; protected override void oncreate(bundle bundle) { base.oncreate(bundle); // set our view "main" layout resource setcontentview(resource.layout.main); // our button layout resource, // , attach event button button = findviewbyid<button>(resource.id.mybutton); var data = intent.data; if (data != null) { var scheme = data.scheme; var host = data.host; var pathsegments = data.pathsegments; button.text = pathsegments.count.tostring(); } button.click += delegate { button.text = string.format("{0} clicks!", count++); }; } }
Comments
Post a Comment