How to receive shared image and display it?

Apparently you are getting a different path on your device and this code will not work on other devices, as in my it already contains /storage/emulated/0

Secondly, I get error at app launch if I use only this bloks

Which type of error?
And what error did you get?

Try this:
PkgUtils (6).apk (5.0 MB)

And this is aia file:
PkgUtils.aia (35.2 KB)

1 Like

@vknow360

This perfectly works for me :smiley:


TBH, I am developing this app for myself.
Sometimes I capture a screenshot on my phone, just for sake, let’s consider it’s a screenshot of a Dribbble shot, featuring an app’s UI which I am interested in. Now, I want it to be opened on my PC’s chrome browser, to make myself able to view it side-by-side along with developing apps.

I came along an idea, which is very simple as follows -

  • First, capture screenshot, and open photo gallery.
  • Then tap “share” there, and choose my app.
  • The app would receive the image, and display it. Now the main process begins.
  • The image would be uploaded to Cloudinary, and it will return it’s URL.
  • The URL would be shortened with the help of bitly.com’s URL shortening API, and I will get the short URL to the image. (Thanks to @techyguyhelp’s amazing method :+1: )
  • Then I would open the URL in my chrome browser, and get the image :smiley:

Thanks a lot everyone! :blush:

P.S. I knew apps like this already existed, but I wanted to build one myself :cat:

1 Like

None of the approaches (“solutions”) presented here work on my test device.

Xiaomi Redmi Note 5 (Android 9):

grafik

1 Like

When I check this with my app:

I get this (path / URI):

And the image is displayed on the my device.

Hi, @bodymindpower! :wave:

Try this -

Thanks! :blush:

My App doesn’t need a timer to get the correct path and display the image.

Oh, Sorry I forgot to hide it :sweat_smile:

It is required in further processes of my app :sweat_smile:

Thanks! :blush:

1 Like

Hi @bodymindpower
What did you get as value???

1 Like

see the last screenshot above

There is something wrong in FileTools.
Can you try that with TaifunFile?

Here is my solution that runs on all (my) devices.
(Android 5, 7, 8, 9, 10).

Shared_image.apk (4.8 MB)

1 Like

And for your specific device, this should be the solution:

1 Like

I just noticed that I never posted this however, here you go

Probably because of this (two slashes)

it becomes this /storage/emulated/0//DCIM/Screenshots/20200229_10934.jpg

1 Like

What about my solution? Maybe some could check it on your / various devices.
I think it should work that way on all devices.

Mysterious notification bug is here also……@Boban

1 Like

Excuse me, can I receive (import) a specific data as a database that has been sent (shared-exported) from another application with these methods?

…only if it is in text format

Works on Android 10 (Pixel 3)

2 Likes