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

Web and WebWorks Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Contributor
Posts: 23
Registered: ‎02-20-2011
My Device: Not Specified

Open image file

I am trying to open an image. I do the following:

 

try {
        if (blackberry.io.file.exists(path)) {
            alert(blackberry.io.file.exists(path));
            blackberry.io.file.open(path);
            alert(" open end");
        }
    }catch(e) {
        alert(e);
    }

 

 

And I don't get any error, alerts are shown correctly but not the image. What's the problem?

New Contributor
Posts: 4
Registered: ‎09-12-2011
My Device: Torch
My Carrier: Rogers

Re: Open image file

Contributor
Posts: 23
Registered: ‎02-20-2011
My Device: Not Specified

Re: Open image file

Thanks for your answer, actually I saw that before. But the thing is i don't want to create an image element, I want to open the image with the blackberry native viewer.

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Open image file

Which operating system are you using.. BlackBerry Smartphone or PlayBook?

 

 

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Contributor
Posts: 23
Registered: ‎02-20-2011
My Device: Not Specified

Re: Open image file

[ Edited ]

Smartphone. Now, I am doing it invoking the browser (blackberry.invoke), do you know a better way to do it?

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Open image file

It will likely depend on the type of image, its extension and whether or not there is a default application assigned as its viewer.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Developer
Posts: 285
Registered: ‎08-26-2011
My Device: 9900
My Carrier: Not Specified

Re: Open image file

It helps you.

FilePicker take the SDCard:

 

then........... you have to use 

filePicker=FilePicker.getInstance();
filePicker.setPath(imageURL);		
filePicker.setListener(new Listener() 
{		
	public void selectionDone(String url) 
	{
//      System.out.println("======================URL: "+url);
//	try 
//	{		
//		FileConnection file = (FileConnection)Connector.open(url);
//		Do what ever you want.
//		file.close();
//	} 
//	catch (IOException e) 
//	{
//		e.printStackTrace();
//	}  
}
});
filePicker.show();	

 After this if you want to do somthing to this image(croping or store to another file) the the commented place will help you.

 

Right now the commented lines won't need to you.

=====================================================================================

Feel free to click LIKE button which is at right side of THUMB symbol.

 

 

=================================================================================
Feel free to click LIKE button if the solution helps you;
--
Regards,

ALI SHAIK.