I need ways in which I can access images on my rpi-4 for an android app I am making - android

So I have a directory in my RPI-4 which there are various subfolders each of which contains images related to the folder.
I am making an android app which is basiclly a wallpaper folder and I have no clue how to access those images the only method i have in my mind is converting the images to base 64 then having a postgress database to access it but it seems a hassle to convert all the image and then also maintain and update it(as the app will also have a update feature later).
So i am open to learn new stuff in order to find an effective way to solve this.

Related

how can I programmatically remove the image from a folder “Drawable”?

I am developing an E-commerce application. Here I need to show lots of product images when the app is up. I have stored few product images in the drawable folder to reduce the network usage. I am planning to download delta product images when the new product is added in my back end product inventory and save it in SQLite database.
In the app I have to refer two different path ( drawable and SQLite database) to get all product images.
So how can I move the initial fish images in drawable folder to SQLite database at the time of APK generation OR after the app installation (in onCreate method of my MainActivity). And I also need to delete those initial images in the drawable folder after moving it to SQLite database.
Any suggestions are appreciated. Thank you in advance.
The bottom line is that if you deliver with content bound into your APK, it will remain there. Assuming you're planning on distributing through the Google Play store, the only way to modify this via an app update, which is obviously extremely hacky. So if your goal is to discard initial drawable resources, you cannot do this.
My advice is to compress the images as much as possible and only provide one image size which you can resize at runtime, so use the nodpi drawable resource folder (i.e. drawable-nodpi)
The alternative is to download the images via network. Though you say you don't want to do that the file sizes can be made quite small and so the download fast in most cases, so unless you're sure network connectivity will be a problem for your users it's a viable option.

How to use a lot of images in android's application

I have a huge android application that use more than 400 images so my app it's late even I tried to optimise it. What are the best practices in this situation?
I create the APK and the customer download all the images
Add some Images to application and the rest to download on the installation
Add all the images even the APK becomes more than 40Mo

Runtime resource files with PlayN

Working on a game that would like to allow users to select different character skins using PlayN (targeting Android as first platform). But these character skins will be made available later on (and due to their size, player may not want to download ALL skins). So rather than create a large bundle with all skins, is there a way for PlayN to access different resource files at runtime? We can setup a server backend for players to browse the latest available skins.
Any help/pointer is greatly appreciated.
You can use Assets.getRemoteImage to load images remotely.
There is currently no way to cache the downloaded images, which makes this non-optimal for your purposes, but I'm going to add support for caching the downloaded images which should make it work reasonably well if you use texture atlases and don't have a ton of images to download.
If you do need to download dozens or hundreds of images in one fell swoop, then you'll need to write custom per-backend code to handle that (and you'll have to give up using the HTML backend, because it cannot do things like download a zip file and unpack it into local storage).

Add and load images, videos and pdfs from a raw folder or an SDCard Android Tablet design?

Good day, I have a requirement to create a kind of book app with pdfs, images and videos worth up to 10gb and more on a tablet locally. Now there is no intention to sell it on the android market or any other store, its completely in house, so i think issue with apk size has been clarified. What am asking is, where is the best place to put all this contents so that i can readily load them up and use them accordingly?
Should i be using the raw folder and create sub-folders for each images, videos and pdfs?
Should i create folders on an sdcard(assuming there is one in place)? or
Please if you have any other solution or ideas on how to implement this, I would gladly like to hear this. Thanks for your responses in advance.
P.S by the way, since its a tablet specific app, is there any need to have a multi-pane layout fragment or ii can just use all the space. thank you
I suppose you can use a RAW folder, but it would also make the APK size huge from what I understand because all the files in the RAW folder need to be packaged with the application.
From what I've seen in the past, most applications, actually most games, that have lots of extra data will download the additional data on first launch. Basically:
The application launches
It checks whether or not you have all the additional data (Books, pdfs, images)
If not, it starts downloading that data to the SDCARD.
It may not make sense in your situation, but doing it this way gives you more finite control over how much data needs to be downloaded. If function A only requires package A of additional data, then you only need to download package A, you don't need to download everything. Or perhaps you could let the user choose what packages of additional data they want to download, which would also save bandwidth, time and resources.

Android Application pictures how to download/store them?

I inherited an application that is 8M in download size. It has a ton of graphics...was wondering the best way to handle this? If I remove all the pictures the app is only 300K so it would be nice to either offload these or load them upon first boot up of application. So my questions are, Whats the best way to handle pictures either SDcard or SQLite DB? and the Second is how to download the files on first boot up from say my website or outside database/webservice.
So the situation is not so simple. If your are planning to do this you have to think about few things first.
Bitmap drawables stored in your res folder can be optimized during build process. For more info http://developer.android.com/guide/topics/resources/drawable-resource.html#Bitmap
All your drawables are with assigned id and you can easily access the through Resources.
If the phone has no network connection how are you gonna download your resources.
You have to think about if these graphics are part of your application and should be included as resources or they are in same way additional functionality and you can download whenever it's possible.
The best way to store images is in the File system, Databases are no such good to it.
To download the images, you can use an URLConnection and use the BitmapFactory.decodeStream to parse the result from the URL InputStream.
Them use the Bitmap to write on disk.

Categories

Resources