I am working on an application that has a google map. The default marker on the map is visible, but I need to take a picture from the facebook url and then show it on the google map. I am using "universal-image-loader-sample-1.8.6.apk" to download images using the url.
Now, to upload an image, I am doing this.
ImageLoader imageLoader;
imageLoader = ImageLoader.getInstance();
ImageLoaderConfiguration ilc = ImageLoaderConfiguration.createDefault(this);
imageLoader.init(ilc);
ImageView imageView = (ImageView)findViewById(R.id.friend_pic);
imageLoader.displayImage(stringImageUrl, imageView);
The simple displayImage () code takes two arguments: first stringImageUrl (page URL), second imageView (ImageView in layout).
Now why do I need a ViewImage object if I need to show an image on a map. The Well ImageLoader object does not return a bitmap from any of its functions before I used ImageView to set the extracted image from the url to imageview, and then get the image in Bitmap.
What I did is something like this.
Drawable drawble = imageView.getDrawable();
BitmapDescriptor icon=BitmapDescriptorFactory.fromBitmap(((BitmapDrawable)drawble).getBitmap());
Once I received the image in BitmapDescriptor, it is easy to set it in the marker.
Marker location = googleMap.addMarker(new MarkerOptions().visible(true)
.title(stringName).position(position).icon(icon);
but the problem is THAT DOES NOT WORK. The kernel appears in the imageView , but cannot get it in the Marker .