Android app cannot share photo with LeiaPlayer

Lumepad 2 and 1: I wrote an Android app that saves a SBS stereo photo in an internal storage subfolder of Pictures and adds the suffix of _2x1.jpg. When I try to share it to LeiaPlayer from the app using Intents, it launches Leia Player but only shows the “Open From External App - Camera Roll”, which is not where the saved photo was stored, nor is it present there. And when I click on any photo in camera roll, LeiaPlayer returns immediately to my app, showing nothing.

When I share as before to the SView Image Viewer app (3D) on the LumePad, it is able to load the photo and display as anaglyph. Why can’t LeiaPlayer do the same, showing the SBS image as 3D in its native mode given _2x1 suffix?

Also other camera apps (not 3D) on the Lumepads , like Open Camera do not show a shareable app for LeiaPlayer only other 2D photo viewers. I should be able to share any camera app photo file with LeiaPlayer.

It would be very helpful for Leia Player to show 3D images that are generated by other apps , not just camera apps, but apps that produce generative images for 3D viewing. Thanks for your help with this.

It can do this already. Try using an app like “File Manager” which ships with the device and tap “Open with LeiaPlayer” when you select a 3D file in it, it should work perfectly and load in 3D.

Thus, I think the configuration in the other apps including yours isn’t conforming to what Android expects today.

Thanks Nima for informing me about the “FileManager” app. It did not exist on the Lume Pad version 1, so I guess it must be new on version 2. It worked perfectly giving exactly the functionality I expected to view an image in another app.

I also have Google’s latest version of “Files” on Lume Pad 2 and when I use it instead of “FileManager”, the image is not seen by LeiaPlayer acting the same as with other apps I tried to use to share a photo with LeiaPlayer.

My conclusion is LeiaPlayer is doing something different when it gets an image reference (intent) from other apps except its own FileManager.

Could you please ask your developers what is going on?

For reference here is the share method I used in java (for Processing.org IDE java mode):
void shareImage(String path) {
if (DEBUG) println("shareImage: "+path);
if (path == null) return;
// Create a Uri from the file path
File newFile = new File(path);
Uri contentUri = FileProvider.getUriForFile(getContext(), BuildConfig.APPLICATION_ID + “.fileprovider”, newFile);
// Now you can use the contentUri to share the file with another app
// Create a share intent
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM, contentUri);
shareIntent.setType(“image/jpeg”);
shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
// Start the share intent
startActivity(Intent.createChooser(shareIntent, “Share Image”));
}

I assure you no work was done to support the File Manager app. It was added to the firmware in the last firmware update and it “just worked”, same with 3rd party apps like Nova Player. We’re not planning on doing additional work to support other apps, but if an app conforms to what’s expected it will work with LeiaPlayer.

I dug further into Google’s Intent documentation and found the error in my Intent request setup. Thanks for your help Nima.

Here is the function that starts LeiaPlayer with an image file reference:

void shareImage(String path) {
if (DEBUG) println("shareImage: "+path);
if (path == null) return;
// Create a Uri from the file path
File newFile = new File(path);
Uri contentUri = FileProvider.getUriForFile(getContext(), BuildConfig.APPLICATION_ID + “.fileprovider”, newFile);
// Now you can use the contentUri to share the file with another app
// Create a share intent
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_VIEW);
shareIntent.setDataAndType(contentUri, “image/*”);
shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
// Start the share intent
startActivity(shareIntent);
}

Hi Nima,
When LeiaPlayer is launched via a share, I found that LeiaPlayer does not permit other image files in the same album to be seen, only the one requested with the share. It would be very helpful to be able to swipe forward and backward to see all the images in a shared album folder, so the user could compare images being generated by an app. (This is permitted in SView).

A use case is a storyboard generation app where it is necessary to review some previously generated images. In LeiaPlayer launched with a shared image, the user has to exit LeiaPlayer and reenter to see the entire album.