让你的App能够在搜索结果中唤起

让你的App能够在搜索结果中唤起

        

     随着移动互联网及智能机的快速发展,由于APP能够更好的结合手机特征从而给带来更好的的体验,从而推动APP呈现爆炸式发展。所以用户不仅仅通过网站而且越来越多的通过APP来满足各种需求。但APP较网页搜索更为封闭,内容和服务很难通过传统的连接得到传播,同时APP的推广成本居高不下也给开发者带来巨大的困扰。为了给开发者带来更多的下载、安装量及启动频率搜索引擎平台正在与开发者和站长合作,将native App与移动搜索联系起来,在搜索结果中提供App的deep linking,支持从搜索结果直接调起App到具体的页面。

 

 

 

 

         而让App支持其他的App唤起只需要在自己的AndroidMainfest.xml中Activity声明处加入一个特殊的 intent filters

 

<activity
            android:name="com.example.wakeup.MainActivity"
            android:label="@string/app_name" >
            <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" />
                <!—接受以 "wakeup://example/shop” 开头的uri -->
                <data
                    android:host="example"
                    android:scheme="wakeup"
                    android:pathPattern="/shop=.*"
                     />

                <category android:name="android.intent.category.BROWSABLE" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>


 

唤起的另一端只需要知道URI,就可以直接唤起该App的此页面

 

	Uri url = Uri.parse("wakeup://example/shop=123");
	Intent intent = new Intent(Intent.ACTION_VIEW, url);
	startActivity(intent);


加入唤起功能的App就能够获得

 

 

private void getIntentData() {
		Uri uri = getIntent().getData();
		if (uri != null) {
			String message = "path = " + uri.getPath() + "\n";
			message += "scheme = " + uri.getScheme() + "\n";
			message += "host = " + uri.getHost() + "\n";
			message += "data uri = " + uri;
			
			mMessageTextView.setText(message);
		}
	}


 

 

拿到path就可以做后期也数据逻辑处理了。

 

一个唤起的demo:http://download.csdn.net/detail/yzzst/6861925

 

 

 

参考:

App Indexing for Google Search 

https://developers.google.com/app-indexing/

 

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

北漂周

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值