Generate same size image in drawable object - android

I have a drawable object which contains a app icon and it is stored it in runtime process.when I test it in different screen size it gives me different app icon size .I want my drawable object to give a same constant size of app icon weather it is running in big screen size or small screen size it should give same size app icon.Is it possible.

If you want to add images for different screen size you can simply following steps:
Right clik your on app>New>Image Asset
Select Asset Type: Image and browse your logo or image you want to use
Rename your image
Click next and finish
You can find your image in mipmap with images that are for all kind of screen sizes

Related

How do I convert a large image to be shown in notification Icon in Android

I am trying to figure out how can I use a big size image inside my notification icon. I have used the same image as my app icon by using Image Asset option but when I am trying to convert it into a Vector Asset I can't see it when I use it.
For instance I have a .png image, which I convert to .svg and further creates it's vector asset of 24x24dp. Though the viewport width and height are 1024x1024dp.
How can I see the image inside notification?
Currently I see just this square box inside and no image.
Does it have to be something with the viewport width and height or something else.

Android Studio 3.2 Add Image Of Custom Size (not icon)

When I right-click the Drawable folder and click New -> Image Asset, I'm presented with only four options: action and tab bar icons, launcher icons, launcher icons (legacy), and notification icons.
What if I want to add an image to just use in my app (not as a tiny icon)? Selecting any of the options above causes Android Studio to scale the image down to like 24x24dp when I want to display it at 100x100dp. So, when I display it, it looks really blurry. Why isn't there an option to add an image asset that's not tiny?
Limited modification is to comply with the material design specification. you could use vector asset if you want to get different size image.
and notice you should down image with SVG format, read the ref in here
another way is using thrid party plugins like Android Drawable Importer, which is flexiable and simpler.
Just copy the image to your drawable folder in the Android sidebar view. Make sure it goes into drawable and not one of the density-dependent folders, and you'll have an image with a custom size.
Be aware that images can't be too big in Android. It shouldn't be larger than 1600px in either dimension, otherwise you run the risk of a laggy interface or an OutOfMemory error.

How to set app launcher image from drawable folder?

Instead of using multiple images of multiple sizes in different folders like mdpi,ldpi,hdpi etc, can i put single image in drawable folder for app launcher icon so that i can reduce app size. What should i do for that.
Probably, try changing your manifest from the mipmap directory to the drawable one. If it doesn't work, I suggest just using a mipmap version with all the different sizes. If you think preparing the different icon sizes is difficult, it's not:
When you add the launcher icon, android studio will offer you to auto generated the various densities for you while you're in the image selection bit. So, you only have to add one image, incase you thought you had to resize them.
Its simple,generate icon of largest size ,which u think u may need anywhere ,and put that in your drawable folder. Android will automatically resize and use it according to requirement , This way you can effectively have just one image and let android handle sizing

PNG image not showing in Eclipse ImageView

I am using the Eclipse drag 'n drop feature to add a PNG image to my app UI.
When I drag the ImageView widget from the menu into the UI area it asks me to select the image from a list. I have named the picture image1 and when I select it there is just a placeholder image (a red cube with Aa in).
I have tried re-sizing the image and using different images. The placeholder image is visible on my UI but nothing I have tried can made the actual picture I have put in my xhdpi folder show up on the screen.
Any help much appreciated.
I'm not entirely sure why but when I changed the filename from image1.png to image2.png it worked.
The placeholder image that I kept seeing was listed higher up in the hierarchy as image1-web.png so I wonder if that was taking precedence.

Android / Eclipse: How to trim the surround at a non-square png file?

I'd like to use a png icon in my app without surround (it's not a square). I made the file with transparent background with an image editor, after that I used "New -> Other -> Android Icon Set -> Launcher Icons" wizard in Eclipse. There is in "Configure Icon Set" panel an option, called "Trim Surrounding Blank Space", but it isn't useable (gray). How can i switch on this option? How can I switch off the background color in this wizard?
I also tried this but I couldn't do it. Looking for it in google is a waste of time because there's nothing. My final solution was to use GIMP and then create 4 images, each one with my original image resized to fill the new image with the same proportions. After it I saved the images in their respective folders(inside res/drawable-). The size of them were:
96x96 (xdpi)
72x72(hdpi)
48x48(mdpi)
36x36(ldpi)

Categories

Resources