任何人都可以指导我如何从Android浏览器启动我的Android应用程序?
我希望在用户访问某个网址时启动我的意图:例如,Android市场通过http://market.android.com/网址进行此操作.youtube也是如此.我也希望我也这样做.
因此,我想创建一个Android应用程序,以便在Android操作系统中注册(或者只是在系统启动时启动),当手机用户点击网页浏览器内网页上的特殊按钮时:
 <a href="myapp://mysettings">Foo</a> 
我的应用程序将弹出并使用该URL中发送的参数运行.
那我该怎么做呢?
我需要一个代码教程!
基本上,我有相同的问题描述如何在Android上实现我自己的URI方案
给出的答案对我有用.当自定义url被称为MyUriActivity's方法onCreate并被onStart调用时.
但
如何从内部访问get参数MyUriActivity?
例:
myapp://path/to/what/i/want?d=This%20is%20a%20test
在MyUriActivity我需要读取get参数的值d.
我怎么做?
我可以在一个网站上添加一个链接,例如"navigon://",在iOS设备中,如果安装了Navigon应用程序,它将打开它.
是否有类似的简单方法从Android网站(假设已安装)打开应用程序?
我试过link1,link2,link3,link4,link5,link6
以下是有关DeepLinking的所有内容
我想要的是自定义uri myapp:// some_data,打开设备中安装的本机应用程序,需要some_data初始化应用程序.
有两种方案可以单击自定义URL.
1)在SMS应用程序内,当用户点击链接时,它应自动打开已安装的,否则打开应用程序托管的googleplay商店
2)从电子邮件正文中.
我已经尝试了以上列出的所有链接,但它们都不适用于我.我对方案部分有重大问题.
这是我的AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="18" />
<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="MainActivity"
        android:label="@string/app_name"
         android:exported="true" >
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.BROWSABLE" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:scheme="inderbagga" />
        </intent-filter>
    </activity>
</application>
这是MainActivity.java
TextView tvText=(TextView)findViewById(R.id.tvid);
    if (getIntent().getAction() == Intent.ACTION_VIEW&&getIntent().getScheme().equals("inderbagga")) {
        Toast.makeText(getApplicationContext(), ""+getIntent().getScheme(), Toast.LENGTH_SHORT).show();
        Uri uri = getIntent().getData();
        // do stuff with uri
        tvText.setText(uri.toString());
    }
    else …我正在尝试允许注册URI以使用我的应用程序打开.就像PatternRepository黑莓和iPhone上的CFBundleURLName/一样CFBundleURLSchemes.如何在Android上获得相同的结果?
系统将发送带有以下链接的电子邮件:   myapp://myapp.mycompany.com/index/customerId/12345.这个想法是用户应该能够点击链接以打开应用程序中的客户活动.
我已尝试过其他SO帖子的大量建议,但我无法让操作系统识别模式并打开我的应用程序.
在Gmail应用中,它看起来像这样:myapp:// myapp.mycompany.com/index/customerId/12345.它识别并强调myapp.mycompany.com/index/customerId/12345链接的一部分,并在浏览器中打开它.该myapp://部分未链接.
标准邮件应用程序将整个链接视为纯文本.
我在这里错过了什么?
PS:我已经看过 如何在Android上实现我自己的URI方案 以及如何通过在Android OS中的浏览器中调用URL来注册一些URL命名空间(myapp://app.start/)来访问您的程序?
清单:
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:versionCode="2"
    android:versionName="0.0.8" 
    package="com.mycompany.myapp.client.android">
    <uses-sdk 
        android:minSdkVersion="7" 
        android:targetSdkVersion="7"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <application 
        android:label="@string/app_name" 
        android:name="myappApplication" 
        android:icon="@drawable/ic_icon_myapp" 
        android:debuggable="true">
        <activity 
            android:label="My App" 
            android:name=".gui.activity.LoginActivity" 
            label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".gui.activity.CustomerDetailActivity" > 
            <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="myapp"/> 
            </intent-filter> 
        </activity>
        <activity android:name=".gui.activity.CustomerDetailActivity"/> …我正在使用这段代码从链接启动我的应用程序.
<activity
        android:name="com.example.myApp.myClass"
        android:label="@string/app_name" >
    <intent-filter>
        <data
            android:host="customHostName"
            android:scheme="customScheme" />
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.BROWSABLE" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
</activity>  
这是href链接,我想最终获得密钥.
customScheme://customHost/49FYTJTF00
它在以前的所有Android版本上运行良好,但不适用于Lollipop.
当我点击链接时,它只显示要启动的浏览器列表.
我该怎么办?
android hyperlink intentfilter android-intent android-5.0-lollipop
我们有基于Android的嵌入式设备的应用程序,它使用WebView,在其中我们使用Google OAuth 2登录应用程序.不幸的是,谷歌很快就会在WebView中阻止OAuth 2,我们有很多限制:
我们还能做些什么限制呢?
我已经创建了Azure移动应用程序,我正在关注此官方文档.在身份验证期间,说明了以下文档的部分内容
在"允许的外部重定向URL"中,输入url_scheme_of_your_app://easyauth.callback.此字符串中的url_scheme_of_your_app是您的移动应用程序的URL方案.它应该遵循协议的正常URL规范(仅使用字母和数字,并以字母开头).您应该记下您选择的字符串,因为您需要在几个地方使用URL Scheme调整您的移动应用程序代码.
我的问题是,他们没有提供重定向网址的任何有效示例,所以我在门户网站的重定向网址中粘贴了url_scheme_of_your_app://easyauth.callback并且因为它不是有效格式而给出错误,所以任何人都可以给我一个有效的例子这个网址?
提前致谢
android ×9
intentfilter ×3
url ×3
azure ×1
browser ×1
deep-linking ×1
google-oauth ×1
html ×1
hyperlink ×1
ios ×1
java ×1
launch ×1
oauth ×1
oauth-2.0 ×1
redirect ×1
uri ×1
url-scheme ×1