本文介绍了如果"Android应用"已通过编程方式检测,则如何通过程序进行检测在Chromebook或Android手机中运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从Google宣布chromebook还支持"Android应用程序"以来,我也希望在chromebook上支持我的应用程序,尽管该应用程序运行良好,但几乎没有需要修复的异常.

Since Google has announced that chromebook also support "Android Application" so I also wanted to support my app on chromebook although it is running fine with few exception which I need to fix.

我想以只对chromebook执行而对Android手机和平板电脑不执行的方式编写代码.

I want to write code in such a way that that is will execute only for chromebook and will not execute for android phones and tablet.

我已经在android开发者网站上查看过Chromebook文档,但没有得到任何此类API来表明您的应用程序在chrome book环境中运行.

I have check with Chromebook documentation in android developer site, I didn't get any such API which tell that your app is running in chrome book environment.

ARC Beta文档的建议无效:

在华硕Chromebook上都返回 google .

Both return google on an ASUS Chromebook.

推荐答案

最后,我想出了一种方法来了解应用程序是否在ARC中运行:

Finally I figure out a way to know if app in running in ARC:

context.getPackageManager().hasSystemFeature("org.chromium.arc.device_management");

这篇关于如果"Android应用"已通过编程方式检测,则如何通过程序进行检测在Chromebook或Android手机中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 16:33