I am beginner in Android development. I need to show 400+ images in my android app. Right now I am putting all of them in my drawable folder, but this doesn't seem good, as my apk becomes too large in size. What should I do? Can I play with images' resolution and all? Please help.
best solution will be to put them in web and then displaying it through lazy list, But if thats not an option then only thing you can do is to compress your image to a extent it is acceptable, that will check you problem of large apk size.
try PNGOUT , a great tool for compressing images.
Put them all in a extension-obb-File:
http://developer.android.com/google/play/expansion-files.html
So I handled it with videos.
Related
I'm working on a android app that will display gemstones. Putting thumbnails in drawable-XXSIZE is not a problem, but how can I continue this with expansion files?
If I create folders such as: drawable-ldpi, drawable-mdpi etc. and put everything in a zip (I can only have 2 expansion files) will I be able to download only what I need? (I'm guessing no...)
So how can I make sure the tablet user will get big image for full screen such as 1920px (worst case scenario) and for mobile phone alot smaller.
What is the best approach for this kind of applications?
Should I just put it on my own server and make my own image management?
I would like to just put it in a bundle and the end user have an app that is as small as possible without loosing quality
You need to try sdp library for this
https://github.com/intuit/sdp
After this your problem is solved and also try vactor images so you do not need different image size in all folder like mdpi or ldpi or xxhdp ,need to store single vactor image in drawable folder.
There is no solution to this. I just have to build functionality. Previous answer it has nothing to do with my question
I got an app which is loaded with many image files which takes much place. The app can also download more pictures from different sources. Is there a way to compress their size?
I remember there was maybe some sort of library created by Google specifically for this issue?
I am creating an app that uses more than two hundred images. To display images, lmageView is used. My question is- Is it necessary to put images in drawable-hdpi,drawable-mdpi,drawable-xhdpi,drawable-xxhdpi. If I put the images in these four folders, does my app size increases?
Please help me. Thanks in advance.
Well I guess if your image set will not change in the future maybe that's the best place to store them. Your app size will certainly increase, however, if that's a concern you can store them using any cloud service like parse.com or firebase, so you can retrieve them later using a library like picasso
You don't have to put pictures in all folders. There are folders for different image resolutions. You can use a single folder called drawable or just use drawable-mdpi. The app size increase with multiple image versions. There are some disadvantages when you use only one folder.
If you have big resolution images inside your folder: For a presentation, small screen devices have to minimize the image. This costs hardware ressources. If it costs to much ressources, your app will crash.
If you have small resolution images inside your folder: For a presentation, big screen devices have to upscale the image. This will result in bad image quality.
i'm writing a simple application. i need to handle around 100 images having size dimension 1000*740. images are fixed no need to change. user will see this images like gallery view.
Problem
1.Large number of Images increases .apk filesize .It crosses memory limit(Given by Android market).
2.I placed these images in Drawable folder.Is there any other way to keep this images?
Any Idea?
YOu can host them on a separate site, but you do not have to download them every time. You can download them to an external directory (sd card) and just check if you've got everything you want when starting the app: If you do, you obviously don't have to re-download the shots again.
Is there a reason your images are of that size? If you compress them a bit you should be able to fit a photo in less then half an MB, and I think that the limit is 50mb on the market: You might be able to just squeeze it in.
Upload all the images to a link. Do parsing by using that link.
That's a pretty tough dilemma. Perhaps the user can download the images instead. You could use flickr to host the images.
I would suggest hosting them somewhere and download as "citizen conn" suggested.
Another possibility would be to separate in different sets and have different apk with those (maybe some of them would only have a content provider with some of those pictures). But that's kind of ugly...
Other than that, I don't think there is any way to get around the limit from Android market...
I am creating a simple android app to view a comic book. The pages are large(0.5-1 mb each), high quality .png's and I am loading them into a webview to make use of the built in zoom controls. So far I only have 17 files and the APK size is already about 16 mb. I'm looking to add over 200 files in future updates. I can't really reduce the quality too much because there is small text that must be zoomed-in on to read. Any suggestions? A similar question was posted here: How to reduce App (.apk) Size, but I don't want to lose the quality of the images. I'm not sure if it's appropriate to link to here, but you can have a look at my app by searching for Tracer (by Detour Mobile) on the android market if it helps at all. Thanks in advance.
You could compress them without using lossy compression- e.g. zipping/rarring them, but I don't believe this would gain you much more than a few kilobytes here and there. Otherwise, try using a more compact format than PNG, such as JPEG (you won't lose too much quality.) By the way, all of this was suggested in the referenced post.
If you do decide to scale down the images' size somewhat, be sure to use a method like bicubic sharper- it tends to look better than others when reducing image size.
Another option would be to download the images for the comic that is being read on-the-fly with pre-fetching so reading would not be interrupted as much.
Consider placing your images in Assets folder as opposed to Res. The big difference is, Assets content won't be compiled into R.java class so you will see major storage savings. You'd have to modify your code though as you won't be able to call up the images via the regular r.resID notation, but it's doable
android offers a new way to deal with it.
android app bundle apk size has a maximum size of 150mb
but you can use an asset pack to seperate the apk from the static files
and upload your app
here is a more detailed explanation about asset packs:
https://developer.android.com/guide/playcore/asset-delivery
here is the guide for integrating asset packs with regular android app:
https://developer.android.com/guide/playcore/asset-delivery/integrate-java