是否可以制作一个应用程序,从用户手机的图库中拍照并将其转换为安卓可穿戴表盘?
我一直在阅读这些 Android 文章
https://developer.android.com/training/wearables/watch-faces/index.html
https://developer.android.com/training/wearables/watch-faces/drawing.html
如果我可以让用户从图库中选择一张图片并将其转换为位图,那么将其设置为表盘似乎是合理的。当谈到 Android 和 apks 时,我绝对是一个初学者程序员。来自更高级的 Android 开发人员的确认会很棒。
现在我感到困惑的是,是否会在用户的手机上选择图片并将其发送到 android 可穿戴应用程序,或者可穿戴应用程序是否能够访问用户手机的图库并直接选择它。有谁知道可穿戴应用程序是否可以访问用户手机的图库?
假设我已经选择了图像的参考,它会是这样的吗?如我错了请纠正我。(取自“初始化表盘元素”下的第二篇文章
@Override
public void onCreate(SurfaceHolder holder) {
super.onCreate(holder);
// configure the system UI (see next section)
...
// load the background image
Resources resources = AnalogWatchFaceService.this.getResources();
//at this point the user should have already picked the picture they want
//so set "backgroundDrawable" to the image the user picture
int idOfUserSelectPicture = GetIdOfUserSelectedPictureSomehow();
Drawable backgroundDrawable = resources.getDrawable(idOfUserSelectPicture, null);
//original implementation from article
//Drawable backgroundDrawable = resources.getDrawable(R.drawable.bg, null);
mBackgroundBitmap = ((BitmapDrawable) backgroundDrawable).getBitmap();
// create graphic styles
mHourPaint = new Paint();
mHourPaint.setARGB(255, 200, 200, 200);
mHourPaint.setStrokeWidth(5.0f);
mHourPaint.setAntiAlias(true);
mHourPaint.setStrokeCap(Paint.Cap.ROUND);
...
// allocate a Calendar to calculate local time using the UTC time and time zone
mCalendar = Calendar.getInstance();
}
感谢您的任何帮助。