8

安卓APP的http访问权限

 3 years ago
source link: https://blog.csdn.net/pcplayer/article/details/101305862
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

安卓APP的http访问权限

安卓下,默认只允许 https 的访问,不允许 http 的访问。

用 Delphi 写一个安卓 APP,用 TIdHTTP 去访问一个 WEB 服务器,不行。网上查了一下,发现需要这样做:

在 APP 的工程目录下,有一个 XML 文件,“AndroidManifest.template.xml”,用文本 编辑器打开它:

在 <application android:persistent="%persistent%"   底下,增加一行:

android:usesCleartextTraffic="true">

增加完后,全文如下:

加上那一行以后,IdHTTP 可以使用 http 协议访问一个网站了。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK