如何使html到Android应用程序启动超链接?

时间:2017-01-04 14:29:27

标签: android html hyperlink

我是Android开发的新手。 我不知道如何创建Android应用程序启动超链接并将其嵌入到HTML页面中。 我的方案是,任何人点击这个链接Android应用程序将自动启动,(应用程序将预先安装到设备中。)

这是清单代码:

    <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:"http://schemas.android.com/apk/res/android" android:versionCode="9" android:versionName="1.0.4" package="com.happyconz.wherelive" platformBuildVersionCode="22" platformBuildVersionName="5.1.1-1819727">
    <uses-sdk android:minSdkVersion="11" android:targetSdkVersion="21" />
    <supports-screens android:anyDensity="true" android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:resizeable="true" android:xlargeScreens="true" />
    <uses-feature android:name="android.hardware.camera" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.NETWORK" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
    <uses-permission android:name="android.permission.GET_TASKS" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="android.permission.USE_CREDENTIALS" />
    <uses-permission android:name="com.happyconz.wherelive.permission.INTERNAL" />
    <permission android:name="com.happyconz.wherelive.permission.INTERNAL" android:protectionLevel="signature|signatureOrSystem" />
    <application android:theme="0x7f0b0095" android:label="0x7f09028c" android:icon="0x7f02011d" android:name="com.happyconz.wherelive.GlobalApplication" android:allowBackup="true" android:largeHeap="true">
        <activity android:theme="0x7f0b0099" android:label="0x7f09028c" android:name="com.happyconz.wherelive.activity.HomeActivity" android:launchMode="singleTask" android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity android:theme="0x7f0b0095" android:label="0x7f09028c" android:name="com.happyconz.wherelive.Main" android:configChanges="keyboardHidden|orientation|screenSize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:label="0x7f09011e" android:name="com.happyconz.wherelive.about.CustomActivity" />
        <activity android:theme="@style/Theme_AppCompat_Light_NoActionBar" android:label="0x7f09028c" android:name="com.happyconz.wherelive.video.youtube.sign.LoginActivity" android:launchMode="singleTask" android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity android:theme="@style/Theme_AppCompat_Light_NoActionBar" android:label="0x7f09028c" android:name="com.happyconz.wherelive.video.youtube.sign.LogoutActivity" android:launchMode="singleTask" android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity android:theme="0x7f0b0099" android:name="com.happyconz.wherelive.recode.Recorder" android:permission="com.happyconz.wherelive.permission.INTERNAL" android:launchMode="singleTask" android:configChanges="keyboardHidden|orientation|screenSize">
            <intent-filter>
                <action android:name="com.happyconz.wherelive.action.Recorder" />
            </intent-filter>
        </activity>
        <activity android:theme="0x7f0b008f" android:name="com.happyconz.wherelive.CertFailDialog" android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity android:label="0x7f09025a" android:icon="0x7f020121" android:name="com.happyconz.wherelive.video.MyLiveListActivity" android:launchMode="standard" android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity android:label="0x7f090259" android:icon="0x7f020121" android:name="com.happyconz.wherelive.video.LiveListActivity" android:launchMode="standard" android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity android:label="0x7f09003f" android:icon="0x7f020121" android:name="com.happyconz.wherelive.preference.InfoActivity" android:launchMode="standard" android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity android:theme="0x7f0b0095" android:name="com.happyconz.wherelive.activity.WebViewActivity" android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity android:theme="@*android:style/Theme.NoDisplay" android:name="com.happyconz.wherelive.video.youtube.sign.CheckAuthActivity" />
        <activity android:theme="0x7f0b0095" android:name="com.happyconz.wherelive.video.CreateChannelActivity" android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity android:theme="0x7f0b0095" android:name="com.happyconz.wherelive.video.CreateLiveChannelActivity" android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity android:theme="@*android:style/Theme.Translucent" android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
        <activity android:theme="@*android:style/Theme.Translucent.NoTitleBar" android:name="com.happyconz.wherelive.adv.AdEverFullScreen" android:taskAffinity="com.wherelive.pro" android:launchMode="singleTask" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
        <activity android:theme="@style/Theme_AppCompat_Light_NoActionBar" android:name="com.happyconz.wherelive.adv.AdMainFullScreen" android:launchMode="singleTask" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
        <activity android:theme="0x7f0b0098" android:icon="0x7f020121" android:name="com.happyconz.wherelive.preference.SettingActivity" android:launchMode="standard" android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity android:theme="0x7f0b0098" android:icon="0x7f020121" android:name="com.happyconz.wherelive.preference.AccountSettingActivity" android:launchMode="standard" android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity android:theme="0x7f0b0098" android:icon="0x7f020121" android:name="com.happyconz.wherelive.preference.ScreenSettingActivity" android:launchMode="standard" android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity android:theme="0x7f0b0098" android:icon="0x7f020121" android:name="com.happyconz.wherelive.preference.LiveSettingActivity" android:launchMode="standard" android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity android:theme="0x7f0b0098" android:icon="0x7f020121" android:name="com.happyconz.wherelive.preference.MoreSettingActivity" android:launchMode="standard" android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity android:icon="0x7f020121" android:name="com.happyconz.wherelive.preference.SettingProActivity" android:taskAffinity="com.wherelive.pro" android:launchMode="singleTask" android:configChanges="keyboardHidden|orientation|screenSize" android:allowTaskReparenting="true">
            <intent-filter>
                <action android:name="com.happyconz.wherelive.preference.SettingActivity" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity android:theme="@*android:style/Theme.NoDisplay" android:name="com.happyconz.wherelive.LicenseChecker" />
        <receiver android:name="com.happyconz.wherelive.recode.service.AlarmReceiver" android:process=":remote">
            <intent-filter android:priority="995">
                <action android:name="com.happyconz.wherelive.recode.service.alarm" />
            </intent-filter>
        </receiver>
        <receiver android:name="com.happyconz.wherelive.receiver.AuthReceiver" android:process=":remote">
            <intent-filter android:priority="998">
                <action android:name="com.happyconz.wherelive.recode.service.certification" />
            </intent-filter>
        </receiver>
        <receiver android:label="0x7f09028c" android:icon="0x7f020120" android:name="com.happyconz.wherelive.recode.widget.AutoboyWidgetProvider">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
                <action android:name="android.intent.action.USER_PRESENT" />
            </intent-filter>
            <meta-data android:name="android.appwidget.provider" android:resource="0x7f070001" />
        </receiver>
        <service android:name="com.happyconz.wherelive.recode.service.RecorderService" android:exported="true">
            <intent-filter android:priority="999">
                <action android:name="com.happyconz.wherelive.recode.service.IRecorderService" />
                <action android:name="com.happyconz.wherelive.RECORDER_SERVICE" />
            </intent-filter>
        </service>
        <service android:name="com.happyconz.wherelive.recode.service.CertificationService" />
        <service android:name="com.happyconz.wherelive.recode.widget.AutoboyWidgetService" />
        <service android:name="com.happyconz.wherelive.video.youtube.streaming.StreamerService" />
        <meta-data android:name="com.crashlytics.ApiKey" android:value="e357fa9000ab877757425745ec7b43ad971b647b" />
        <meta-data android:name="com.google.android.gms.version" android:value="0x7f0e0006" />
        <activity android:theme="0x7f0b0098" android:label="0x7f090211" android:name="com.happyconz.wherelive.sns.SNSSettingActivity" android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity android:theme="@*android:style/Theme.Translucent.NoTitleBar" android:label="0x7f09028c" android:name="com.facebook.FacebookActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize" />
        <activity android:label="0x7f09028c" android:name="com.happyconz.wherelive.sns.twitter.TwitterActivity">
            <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="oauth" android:host="com.happyconz.wherelive.sns" />
            </intent-filter>
        </activity>
        <activity android:label="0x7f09028c" android:name="com.happyconz.wherelive.sns.twitter.TwitterProActivity" android:taskAffinity="com.wherelive.pro" android:launchMode="singleTask" android:configChanges="keyboardHidden|orientation|screenSize" android:allowTaskReparenting="true">
            <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="oauth" android:host="com.happyconz.wherelive.sns.pro" />
            </intent-filter>
        </activity>
        <activity android:name="com.happyconz.wherelive.sns.twitter.OAuthActivity" />
        <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="0x7f09032a" />
        <meta-data android:name="io.fabric.ApiKey" android:value="180b89f527bdd6961fab824c28327acefbae668c" />
        <activity android:name="com.mikepenz.aboutlibraries.ui.LibsActivity" />
    </application>
</manifest>

1 个答案:

答案 0 :(得分:0)

或另一种选择是;

找到应用程序包名后,如果应用程序在商店中,您可以将其链接到存储的应用程序链接,如果已经安装,则用户可以点击“打开”按钮。按钮。

请将其链接到:

market://search?q=pname:<package_name>

或者:

http://market.android.com/search?q=pname:<package_name>