我想在emulator中获取应用程序的className和packageName。我没有得到任何输出。请让我知道正确的方法。
using (var stream = System.IO.File.Open("a.jpg", FileMode.Open))
{
var fileToSend = new FileToSend("a.jpg", stream);
Task.Run(() => bot.SendPhotoAsync(u.Message.Chat.Id, fileToSend).ConfigureAwait(false));
}
答案 0 :(得分:0)
List<ApplicationInfo> applicationInfos=getPackageManager().getInstalledApplications(0);
for(ApplicationInfo applicationInfo:applicationInfos) {
String cn=applicationInfo.className;
String pk=applicationInfo.packageName;
Log.i("tag", " " + cn+"---"+pk);
}