Share a Photo On a Web-Service And Get The Public URL? - java

I want to build an app in which the user chooses a gallery photo.
It then
uses "share via" to upload the photo from my device to any other 3rd party application that hosts files on the server.
then it saves the hoting url. Adds it to a UI list.
Are there any apps that retrieve the posting public url after the post is done - so I can use it in my app ?

Related

Simple image and audio upload being blocked firebase

I am making a music streaming app and I am able to retrieve data from the database to play a song and display the metadata but when I try to upload a song from my emulator it says I do not have permission. My rules are defined as public and I have connected my app to firebase. I even generated a SHA-1 key for the app and synced it to firebase but am stuck with the same error. Do I need to include authentication to remotely upload? Any help is appreciated
here are the rules for my firebase storage

Upload images added to gallery to aws s3 folder automatically from background

I have an android application which have integrated with aws cognito(user and identity pools) and aws s3.Sign up and sign in features are working fine and after signing in user can view the images in s3 bucket related to his/her folder in s3 bucket. When user is signing in a directory in s3 bucket is created.Currently images should be uploaded to the relevant folder manually through the aws s3 console.
Now what I want to do is, when new images are added to the gallery(through camera or downloaded from somewhere) it should be uploaded to the user's relevant folder automatically even when the app is closed(similar like google photos app).
I don't know is there a method in android to get notified when new image(s) added to the gallery and get that image.(I don't want to delete the image in the s3 when an image is deleted in gallery)
And if notified can it be uploaded to the s3 bucket from background since in a token expiry situation user have to sign in again(as I know)?
What I want to know is, is this task possible to do?
If possible what is the preferred solution and basic steps I should follow to solve my problem?

Google Photos API - a permanent url to an uploaded item for static content

I'm trying to refactor a Java application using the Picasa Web Albums API
to using the new Google Photos api.
In Picasa API you had the PhotoEntry object, which represented the uploaded entity
and one could access the URL to the uploaded image as follows:
photoEntry.getMediaThumbnails().get(0).getUrl();
This url could be used in a website as static content.
Currently I'm at a loss how to get a permanent url to an uploaded image
with Google Photos API.
There is the MediaItem object, which represents an uploaded image,
but I can't figure out how to get a permanent url from it.
I find 2 types of url in the MediaItem API:
mediaItem.getBaseUrl()
This url expires after 60 minutes and
mediaItem.getProductUrl()
cannot be used for static content, since it requires to be logged in.
Anybody can tell me what I overlooked ?
Thanks
Regards
The Google Photos Library API is not designed for image hosting. If you'd like to embed images in another site, you may need to look at other hosting solutions, like Google Cloud Storage, Firebase Cloud Storage or similar.
You are correct, base URLs expire after 60 minutes and need to be refreshed. However, if you need a permanent URL to a media item that points to Google Photos, you can create a new album, share it and use the shareableURL that's returned as part of the shareInfo property. This URL is accessible without sign in and opens the shared album in Google Photos. You can find out more in the share media developer guide.

Share file to all user using an app

I am stuck on how to share a file to all user who is using the app I m currently implementing for my FYP. I know I can share file to social media, email, etc. SO is it possible to share file to all user who use my app? I m using firebase as my Database and Android Studio for my implementation.
Upload file to server and give that link to the users..
firebase file upload Clickhere

Store files in google drive from Google App Engine

All,
I have a google application engine (java) that requires to store some images. I tried using Blobs and storing them in datastore but as you know there is a size limit on data that can be stored in datastore.
So as result I'm storing the images on a different server and store the path in my datastore and all works fine.
Now I'm thinking on using a google drive folder instead of using a server to upload the files to the drive and using the share link to display them later.
I've seen https://developers.google.com/drive/web/quickstart/java and got it to work fine. When I try to use it in my application however obviously this won't work as the code is assuming a credential for a local user.
I created a service key on my application and want to change the sample code above to use it but I'm not sure if that's the correct approach.
Tried searching for samples but can't find anyone that takes the same approach. Is there a working sample that shows how to authenticate an application not a user and let's say store a file in google drive?
I've also seen https://developers.google.com/drive/web/examples/ please note what I want is to store files in my google drive and not the user's google drive. So if user A and user B come to my app, they shouldn't have to authorize my application and should both be able to upload a file to my google drive.
I don't know if this can be done directly from their browser or I have to move the file to my application (appspot) and then push it to google drive.
Thanks

Categories