How to implement my very own URI scheme on Android

后端 未结 5 752
借酒劲吻你
借酒劲吻你 2020-11-22 06:12

Say I want to define that an URI such as:

myapp://path/to/what/i/want?d=This%20is%20a%20test

must be handled by my own application, or serv

5条回答
  •  执念已碎
    2020-11-22 07:16

    I strongly recommend that you not define your own scheme. This goes against the web standards for URI schemes, which attempts to rigidly control those names for good reason -- to avoid name conflicts between different entities. Once you put a link to your scheme on a web site, you have put that little name into entire the entire Internet's namespace, and should be following those standards.

    If you just want to be able to have a link to your own app, I recommend you follow the approach I described here:

    How to register some URL namespace (myapp://app.start/) for accessing your program by calling a URL in browser in Android OS?

提交回复
热议问题