【发布时间】:2011-10-23 15:38:23
【问题描述】:
在测试阶段,我需要能够在不通过 android 商店的情况下发送更新。我发现了一些关于此的帖子,但似乎没有一个对我有用。文件本身可以正常下载,但对于这两种选择,我都会收到以下错误:
08-09 16:31:20.411: 错误/AndroidRuntime(906): android.content.ActivityNotFoundException: 找不到处理 Intent { act=android.intent.action.VIEW dat=http://localhost:4567 的活动typ=application/vnd.android.package-archive }
有什么想法吗?
安卓
// 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
【问题讨论】:
标签: android