Expo React Native loading images from Android image Gallery - android

I’m building a React Native + Expo App for Android.
It’s a product catalog for internal use. I’ll install the App manually on my tablet, there will be no Play Store download for the public.
I want to store the images in the device Gallery, instead of an asset folder within the App itself. In order to be able to manually copy the whole folder connecting the device to my PC, without bundling all the images with the app itself.
I already know how to load an image from the App’s assets.
I also checked expo-image-picker, but I don’t need the user to “pick” images.
I just want to point images in my App to the Device’s Gallery folder.
Any clues welcome!

Related

How to pack app photos with apk?

I am developing an app and I want the photos used in this app to be packed with the apk. The problem is that these photos are downloaded first time when I create the database. In the database I store only location (for example City: Name | Population | Photo Location). Everything works fine but the big problem is that I don't want these downloads to be made at install (it takes 10 minutes because there are a lot of photos), I want to have these photos available at install and be packed with the apk (like the database from assets).
I saw this: Saving and Reading Bitmaps/Images from Internal memory in Android
And currently my photos have been downloaded and are in the /data/user/MY_PACKAGE/imageDir. I don't have any permissions to copy the photos from this folder and if I uninstall the app the photos will be deleted too. And this is not good, I will download the photos with Java and place them manually somewhere, but I don't know where.
My question is where should the photos be placed to have access to them when using the app? And how can I make them download in that folder, without the need of moving the manually?

Is it possible to attach a pdf in android app for offline viewing?

I'm trying to attach a PDF file within my android application as part of the application, that gets downloaded when the user downloads the app. Is is possible to do that? I already know about opening a pdf with webview in my app, but I want to know how to attach the pdf file with my app so that it can be viewed offline.
Please let me know if this is possible.
Thanks.
If your PDF has small size, you can put it in assets folder, so user can view it right after installing app, even without network connection. If it has big size, you can share it in the cloud (e.g. dropbox) and later download it and save to device's internal storage.
Using the Internal Storage

create an android apk that only update a resource image file

Is it possible to create an .apk file that only update an image in the existing app? my app is an in-house app for corporation, not in the play store, mainly contain of images (in the resource folder), and i just want to create a patch (an apk that is significant smaller size) that only update one of the images in the existing version.
If you want your app change image in the res folder of another app it may be possible(not sure it can be impossible at all) for rooted devices.Because all app folders created by the android system for the installed application are protected and can not be accessible for another processes.
But if the image was created on SD-card or on the shared device memory it is not a problem.

Distribute air apps without recompiling

I'm developing an air image viewing application for Windows and Android that will allow some special users to import bitmaps to it. The user can click on a button, browse to a bitmap stored locally and then the app saves the image to the documentsDirectory.
Later on, other users (let's call then common users) will get this already compiled app and view the images imported by the special users.
My question is how can I make the app save the images within it without recompiling it?
Any ideas are welcome! Thank you all!
The only option I can think of, is to make a web server to store and load the images by those users. That's because the images will be stored in the documents or cache directory of the device which means that there is no automatic way to bring them to other devices.
You need a web server that the images will be uploaded and saved, and later on retrieved by other clients. It's called centralized assets system.

Using not compiled media on Android

I'm developing an Android application. I'm very new on Android development.
I see on other projects that textures are hold on res directory. They have to be compiled and deployed into device.
I'm wondering if I can download a picture as a texture from a web service and use it.
I don't know if every media that I need has to be compiled.
Thanks.
Yes you could download the pictures from the web and use them. If you plan on having changeable content then you should probably do so as well.
Adding Images to Res will have them included in the APK and, Then copied to the device on installation (Unless you use zipalign which should sometimes allow you to use content from the apk)

Categories

Resources