本文整理汇总了Java中com.sonyericsson.extras.liveware.extension.util.registration.DeviceInfoHelper.isSmartWatch2ApiAndScreenDetected方法的典型用法代码示例。如果您正苦于以下问题:Java DeviceInfoHelper.isSmartWatch2ApiAndScreenDetected方法的具体用法?Java DeviceInfoHelper.isSmartWatch2ApiAndScreenDetected怎么用?Java DeviceInfoHelper.isSmartWatch2ApiAndScreenDetected使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sonyericsson.extras.liveware.extension.util.registration.DeviceInfoHelper
的用法示例。
在下文中一共展示了DeviceInfoHelper.isSmartWatch2ApiAndScreenDetected方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SWControlExtension
import com.sonyericsson.extras.liveware.extension.util.registration.DeviceInfoHelper; //导入方法依赖的package包/类
/**
* Creates a control extension.
*
* @param hostAppPackageName Package name of host application.
* @param context The context.
*/
SWControlExtension(final Context context, final String hostAppPackageName) {
super(context, hostAppPackageName);
mContext = context;
// Determine host application screen size.
if (DeviceInfoHelper.isSmartWatch2ApiAndScreenDetected(context, hostAppPackageName)) {
mWidth = context.getResources().getDimensionPixelSize(R.dimen.smart_watch_2_control_width);
mHeight = context.getResources().getDimensionPixelSize(R.dimen.smart_watch_2_control_height);
} else {
mWidth = context.getResources().getDimensionPixelSize(R.dimen.smart_watch_control_width);
mHeight = context.getResources().getDimensionPixelSize(R.dimen.smart_watch_control_height);
}
AccessorySensorManager manager = new AccessorySensorManager(context, hostAppPackageName);
// Add accelerometer, if supported by the host application.
if (DeviceInfoHelper.isSensorSupported(context, hostAppPackageName, SensorTypeValue.ACCELEROMETER)) {
mSensor = manager.getSensor(SensorTypeValue.ACCELEROMETER);
}
initializeMenus();
showDisplay();
}
示例2: onViewEvent
import com.sonyericsson.extras.liveware.extension.util.registration.DeviceInfoHelper; //导入方法依赖的package包/类
@Override
protected void onViewEvent(Intent intent) {
String action = intent.getStringExtra(Notification.Intents.EXTRA_ACTION);
String hostAppPackageName = intent
.getStringExtra(Registration.Intents.EXTRA_AHA_PACKAGE_NAME);
boolean advancedFeaturesSupported = DeviceInfoHelper.isSmartWatch2ApiAndScreenDetected(
this, hostAppPackageName);
int eventId = intent.getIntExtra(Notification.Intents.EXTRA_EVENT_ID, -1);
if (Notification.SourceColumns.ACTION_1.equals(action)) {
NotificationUtil.deleteAllEvents(this);
} else if (Notification.SourceColumns.ACTION_2.equals(action)) {
NotificationUtil.deleteAllEvents(this);
} else if (Notification.SourceColumns.ACTION_3.equals(action)) {
Toast.makeText(this, "Action 3", Toast.LENGTH_LONG).show();
}
}
示例3: createControlExtension
import com.sonyericsson.extras.liveware.extension.util.registration.DeviceInfoHelper; //导入方法依赖的package包/类
@Override
public ControlExtension createControlExtension(String hostAppPackageName) {
// First we check if the API level and screen size required for
// SampleControlSmartWatch2 is supported
boolean advancedFeaturesSupported = DeviceInfoHelper.
isSmartWatch2ApiAndScreenDetected(this, hostAppPackageName);
if (advancedFeaturesSupported) {
return new ControlSmartWatch2(
hostAppPackageName, this, new Handler());
} else {
// If not we return an API level 1 control based on screen size
throw new IllegalArgumentException("No control for: "
+ hostAppPackageName);
}
}
示例4: determineDisplaySize
import com.sonyericsson.extras.liveware.extension.util.registration.DeviceInfoHelper; //导入方法依赖的package包/类
/**
* 指定されたホストアプリケーションに対応するSWの画面サイズを返す.
*
* @param context コンテキスト
* @param hostAppPackageName ホストアプリケーション名(SW1orSW2)
* @return 画面サイズ
*/
private static DisplaySize determineDisplaySize(final Context context, final String hostAppPackageName) {
boolean smartWatch2Supported = DeviceInfoHelper.isSmartWatch2ApiAndScreenDetected(context, hostAppPackageName);
int width;
int height;
if (smartWatch2Supported) {
width = context.getResources().getDimensionPixelSize(R.dimen.smart_watch_2_control_width);
height = context.getResources().getDimensionPixelSize(R.dimen.smart_watch_2_control_height);
} else {
width = context.getResources().getDimensionPixelSize(R.dimen.smart_watch_control_width);
height = context.getResources().getDimensionPixelSize(R.dimen.smart_watch_control_height);
}
return new DisplaySize(width, height);
}
示例5: createControlExtension
import com.sonyericsson.extras.liveware.extension.util.registration.DeviceInfoHelper; //导入方法依赖的package包/类
@Override
public ControlExtension createControlExtension(String hostAppPackageName) {
// First we check if the API level and screen size required for
// SampleControlSmartWatch2 is supported
boolean advancedFeaturesSupported = DeviceInfoHelper.isSmartWatch2ApiAndScreenDetected(
this, hostAppPackageName);
if (advancedFeaturesSupported) {
return new SampleControlSmartWatch2(hostAppPackageName, this, new Handler());
}
throw new IllegalArgumentException("No control for: " + hostAppPackageName);
}
示例6: createControlExtension
import com.sonyericsson.extras.liveware.extension.util.registration.DeviceInfoHelper; //导入方法依赖的package包/类
@Override
public ControlExtension createControlExtension(String hostAppPackageName) {
// First we check if the host application API level and screen size
// is supported by the extension.
boolean advancedFeaturesSupported = DeviceInfoHelper.isSmartWatch2ApiAndScreenDetected(
this, hostAppPackageName);
if (advancedFeaturesSupported) {
return new ScreenControl(hostAppPackageName, this, new Handler());
} else {
throw new IllegalArgumentException("No control for: " + hostAppPackageName);
}
}
示例7: createControlExtension
import com.sonyericsson.extras.liveware.extension.util.registration.DeviceInfoHelper; //导入方法依赖的package包/类
@Override
public ControlExtension createControlExtension(String hostAppPackageName) {
if (!DeviceInfoHelper.isSmartWatch2ApiAndScreenDetected(this, hostAppPackageName))
throw new IllegalArgumentException("SmartWatch 2 not found");
return new SwControlFlow(hostAppPackageName);
}