[英]How does an android app knows about a Samsung Gear?
I want to know from my android app, if there is a Samsung Gear configured by the user that can be connected or not. 我想从我的Android应用程序中了解用户是否配置了可以连接的Samsung Gear。
For the moment I use this code, which is a lesser evil: if the user has the samsung manager installed, I guessed he also have a samsung Gear: 目前,我使用此代码,这是一个较小的弊端:如果用户安装了三星管理器,我猜他也有一个三星Gear:
PackageManager pm = context.getPackageManager();
try {
pm.getPackageInfo("com.samsung.android.gearmodule", PackageManager.GET_ACTIVITIES);
return true;
}
catch (PackageManager.NameNotFoundException e) {
return false;
}
http://img-developer.samsung.com/onlinedocs/sms/accessory/index.html There is nice docs related to SAP protocol. http://img-developer.samsung.com/onlinedocs/sms/accessory/index.html有很多与SAP协议相关的文档。
http://developer.samsung.com/api-reference/list.do - there are few resources that might help you. http://developer.samsung.com/api-reference/list.do-很少有资源可以为您提供帮助。 Check "accessory" items. 检查“附件”项目。 Sample apps are useful 示例应用程序很有用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.