05-12-2011 07:34 AM
hi friends,
i have aproblem i am doing a third party application in that application
i have display the images in that app i am showing that same image in different areas.
so in that case i am every time downloading from the net and i am displaying.
it takes to much time to display that images. so how can i avoid this situation
please help me friends.here i don't want to save that image in device or sd card.
how to do this task
Solved! Go to Solution.
05-12-2011 08:22 AM
You could cache the image in a hashtable. Make the URL of the image the key, and the image as the data object. Then you would consult the hashtable prior to actually attempting to GET the image.
05-12-2011 08:25 AM
hi thank you
but i don't about hashtable concept
please tell me the another way
otherwise plase send the sample code
05-12-2011 08:28 AM
Did you read the javadocs reference for the class Hashtable?
This is a pretty standard collection class. Are you a java developer?
Hashtable allows you to store a value (an Object) and retrieve it by a key, usually a string.
05-12-2011 08:34 AM - edited 05-12-2011 08:34 AM
Hashtable direccion = new Hashtable();
Integer ocho = new Integer(8000);
direccion.put("calle","Primavera");
direccion.put("numero", ocho);
direccion.put("colonia"," La Silla ");
direccion.put("ciudad"," Monterrey ");
direccion.put("estado"," Nuevo Leon ");
direccion.put("pais","Mexico");
String miciudad = (String) direccion.get("ciudad");
String miestado = (String) direccion.get("estado");
String micalle = (String) direccion.get("calle");
Integer minumero = (Integer) direccion.get("numero");
System.out.println("Direccion : " + micalle + " " + minumero);
System.out.println("Lugar: " + miciudad + "," + miestado);
05-12-2011 10:03 PM
As far as i know, If you want to save your image , you can use these methods
1. hashtable
2. database (using BLOB)
3. file in SDCard or Device (Using FileConnection)
Correct me if i'm wrong...
05-12-2011 11:33 PM
Thank you for the replay.
welsenKirino your correct.
05-13-2011 04:59 AM
Thank you
developermonkeys.
Thank you for the valuable code.