Android Question Google Photos

adriano.freitas

Active Member
Is there the possibility of using the application made in B4A to allow the user to select a photo from Google Photos and store a reference to this photo, re-displaying it at certain times? If so, could someone help me with an example?

Working with Google APIs (Drive, Photos etc) has been very complicated for me, as I've always worked with other types of technology, I still haven't been able to familiarize myself with handling these APIs. I'll even make another post about Google Drive. I am extremely confused. If anyone can help I will be very grateful.
 

adriano.freitas

Active Member
Hi!

Very grateful for the attention and quick response!

The point is that in the application in question, if you may have to reference hundreds or even thousands of photos, then I want to avoid swelling the database and even the device storage to the maximum.

So I thought about taking advantage of the google photos storage and just referencing the images in the app. Always using google photos to re-exhibit.

Some suggestion?
 
Upvote 0

adriano.freitas

Active Member
Hello,

Even looking for a different solution, I tried as you said, copying or opening the image with ContentChoose, but an error occurs when I try. The error is what I copy below:

Error occurred on line: 18246 (Main)
java.lang.SecurityException: Permission Denial: opening provider com.google.android.apps.photos.contentprovider.impl.MediaContentProvider from ProcessRecord{20359da 4694:b4a.af.treebasepremium/u0a242} (pid=4694, uid=10242) that is not exported from UID 10197
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
contentchooser will let the user select photos from her google photos storage (in the cloud). the only way you can use a rest api is if you know the name of the resource. you would use okhttputils2 to make the request.

did you actually try contentchooser? it is so simple to use, you will look like a programming genius when you show it to your friends:)
 
Upvote 0

adriano.freitas

Active Member
Hi!

I can use the content chooser, however, what I need is to store in the base only a reference to the photo stored in Google Photos. When necessary, using this reference to be able to display it, without having to store these photos on the device (since there will be many).
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
It has nothing to do with OkHttpUtils2.

Even looking for a different solution, I tried as you said, copying or opening the image with ContentChoose, but an error occurs when I try. The error is what I copy below:
Please post the relevant code.

I can use the content chooser, however, what I need is to store in the base only a reference to the photo stored in Google Photos. When necessary, using this reference to be able to display it, without having to store these photos on the device (since there will be many).
It is not possible unless you gain access to Google Photos using OAuth2 and the specific API.
 
Upvote 0

adriano.freitas

Active Member
Hi.

The question is just that. I'm really confused by the use of these Google APIs. Both from Google Photos and Google Drive.

Hence the question, I wanted to see if anyone can help me with any examples. (I made a similar post about Google Drive too, because it's really hard for me...)

For the error, in fact I'm not even worried about posting and asking for a lot of help about it because I actually did it just to test it, it's not what I need, what I need is access to Google Photos as I said.

Thanks!
 
Upvote 0
Top