wood burning stoves*
The moose likes Android and the fly likes Three questions about  images Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Three questions about  images" Watch "Three questions about  images" New topic
Author

Three questions about images

Dov Ezra
Greenhorn

Joined: Nov 23, 2010
Posts: 21
Hi,
I hope you people can share your knowlage about the fallowing questions.

1. I have a Linear Layout with a background image and an ImageView component in it.
is it possible to add a new image that will stand in front of the Image View?

2. I have a Grid Layout containing nine numeric images, each have a white background image behind it:

the problem here is how to scale the white background, but not the image with the number.
I can change the line imageView.setLayoutParams(new GridView.LayoutParams(28, 28));
to something like imageView.setLayoutParams(new GridView.LayoutParams(58, 28));
but this stretch both the number and the white background.
I attach a file with two screen shots. the top one is what I'm trying to achieve and the bottom is what I have now.

3. how do I set an application icon? android documentation says I have to add this line
to my manifest file: <application android:icon="@drawable/icon" >
where drawable/icon refer to a png file named "icon". well, I have that png file, put it in res/drawable
and add that line to the manifest. no result. I don't see my icon but that green default android icon.
what is missing here?

Thanks,
Dov


[Thumbnail for keypad.png]

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39575
    
  27
3. how do I set an application icon? android documentation says I have to add this line
to my manifest file: <application android:icon="@drawable/icon" >
where drawable/icon refer to a png file named "icon". well, I have that png file, put it in res/drawable and add that line to the manifest.

This sounds correct. Try uninstalling the app, and then install a clean build (do an ant clean before the actual build) - there could be some caching going on.


Ping & DNS - updated with new look and Ping home screen widget
Dov Ezra
Greenhorn

Joined: Nov 23, 2010
Posts: 21
Icon problem solved.
the problem is the way eclipse look for the icon file.
Although I had the icon.png in res/drawable, I didn't have it on res/drawable-hdp,
res/drawable-ldp and res/drawable-mdp. those folders contained only the default green icon.

now its working fine. :-)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Three questions about images
 
Similar Threads
Android app icon
calculate ImageView dimentions before user interact the UI
How to load image for Android ImageView from classpath?
How to add text to gridview
Placing SD-Card Image into LinearLayout ImageView