I am making a Game in Android using Android Studio. My Game is beign designed in Pixel Art.
The images that I put on the Game, in the app, are shown with Smooth, they are not pixelated as I have designed.
Is there a way to put the images and show them correctly? Here is an example of what happens. At left, how my App shows the images. At right, how do I need to be shown thw images.
https://stuartspixelgames.files.wordpress.com/2015/10/comparison.png?w=700
What is the supposed size of this image on screen? Perhaps your image file's dimensions are too big sometimes it becomes blur depending also on how you display it.
Related
In my flutter app i have set a *.PNG image as splash screen or starup screen to be shown when this app starts but it is not being shown in high quality and i have tried to set another high quality image then image spreads outside of the screen (kind of over zoomed) but i have seen many app's flash screen is in good quality, i have seen Splash Screen logo displayed is of poor quality i am seeking if there is another easy way to do so please let me know thanks
Things i am using (Flutter, on vscode, for android, on windows 10)
Using a static png file will almost always give you such problems. You need to consider different screen sizes and dpi for different devices. If you still want to use your own png convert it into svg with this site https://picsvg.com/ and convert it into material usable icon with this site https://android-material-icon-generator.bitdroid.de/. It is easy and will save you much effort.
I want to set background image for Android Wear notification. What should be the size of the image?
The documentation for Android Wear specifies that the background should be 400 x 400 if it should not use parallax scrolling and a size of 640x400 if it should support parallax scrolling.
The image should be put into the drawable-nodpi folder of your android app.
I couldn't make out a difference in the scrolling with different backgrounds. The bigger background is cropped to 400 x 400 and even if scrolling nothing outside the 400 x400 area is shown.
The resolution for square watch faces as of right now is 280x280, whereas the circular watch face has a resolution of 320x320 (although some of this will be cut off, obviously).
However, Android Wear implements a sort of parallax scrolling by default for larger images, so it can handle larger images with great ease, and it is even recommended that you do so (see this previous answer). So you really shouldn't worry about the size of the image, unless you were trying to create a static, full-screen image with specific areas of interaction as a substitute for custom UI elements (which you can do, I might add, although Google recommends you have only one area of interaction per screen on the watch to keep things simple).
If you want to see a good example of multiple images being used for backgrounds with parallax scrolling, I recommend you check out the GridViewPager sample project, which can be found in the SDK samples in the wearable subfolder for API level 20.
In which use cases do you require parallax scrolling? I believe it only works in Notifications and GridViewPager.
I have created a simple image slider 'Live Wallpaper' that will call in an image upon DoubleTap. I know there has been many different OOM issues when dealing with images in that the Android System must convert the image into a BMP which essentially increases the image size substantially.
My question is when I activate the Live Wallpaper from the Live Wallpaper Menu screen and view it in Preview mode, it works perfectly. I am able to browse through all my images without any lag or problems. However, when I go to SET the Live Wallpaper, it crashes with an OOM error. Any reason why this could be?
Preview Mode is drawn on an opaque surface whereas your desktop draws both icons, updates and animations over it.
Have you optimized the graphics? That could help quite a bit ... something like http://trimage.org if you are using jpg/png.
I have a simple app that displays a series of images and infomation about those images. I've set it up so that when a user touches an image, a new activity is launched and they see more pictures and a longer text description about that image. On that screen, I've also implemented the basic gallery widget that they have here in the Hello Gallery Tutorial.
My problem is that even though I'm drawing on images from the res directory (I've thrown everything in drawable-mdpi thinking that there shouldn't be a huge deal), not all of the images on the gallery portion will load. And I haven't been able to reproduce it 100%, but it seems like the more I play with my phone with this app running (lock screen, unlock screen, go to one image, go back, go to another one, hit home, etc), the more likely any picture that I've got loaded up locally display blank image placeholders, gallery or not (the text comes up fine though).
I'm using a series of imagebuttons, imageviews, and gallery widgets. Play with it enough and eventually they all come as blank, but killing everything through AdvancedTaskKiller brings it back.
Sometimes pictures in my image galleries will also be blank when I first launch my app. That's really weird. I have it set so that the layoutparams are 300 by 200 and I've pulled pictures all over the place to populate my gallery. They should just all scale differently, not fail to load entirely though.
Anybody have any ideas on these?
Try Slow Adapter for the Gallery.
I recommend adopting 1,2,3
It is always hard to work with images. You have to be very careful with recycling memory that your images already used otherwise you could get into different kind of troubles.
Always try to use a good Image loading library that commonly being used by Android developers.
Most commonly used library is https://github.com/nostra13/Android-Universal-Image-Loader
It will optimise your loading.
I'm developing a mobile web application and I have a home screen with a number of icons on it, so I tried to use a sprite to serve all the images in one swoop.
I noticed, however, that the iphone4 scaled the images in my sprite fairly well (they looked a little dithered), but on my HTC Evo the sprite rendered images look really blocky. I switched to standard images (background:(/image_url/) w/o background-position) and the image looked much better - see this , where the left image is served using the single image, and the ones to the right of it are served from the sprite (but are the same images in the sprite).
Is there a way to get the Android browser to interpret the sprites better?
You're hitting the maximum decoded image size barrier in the Android browser. This size limit was upped to something reasonable in 2.3. Try splitting up your sprites into smaller images.
This is just a guess but, which one are you using? Your operator or wifi connection? Some operators do compress images over certain size.