Requesting wear os Photo gallery to pick photo

I am developing a app which needs to picks photo, I have seen photos watchface to choose photo from gallery, I want to achieve something like that , I am starting the activity like this

Intent(“com.samsung.android.gallery.watch.SEC_PICK_CROP”)
.setType(“image/*”)
.apply {
startActivityForResult(this, REQUEST)
}

And tring to get the result like this

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (requestCode==REQUEST){
if (resultCode== RESULT_OK){
val image = ImageDecoder.decodeBitmap(
ImageDecoder.createSource(
contentResolver, data!!.data!!
)
).scale(450, 450)
saveBitmap(image, EXTRA_NORMAL_BACKGROUND)
saveBitmap(blurbitmap(image), EXTRA_BLUR_BACKGROUND)
onResume()
}
}
super.onActivityResult(requestCode, resultCode, data)
}

This code starts the activity but after selecting picture a toast shows “unable to save cropped picture”
Any idea how to choose picture?

This is not a Samsung Tools or SDK question and should be asked in a Android or Wear Developer forum. I assume this is Wear from your scale size.

Galaxy Watch6 image size is 480 x 480 that might be the reason you get the error but only a guess on my part. :slight_smile:

Ron
Samsung Developer Relations

I am using Samsung galaxy watch 4

Bad guess on my part. Did you try the Reddit Wear Developer community?

Ron
Samsung Developer Relations

I did no one answered

@rohitpaul20112

Try this documentation for photo picker with Jet Pack that is the best I can come up with.

This isn’t the right forum for Android Wear issues. I will have to close the topic soon

Ron
Samsung Developer Relations

Doesn’t work on wear os , Samsung’s gallery is only choice but idk about the way to get result

@amoledwatchfaces may help shed some light.
He has a photo complication that you can used and when u select that as the complication it allow u to push photos into the watch face.

From watch or phone is needed?

Hi. You need to request proper permissions (MEDIA_STORAGE) to access watch internal storage / photos.
Be sure to follow API 33+ specific documentation as all GWs are now running Wear OS 4.

Grant partial access to photos and videos | Android Developers

You will also need to handle this in your own “Gallery-like” activity. (maybe use Coil?)

Tomas

Okay thanks, that means there’s no way to use galaxy watch gallery app I guess