4
我正在开发使用自定义方案在以下链接的Android应用:可以使用自定义URL方案将一个POST数据发布到Android活动?
<activity android:name="com.example.library.activities.CustomSchemeActivity">
<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="custom" android:host="custom.example.com" android:path="/custom" />
</intent-filter>
</activity>
当用户点击一个链接,说custom://custom.example.com/custom?parameter=abcd
,预期CustomSchemeActivity正在启动。
现在,我需要将数据发送到此活动。我可以通过URL参数发送它。我很好奇,如果我将数据发布到意图,是否有可能读取内容?是否可以将数据从服务器发布到手机?
号有服务器和其他移动设备,然后将URL字符串之间没有其他的联系。在这种情况下,所有数据都应该在那里。 –
您可以将额外的数据捆绑在Intent中,但由于Intents不是HTTP,所以'POST'不适用。具有互联网许可的Android应用程序当然可以以任何正常的方式与HTTP服务器通话。 –
谢谢Chris和Stefan。我将不得不满足于使用HTTP的正常方式。干杯! –