How to download data from Firebase Realtime Database to device storage - kotlin

I have a recyclerview that displays images from my Firebase Realtime database storage. I've attached a button to the recyclerview.
When users click the download button. I want my app to download that specific image from Firebase into their devices storage. How would I go about this? I've never downloaded from Firebase before, so I could really use some help.

Related

How to customize the main store listing in the google console?

I have question is their way to customize the main store listing? I want to remove the table requirements because the app want to apply on the phone devices not in the tablet devices.
I read some articles or post that I need to go this section in the google console.
Reach and devices -> Device Catalog
You can limit your app to Phones only from the app manifest for more on this see this answer.
for Google Play store listing, you can add 1 screenshot for each tablet size using a phone screen shot, in that way you will only target phones.
the problem with "Device Catalog" approach that you will need to do this every time new devices were added to google play console which is very hard to do.

disable auto download of files in react native video

I am using react-native-video to stream video in my app. The video starts with paused state.
From onLoadStart and onLoad event i see the video is started to load automatically even though it is paused. These videos are fetched from an URL, not in the assets of the app.
When i have multiple files in one screen it will take too much space in mobile. I want to keep space taken to minimal.
So i want to load files only if it is played by user by clicking the play button.
Is there a way to specify not to autoload files?

How can i upload an image if i'm navigating to a different component

I am working on a react native application where i an upload image button in the Upload screen and during the upload process if i navigate back to the previous screen the upload process is stopped but i would want to upload the image in background of the app.
I am sure where to start trying this.
how will i approach this problem. Is there is any package i could use, i am even persisting data in redux store after the image is uploaded so is there a way i can use redux to upload the image.
One way of doing would be.
You can show uploading indicator while uploading and then return promise to navigate whatever the page you want.

How to make Chrome on Android launch my image picker rather than the system UI's in React Native?

My app is a custom image picker written in React Native using Expo, that lets a user select a particular image for uploading. When a user presses an Upload button in any third-part Web page, I want my app to open rather than the standard Android file picker dialog.
Is this possible? I'm only interested in Android at the moment. I've looked at Expo's ImagePicker, but this launches the standard Android System UI in response to a call from an app. In contrast, I need my app to open, not ImagePicker, in response to a user's click on a file upload button in a Web page.
ContentProviders looks like a promising approach, but I can't see how to use it in Expo, and I'm not sure if this is the right approach anyway.
Intents all seem to load the standard system UI image picker.
Is what I want possible, and if so, what approach should I use to achieve it?

Can I put a live photo into the iOS Simulator?

I want to create an app to display a live photo. But I don't have an iPhone 6S. Is there a opportunity to put a live photo into the iOS Simulator?
Thanks!
The interface has improved greatly since this was originally asked/answered. It's now very easy to do this.
Go to Photos App and find the LivePhoto(s) you want to put on your (simulated) device.
Select the photo(s), go to File-> Export-> Export Unmodified Original For n Photo....
The saved files will be exported to your Desktop. There will be two files for each LivePhoto.
Drag both files (for each live photo) onto the simulator device.
LivePhotos are created and automatically placed in your simulated device's photo gallery.
Original Answer:
This is how I did it. Using the PhotosUI interface, my app asks for a LivePhoto. Using the PHAsset it gives me, I save a local copy of the .mov file and the high quality .png image. These two files are the "LivePhoto".
In Xcode, I go to Devices with my phone connected, select the app, click on the settings cog icon at the bottom and select download container. Go to Finder, right click on the .xcappdata file I just downloaded, select ShowPackageContents and the files are where I wrote them. I drag them into the app (Xcode is open - drop them on the navigator pane on the left), and they will be added to the app's bundle.
It is possible to put live photo into simulator, You need a video file, and an image file (because a Live photo is a combination of these two). And then using Photos Framework, you can save the live photo in gallery
PHPhotoLibrary.shared().performChanges({
let request = PHAssetCreationRequest.forAsset()
request.addResource(with: .photo, fileURL: imageUrl, options: nil)
request.addResource(with: .pairedVideo, fileURL: videoUrl, options: nil)
}) { (success, error) in
print(success)
print(error?.localizedDescription ?? "error")
}
The only way I've found is pretty clumsy: Get a live photo into your iCloud photo stream, then connect your simulator to your iCloud account. The live photos will then be available in your simulator's photo library.
As you might expect, the "get a live photo..." step can be tricky--you may need a friend with an iPhone 6s/6s+ to iMessage you one. Although some services like Facebook and Google Photos support Live Photo viewing in-app, they don't appear to support downloading them to your Photo Library while retaining their live-ness.