What is a deep link in Android?

南楼画角 提交于 2020-01-11 14:53:12

问题


Recent Android Dev Summit said that deep links are introduced in Android. What does it mean?

I researched the internet and found deep linking in Web, but how does it pertain to Mobile or Android in specific?


回答1:


Deep Linking is methodology for opening an android app from a link, and you can also send data into app using link. If the app is not available then they redirect on play store and display your app.

For example if you have made one app for shopping you want to share special offer on any network or social media, throw URL and when any buddy click on URL an open your app and display offer.

You need to add the following code in a Androidmainfest.xml file

<activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <!-- Accepts URIs that begin with "http://www.example.com/gizmos” -->
                <data android:scheme="http"
                    android:host="www.example.com"
                    android:pathPrefix="/FolderName" />
                <!-- note that the leading "/" is required for pathPrefix-->
                <!-- Accepts URIs that begin with "example://gizmos”
                <data android:scheme="example"
                      android:host="gizmos" />
                -->
            </intent-filter>
        </activity>


来源:https://stackoverflow.com/questions/33979849/what-is-a-deep-link-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!