Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Super Contributor
bh1r1th
Posts: 273
Registered: ‎11-23-2010
My Carrier: Software Programmer
Accepted Solution

how to save the image that comes from web.

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

Please use plain text.
Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008

Re: how to save the image that comes from web.

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.

 

Please use plain text.
Super Contributor
bh1r1th
Posts: 273
Registered: ‎11-23-2010
My Carrier: Software Programmer

Re: how to save the image that comes from web.

hi thank you

but i don't about hashtable concept

please tell me the another way

otherwise plase send the sample code

Please use plain text.
Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008

Re: how to save the image that comes from web.

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.

Please use plain text.
New Contributor
developermonkeys
Posts: 5
Registered: ‎05-11-2011
My Carrier: orange

Re: how to save the image that comes from web.

[ Edited ]
Hashtable Example:
	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);
Please use plain text.
Developer
welsenKiriono
Posts: 202
Registered: ‎04-19-2011
My Carrier: TAM

Re: how to save the image that comes from web.

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...

Please use plain text.
Super Contributor
bh1r1th
Posts: 273
Registered: ‎11-23-2010
My Carrier: Software Programmer

Re: how to save the image that comes from web.

Thank you for the replay.

welsenKirino your correct.

Please use plain text.
Super Contributor
bh1r1th
Posts: 273
Registered: ‎11-23-2010
My Carrier: Software Programmer

Re: how to save the image that comes from web.

Thank you

developermonkeys.

Thank you for the valuable code.

Please use plain text.