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.

inside custom component

Java Development

Reply
Highlighted
Developer
Posts: 33
Registered: ‎07-16-2008
My Device: Not Specified
Accepted Solution

using native image viewer

Is ist possible to invoke the native image-viewer from my application for displaying images?

When I send a jpg to my device via email, I can view it. Then I have different options in the menu like zoom, Fit to Screen, etc...

I would like to use this native-viewer by invoking from my application.

Thanks for help.

Anil 

Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: using native image viewer

Anil, You can invoke it by a browser session!

 

Thanks! 

--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: using native image viewer

The following code will invoke the native image viewer

 

BrowserSession b = Browser.getDefaultSession();

b.displayPage(path+imageName);

 

 

Thanks! 

--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Developer
Posts: 33
Registered: ‎07-16-2008
My Device: Not Specified

Re: using native image viewer

Thanks mantaker! 

good idea; So if I understand correct, then the image needs to be saved before on the bb-filesystem. Ok thats a good solution.

Is there also a way to display it without saving on the filesystem?

I mean, I have saved the image inside my application in Persistant-Storage. Now I want to invoke the viewer with my Image-Object as Parameter.

Anil

Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: using native image viewer

But AFAIK, displayPage only supports a qualified path URL!
--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Developer
Posts: 33
Registered: ‎07-16-2008
My Device: Not Specified

Re: using native image viewer

ok, if I do it via the filesystem, which prefix needs my browserpath? do I need

file://

 or do I need

file:///

 I tried it by hand on my device inside my browser; but I don't know how; My image has the path on the filesystem


/Device Memory/home/user/pictures/rim_image_simulator.jpg

 but which path do I need in the browser to display this?

 

 Anil

Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: using native image viewer

[ Edited ]

Use System.getProperty( "fileconn.dir.photos" ) for path .. By the way, else u should use file:///

 

Thanks! 

 

EDIT: TYPO 

Message Edited by mantaker on 04-09-2009 01:41 PM
--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Developer
Posts: 33
Registered: ‎07-16-2008
My Device: Not Specified

Re: using native image viewer

ok, thanks; sounds good; I found the path solution for my device:

file:///store/home/user/pictures/rim_image_simulator.jpg

Thanks for your help;

If anybody else knows a alternative way without fetching a saved file from the filesystem, but invoking direkt, advices are aprecciated.

Anil

 

Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: using native image viewer

You can however resolve this thread for now and mark other people's upcoming reply as solution, if it matches more appropriate than mine later too..
--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
New Developer
Posts: 13
Registered: ‎09-07-2008
My Device: Not Specified

Re: using native image viewer

This works, but only if you are connected to the network, otherwise the Browser won't do anything. Is there a way to start the browser without it doing that check? I know you can pass a servicebook uid to tell it to use a specific connection type, but how about no connection at all?