ユーザーの携帯電話のギャラリーから写真を撮り、Android ウェアラブル ウォッチフェイスに変換するアプリを作成することは可能ですか?
私はこれらのAndroidの記事を読んでいます
https://developer.android.com/training/wearables/watch-faces/index.html
https://developer.android.com/training/wearables/watch-faces/drawing.html
ユーザーにギャラリーから画像を選択してビットマップに変換させることができれば、それをウォッチフェイスとして設定するのが妥当だと思われます。Android と APK に関して言えば、私は間違いなく初心者のプログラマーです。より高度な Android 開発者からの確認は素晴らしいことです。
私が混乱しているのは、ユーザーの電話で写真の選択が行われ、それが Android ウェアラブル アプリに送信されるか、またはウェアラブル アプリがユーザーの電話のギャラリーにアクセスして直接選択できるかどうかです。ウェアラブル アプリがユーザーの携帯電話のギャラリーにアクセスできるかどうか知っている人はいますか?
選択した画像の参照が既にあると仮定すると、次のようになりますか? 私が間違っている場合は修正してください。(「ウォッチフェイス要素の初期化」の 2 番目の記事から取得)
@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();
}
助けてくれてありがとう。