本文整理汇总了Java中com.sonyericsson.extras.liveware.aef.control.Control类的典型用法代码示例。如果您正苦于以下问题:Java Control类的具体用法?Java Control怎么用?Java Control使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Control类属于com.sonyericsson.extras.liveware.aef.control包,在下文中一共展示了Control类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: showImage
import com.sonyericsson.extras.liveware.aef.control.Control; //导入依赖的package包/类
/**
* Show an image on the accessory.
*
* @param resourceId The image resource id.
*/
protected void showImage(final int resourceId) {
if (Dbg.DEBUG) {
Dbg.d("showImage: " + resourceId);
}
Intent intent = new Intent();
intent.setAction(Control.Intents.CONTROL_DISPLAY_DATA_INTENT);
Bitmap bitmap = BitmapFactory.decodeResource(mContext.getResources(), resourceId,
mBitmapOptions);
ByteArrayOutputStream os = new ByteArrayOutputStream(256);
bitmap.compress(CompressFormat.PNG, 100, os);
byte[] buffer = os.toByteArray();
intent.putExtra(Control.Intents.EXTRA_DATA, buffer);
sendToHostApp(intent);
}
开发者ID:fbarriga,项目名称:sony-smartband-logger,代码行数:22,代码来源:ControlExtension.java
示例2: sendListItem
import com.sonyericsson.extras.liveware.aef.control.Control; //导入依赖的package包/类
/**
* Update a list item.
* @param item List item.
*/
protected void sendListItem(ControlListItem item) {
Intent intent = new Intent(Control.Intents.CONTROL_LIST_ITEM_INTENT);
intent.putExtra(Control.Intents.EXTRA_LAYOUT_REFERENCE, item.layoutReference);
intent.putExtra(Control.Intents.EXTRA_DATA_XML_LAYOUT, item.dataXmlLayout);
if (item.listItemId != -1) {
intent.putExtra(Control.Intents.EXTRA_LIST_ITEM_ID, item.listItemId);
}
if (item.listItemPosition != -1) {
intent.putExtra(Control.Intents.EXTRA_LIST_ITEM_POSITION, item.listItemPosition);
}
if (item.layoutData != null && item.layoutData.length > 0) {
intent.putExtra(Control.Intents.EXTRA_LAYOUT_DATA, item.layoutData);
}
sendToHostApp(intent);
}
开发者ID:asamm,项目名称:locus-addon-smartwatch2,代码行数:20,代码来源:ControlExtension.java
示例3: handleMessage
import com.sonyericsson.extras.liveware.aef.control.Control; //导入依赖的package包/类
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case Tunnel.Messages.TUNNEL_INTENT:
{
Intent intent = (Intent)msg.obj;
handleIntentFromHostApp(intent);
break;
}
case Tunnel.Messages.SETUP_MESSENGER:
{
Bundle b = msg.getData();
b.setClassLoader(getClassLoader());
String hostAppPkgName = b.getString(Control.Intents.EXTRA_AHA_PACKAGE_NAME);
mHostAppMessengers.put(hostAppPkgName, msg.replyTo);
Log.d(LOG_TAG, "Setup messenger.");
break;
}
default:
super.handleMessage(msg);
}
}
开发者ID:asamm,项目名称:locus-addon-smartwatch2,代码行数:26,代码来源:TunnelService.java
示例4: onStop
import com.sonyericsson.extras.liveware.aef.control.Control; //导入依赖的package包/类
@Override
public void onStop() {
super.onStop();
Logger.logD(TAG, "onStop()");
// disable receiver
PeriodicUpdatesReceiver.disableReceiver(mContext);
// clear instance
mInstance = null;
// disable screen state
setScreenState(Control.Intents.SCREEN_STATE_AUTO);
// store current values
SharedPreferences.Editor editor = mPrefs.edit();
editor.putInt(KEY_I_LAST_SCREEN_MODE, mScreenMode.ordinal());
editor.putInt(KEY_I_LAST_SCREEN_GUIDANCE_MODE, mGuidingMode.ordinal());
editor.commit();
}
开发者ID:asamm,项目名称:locus-addon-smartwatch2,代码行数:21,代码来源:ControlSmartWatch2.java
示例5: startCamera
import com.sonyericsson.extras.liveware.aef.control.Control; //导入依赖的package包/类
/**
* Initiates camera operation on the SmartEyeglass device, providing a file specification
* for saving
* captured image data.
*
* @param filePath Path of a file to which to save captured image data.
*/
public void startCamera(String filePath) throws ControlCameraException {
if (Dbg.DEBUG) {
Dbg.v("startCameraCapture");
}
if (mRecodingMode != SmartEyeglassControl.Intents.CAMERA_MODE_MOVIE_HIGH_RATE &&
mRecodingMode != SmartEyeglassControl.Intents.CAMERA_MODE_MOVIE_LOW_RATE &&
mRecodingMode != SmartEyeglassControl.Intents.CAMERA_MODE_STILL_TO_FILE) {
openSocket();
}
Intent intent = new Intent(SmartEyeglassControl.Intents.CONTROL_CAMERA_START_INTENT);
intent.putExtra(SmartEyeglassControl.Intents.EXTRA_CAMERA_VIDEO_SOCKET_NAME,
mCameraSocketName[0]);
if (filePath != null) {
intent.putExtra(Control.Intents.EXTRA_DATA_URI, filePath);
}
sendToHostApp(intent);
}
开发者ID:sonyxperiadev,项目名称:DroneControl,代码行数:26,代码来源:SmartEyeglassControlUtils.java
示例6: moveLowerLayer
import com.sonyericsson.extras.liveware.aef.control.Control; //导入依赖的package包/类
/**
* Transitions the screen display to the given bitmap using a built-in animation effect
* that looks like moving down to a lower layer.
* Display can take some time for a large image.
* If an image larger than the screen size,it is not displayed on the screen.<br>
* For screen size refer to
* {@link com.sony.smarteyeglass.SmartEyeglassControl.Intents#EXTRA_IMAGE_HEIGHT},
* {@link com.sony.smarteyeglass.SmartEyeglassControl.Intents#EXTRA_IMAGE_WIDTH}
*
* @param bitmap The new bitmap to show.
*/
public void moveLowerLayer(final Bitmap bitmap) {
if (Dbg.DEBUG) {
Dbg.d("showBitmap w/ animation");
}
byte[] buffer = EightBitMonochromeImageEncoder.convert(bitmap, 0, bitmap.getHeight());
Intent intent = new Intent(Control.Intents.CONTROL_DISPLAY_DATA_INTENT);
intent.putExtra(Control.Intents.EXTRA_DATA, buffer);
// since raw format then other side do not know width or height
intent.putExtra(SmartEyeglassControl.Intents.EXTRA_IMAGE_HEIGHT, bitmap.getHeight());
// since raw format then other side do not know width or height
intent.putExtra(SmartEyeglassControl.Intents.EXTRA_IMAGE_WIDTH, bitmap.getWidth());
intent.putExtra(SmartEyeglassControl.Intents.EXTRA_DATA_IS_RAW_FORMAT,
1); // SmartEyeglass raw format
intent.putExtra(SmartEyeglassControl.Intents.EXTRA_LAYER_TRANSITION_EFFECT_TYPE,
SmartEyeglassControl.Intents.LAYER_TRANSITION_MOVE_LOWER_LAYER);
sendToHostApp(intent);
}
开发者ID:sonyxperiadev,项目名称:DroneControl,代码行数:30,代码来源:SmartEyeglassControlUtils.java
示例7: moveUpperLayer
import com.sonyericsson.extras.liveware.aef.control.Control; //导入依赖的package包/类
/**
* Transitions the screen display to the given bitmap using a built-in animation effect
* that looks like moving up to a higher layer.
* Display can take some time for a large image.
* If an image larger than the screen size,it is not displayed on the screen.<br>
* For screen size refer to
* {@link com.sony.smarteyeglass.SmartEyeglassControl.Intents#EXTRA_IMAGE_HEIGHT},
* {@link com.sony.smarteyeglass.SmartEyeglassControl.Intents#EXTRA_IMAGE_WIDTH}
*
* @param bitmap The new bitmap to show.
*/
public void moveUpperLayer(final Bitmap bitmap) {
if (Dbg.DEBUG) {
Dbg.d("showBitmap w/ animation");
}
byte[] buffer = EightBitMonochromeImageEncoder.convert(bitmap, 0, bitmap.getHeight());
Intent intent = new Intent(Control.Intents.CONTROL_DISPLAY_DATA_INTENT);
intent.putExtra(Control.Intents.EXTRA_DATA, buffer);
// since raw format then other side do not know width or height
intent.putExtra(SmartEyeglassControl.Intents.EXTRA_IMAGE_HEIGHT, bitmap.getHeight());
// since raw format then other side do not know width or height
intent.putExtra(SmartEyeglassControl.Intents.EXTRA_IMAGE_WIDTH, bitmap.getWidth());
intent.putExtra(SmartEyeglassControl.Intents.EXTRA_DATA_IS_RAW_FORMAT, 1); //
// SmartEyeglass raw format
intent.putExtra(SmartEyeglassControl.Intents.EXTRA_LAYER_TRANSITION_EFFECT_TYPE,
SmartEyeglassControl.Intents.LAYER_TRANSITION_MOVE_UPPER_LAYER);
sendToHostApp(intent);
}
开发者ID:sonyxperiadev,项目名称:DroneControl,代码行数:30,代码来源:SmartEyeglassControlUtils.java
示例8: showImage
import com.sonyericsson.extras.liveware.aef.control.Control; //导入依赖的package包/类
/**
* Show an image on the accessory.
*
* @param resourceId The image resource id.
*/
protected void showImage(final int resourceId) {
if (Dbg.DEBUG) {
Dbg.d("showImage: " + resourceId);
}
Intent intent = new Intent();
intent.setAction(Control.Intents.CONTROL_DISPLAY_DATA_INTENT);
Bitmap bitmap = BitmapFactory
.decodeResource(mContext.getResources(), resourceId, mBitmapOptions);
ByteArrayOutputStream os = new ByteArrayOutputStream(256);
bitmap.compress(CompressFormat.PNG, 100, os);
byte[] buffer = os.toByteArray();
intent.putExtra(Control.Intents.EXTRA_DATA, buffer);
sendToHostApp(intent);
}
开发者ID:sonyxperiadev,项目名称:DroneControl,代码行数:22,代码来源:ControlExtension.java
示例9: sendListItem
import com.sonyericsson.extras.liveware.aef.control.Control; //导入依赖的package包/类
/**
* Update a list item.
*
* @param item List item.
*/
protected void sendListItem(ControlListItem item) {
Intent intent = new Intent(Control.Intents.CONTROL_LIST_ITEM_INTENT);
intent.putExtra(Control.Intents.EXTRA_LAYOUT_REFERENCE, item.layoutReference);
intent.putExtra(Control.Intents.EXTRA_DATA_XML_LAYOUT, item.dataXmlLayout);
if (item.listItemId != -1) {
intent.putExtra(Control.Intents.EXTRA_LIST_ITEM_ID, item.listItemId);
}
if (item.listItemPosition != -1) {
intent.putExtra(Control.Intents.EXTRA_LIST_ITEM_POSITION, item.listItemPosition);
}
if (item.layoutData != null && item.layoutData.length > 0) {
intent.putExtra(Control.Intents.EXTRA_LAYOUT_DATA, item.layoutData);
}
sendToHostApp(intent);
}
开发者ID:sonyxperiadev,项目名称:DroneControl,代码行数:21,代码来源:ControlExtension.java
示例10: sendToHostApp
import com.sonyericsson.extras.liveware.aef.control.Control; //导入依赖的package包/类
/**
* Send intent to host application. Adds host application package name and
* our package name.
*
* @param context a context
* @param hostPkgName package name of the host app
* @param intent The intent to send.
*/
public static void sendToHostApp(Context context, String hostPkgName, Intent intent) {
boolean whiteListed = false;
try {
PackageInfo packageInfo = context.getPackageManager().getPackageInfo(hostPkgName,
PackageManager.GET_SIGNATURES);
Signature[] signatures = packageInfo.signatures;
whiteListed = WhiteList.exists(hostPkgName, signatures[0]);
} catch (NameNotFoundException e) {
Dbg.e("No package info for host app", e);
return;
}
intent.putExtra(Control.Intents.EXTRA_AEA_PACKAGE_NAME, context.getPackageName());
intent.setPackage(hostPkgName);
if (whiteListed) {
context.sendBroadcast(intent);
} else {
context.sendBroadcast(intent, Registration.HOSTAPP_PERMISSION);
}
}
开发者ID:jphacks,项目名称:KB_1511,代码行数:28,代码来源:ExtensionUtils.java
示例11: startCamera
import com.sonyericsson.extras.liveware.aef.control.Control; //导入依赖的package包/类
/**
* Initiates camera operation on the SmartEyeglass device, providing a file specification for saving
* captured image data.
*
* @param filePath Path of a file to which to save captured image data.
*/
public void startCamera(String filePath) throws ControlCameraException {
if (Dbg.DEBUG) {
Dbg.v("startCameraCapture");
}
if (mRecodingMode == INVALID_CAMERA_MODE) {
throw new IllegalArgumentException("Camera mode has not been set. Please call method setCameraMode().");
}
if (mRecodingMode != SmartEyeglassControl.Intents.CAMERA_MODE_STILL_TO_FILE) {
openSocket();
}
Intent intent = new Intent(SmartEyeglassControl.Intents.CONTROL_CAMERA_START_INTENT);
intent.putExtra(SmartEyeglassControl.Intents.EXTRA_CAMERA_VIDEO_SOCKET_NAME, mCameraSocketName[0]);
if (filePath != null) {
intent.putExtra(Control.Intents.EXTRA_DATA_URI, filePath);
}
sendToHostApp(intent);
}
开发者ID:jphacks,项目名称:KB_1511,代码行数:28,代码来源:SmartEyeglassControlUtils.java
示例12: moveLowerLayer
import com.sonyericsson.extras.liveware.aef.control.Control; //导入依赖的package包/类
/**
* Transitions the screen display to the given bitmap using a built-in animation effect
* that looks like moving down to a lower layer.
* Display can take some time for a large image.
* If an image larger than the screen size,it is not displayed on the screen.<br>
* For screen size refer to
* {@link com.sony.smarteyeglass.SmartEyeglassControl.Intents#EXTRA_IMAGE_HEIGHT},
* {@link com.sony.smarteyeglass.SmartEyeglassControl.Intents#EXTRA_IMAGE_WIDTH}
*
* @param bitmap The new bitmap to show.
*/
public void moveLowerLayer(final Bitmap bitmap) {
if (Dbg.DEBUG) {
Dbg.d("showBitmap w/ animation");
}
byte[] buffer = EightBitMonochromeImageEncoder.convert(bitmap, 0, bitmap.getHeight());
Intent intent = new Intent(Control.Intents.CONTROL_DISPLAY_DATA_INTENT);
intent.putExtra(Control.Intents.EXTRA_DATA, buffer);
// since raw format then other side do not know width or height
intent.putExtra(SmartEyeglassControl.Intents.EXTRA_IMAGE_HEIGHT, bitmap.getHeight());
// since raw format then other side do not know width or height
intent.putExtra(SmartEyeglassControl.Intents.EXTRA_IMAGE_WIDTH, bitmap.getWidth());
intent.putExtra(SmartEyeglassControl.Intents.EXTRA_DATA_IS_RAW_FORMAT, 1); // SmartEyeglass raw format
intent.putExtra(SmartEyeglassControl.Intents.EXTRA_LAYER_TRANSITION_EFFECT_TYPE,
SmartEyeglassControl.Intents.LAYER_TRANSITION_MOVE_LOWER_LAYER);
sendToHostApp(intent);
}
开发者ID:jphacks,项目名称:KB_1511,代码行数:29,代码来源:SmartEyeglassControlUtils.java
示例13: moveUpperLayer
import com.sonyericsson.extras.liveware.aef.control.Control; //导入依赖的package包/类
/**
* Transitions the screen display to the given bitmap using a built-in animation effect
* that looks like moving up to a higher layer.
* Display can take some time for a large image.
* If an image larger than the screen size,it is not displayed on the screen.<br>
* For screen size refer to
* {@link com.sony.smarteyeglass.SmartEyeglassControl.Intents#EXTRA_IMAGE_HEIGHT},
* {@link com.sony.smarteyeglass.SmartEyeglassControl.Intents#EXTRA_IMAGE_WIDTH}
*
* @param bitmap The new bitmap to show.
*/
public void moveUpperLayer(final Bitmap bitmap) {
if (Dbg.DEBUG) {
Dbg.d("showBitmap w/ animation");
}
byte[] buffer = EightBitMonochromeImageEncoder.convert(bitmap, 0, bitmap.getHeight());
Intent intent = new Intent(Control.Intents.CONTROL_DISPLAY_DATA_INTENT);
intent.putExtra(Control.Intents.EXTRA_DATA, buffer);
// since raw format then other side do not know width or height
intent.putExtra(SmartEyeglassControl.Intents.EXTRA_IMAGE_HEIGHT, bitmap.getHeight());
// since raw format then other side do not know width or height
intent.putExtra(SmartEyeglassControl.Intents.EXTRA_IMAGE_WIDTH, bitmap.getWidth());
intent.putExtra(SmartEyeglassControl.Intents.EXTRA_DATA_IS_RAW_FORMAT, 1); // SmartEyeglass raw format
intent.putExtra(SmartEyeglassControl.Intents.EXTRA_LAYER_TRANSITION_EFFECT_TYPE,
SmartEyeglassControl.Intents.LAYER_TRANSITION_MOVE_UPPER_LAYER);
sendToHostApp(intent);
}
开发者ID:jphacks,项目名称:KB_1511,代码行数:29,代码来源:SmartEyeglassControlUtils.java
示例14: startRequest
import com.sonyericsson.extras.liveware.aef.control.Control; //导入依赖的package包/类
/**
* Send request to start to host application.
*/
protected void startRequest() {
if (Dbg.DEBUG) {
Dbg.d("Sending start request");
}
Intent intent = new Intent(Control.Intents.CONTROL_START_REQUEST_INTENT);
sendToHostApp(intent);
}
开发者ID:fbarriga,项目名称:sony-smartband-logger,代码行数:11,代码来源:ControlExtension.java
示例15: stopRequest
import com.sonyericsson.extras.liveware.aef.control.Control; //导入依赖的package包/类
/**
* Send request to stop to host application.
*/
protected void stopRequest() {
if (Dbg.DEBUG) {
Dbg.d("Sending stop request");
}
Intent intent = new Intent(Control.Intents.CONTROL_STOP_REQUEST_INTENT);
sendToHostApp(intent);
}
开发者ID:fbarriga,项目名称:sony-smartband-logger,代码行数:11,代码来源:ControlExtension.java
示例16: showBitmap
import com.sonyericsson.extras.liveware.aef.control.Control; //导入依赖的package包/类
/**
* Show bitmap on accessory.
*
* @param bitmap The bitmap to show.
*/
protected void showBitmap(final Bitmap bitmap) {
if (Dbg.DEBUG) {
Dbg.d("showBitmap");
}
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(256);
bitmap.compress(CompressFormat.PNG, 100, outputStream);
Intent intent = new Intent(Control.Intents.CONTROL_DISPLAY_DATA_INTENT);
intent.putExtra(Control.Intents.EXTRA_DATA, outputStream.toByteArray());
sendToHostApp(intent);
}
开发者ID:fbarriga,项目名称:sony-smartband-logger,代码行数:18,代码来源:ControlExtension.java
示例17: startVibrator
import com.sonyericsson.extras.liveware.aef.control.Control; //导入依赖的package包/类
/**
* Start repeating vibrator
*
* @param onDuration On duration in milliseconds.
* @param offDuration Off duration in milliseconds.
* @param repeats The number of repeats of the on/off pattern. Use
* {@link Control.Intents#REPEAT_UNTIL_STOP_INTENT} to repeat
* until explicitly stopped.
*/
protected void startVibrator(int onDuration, int offDuration, int repeats) {
if (Dbg.DEBUG) {
Dbg.v("startVibrator: onDuration: " + onDuration + ", offDuration: " + offDuration
+ ", repeats: " + repeats);
}
Intent intent = new Intent(Control.Intents.CONTROL_VIBRATE_INTENT);
intent.putExtra(Control.Intents.EXTRA_ON_DURATION, onDuration);
intent.putExtra(Control.Intents.EXTRA_OFF_DURATION, offDuration);
intent.putExtra(Control.Intents.EXTRA_REPEATS, repeats);
sendToHostApp(intent);
}
开发者ID:fbarriga,项目名称:sony-smartband-logger,代码行数:21,代码来源:ControlExtension.java
示例18: stopVibrator
import com.sonyericsson.extras.liveware.aef.control.Control; //导入依赖的package包/类
/**
* Stop vibrator.
*/
protected void stopVibrator() {
if (Dbg.DEBUG) {
Dbg.v("Vibrator stop");
}
Intent intent = new Intent(Control.Intents.CONTROL_STOP_VIBRATE_INTENT);
sendToHostApp(intent);
}
开发者ID:fbarriga,项目名称:sony-smartband-logger,代码行数:11,代码来源:ControlExtension.java
示例19: startLedPattern
import com.sonyericsson.extras.liveware.aef.control.Control; //导入依赖的package包/类
/**
* Start a LED pattern.
*
* @param id Id of the LED to be controlled.
* @param color Color you want the LED to blink with.
* @param onDuration On duration in milliseconds.
* @param offDuration Off duration in milliseconds.
* @param repeats The number of repeats of the on/off pattern. Use
* {@link Control.Intents#REPEAT_UNTIL_STOP_INTENT} to repeat
* until explicitly stopped.
*
*/
protected void startLedPattern(int id, int color, int onDuration, int offDuration, int repeats) {
if (Dbg.DEBUG) {
Dbg.v("startLedPattern: id: " + id + ", color: " + color + "onDuration: " + onDuration
+ ", offDuration: " + offDuration + ", repeats: " + repeats);
}
Intent intent = new Intent(Control.Intents.CONTROL_LED_INTENT);
intent.putExtra(Control.Intents.EXTRA_LED_ID, id);
intent.putExtra(Control.Intents.EXTRA_LED_COLOR, color);
intent.putExtra(Control.Intents.EXTRA_ON_DURATION, onDuration);
intent.putExtra(Control.Intents.EXTRA_OFF_DURATION, offDuration);
intent.putExtra(Control.Intents.EXTRA_REPEATS, repeats);
sendToHostApp(intent);
}
开发者ID:fbarriga,项目名称:sony-smartband-logger,代码行数:26,代码来源:ControlExtension.java
示例20: stopLedPattern
import com.sonyericsson.extras.liveware.aef.control.Control; //导入依赖的package包/类
/**
* Turn led off
*
* @param id Id of the LED to be controlled.
*/
protected void stopLedPattern(int id) {
if (Dbg.DEBUG) {
Dbg.v("stopLedPattern: id: " + id);
}
Intent intent = new Intent(Control.Intents.CONTROL_LED_INTENT);
intent.putExtra(Control.Intents.EXTRA_LED_ID, id);
sendToHostApp(intent);
}
开发者ID:fbarriga,项目名称:sony-smartband-logger,代码行数:14,代码来源:ControlExtension.java
注:本文中的com.sonyericsson.extras.liveware.aef.control.Control类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论