期间,我需要能够发出更新,而无需通过Android商店去一个测试阶段。我发现了一些关于这个的帖子,但是他们都没有为我工作。该文件本身下载的罚款,但两个替代方案我得到一个错误:定制的Android应用程序安装
08-09 16:31:20.411:错误/ AndroidRuntime(906):android.content.ActivityNotFoundException:找不到活动处理意图{动作= android.intent.action.VIEW DAT = HTTP://本地主机:4567典型应用=/vnd.android.package归档}
任何想法?
的Android
// first way
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://localhost:4567"));
// second way
// Intent intent = new Intent(Intent.ACTION_VIEW);
// intent.setDataAndType(Uri.parse("http://localhost:4567"),
// "application/vnd.android.package-archive");
startActivity(intent);
西纳特拉
require 'sinatra'
get "/" do
content_type "application/vnd.android.package-archive"
attachment('agatha_v4.0.apk')
file = File.open("agatha.apk", "rb")
response.write(file.read)
end
/download/app.apk当然是您在下载时保存它的地方 – Pyrodante
同意。 Android仅支持'file:///'和'content://'方案来安装APK。 – CommonsWare
所以答案是你*有*下载文件,然后安装它。当我这样做并尝试安装该文件时,我收到了“解析软件包时出现问题”的错误消息,即使我已检查下载的文件是否存在问题,但将其复制到设备后成功安装。 – chris