BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 11-12-2007, 07:38 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2007
Model: 8100
PIN: N/A
Carrier: movistar
Posts: 51
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default openInputStream Error!!!!!

Please Login to Remove!

Hello i have this function, this return a EncodedImage in the simulator It works perfectly, but in my BlackBerry return this error:

ERROR : net.rim.device.api.system.ControlledAccessExceptio n


please help me

private EncodedImage archivo(String sFoto) {
EncodedImage image = null;
try {
FileConnection fconn = (FileConnection)Connector.open("file:///store/samples/pictures/"+sFoto);
// If no exception is thrown, then the URI is valid, but the file may or may not exist.
System.out.println(fconn);
if (fconn.exists()) {
System.out.println("Existe el Archivo");
InputStream input = null;
input = fconn.openInputStream();
int available = 0;
available = input.available();
byte[] data = new byte[available];
input.read(data, 0, available);
image = EncodedImage.createEncodedImage(data,0,data.length );
}
}
catch (Exception ioe) {
System.out.println("ERROR : " + ioe);
}
return image;
}
Offline  
Old 11-12-2007, 08:21 AM   #2 (permalink)
CrackBerry Addict
 
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

you need to register for code signing keys:

BlackBerry
__________________
new job doesn't allow a public profile - please do not contact this user with questions, you will not get a response. good luck!
Offline  
Old 11-12-2007, 08:28 AM   #3 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2007
Model: 8100
PIN: N/A
Carrier: movistar
Posts: 51
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Thank

Hello Thak´s But I Signed My Code.

The Problem Is To Open Inputstream.
Offline  
Old 11-12-2007, 09:06 AM   #4 (permalink)
CrackBerry Addict
 
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

do you get an error if you run the code without a usb cable attached?
__________________
new job doesn't allow a public profile - please do not contact this user with questions, you will not get a response. good luck!
Offline  
Old 11-12-2007, 09:18 AM   #5 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2007
Model: 8100
PIN: N/A
Carrier: movistar
Posts: 51
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Error

CALLING MY APPLICATION TO THIS ROLE FOR SELECTED TO ATTACH THE ARCHIVE. AS THE ROLE RETORNA THE ERROR "ControlledAccessException" THIS RETORN NULL AND SEND ME THE DEPUTY IS MENSAGE "Uncaught exeption: java.lang.NullPointerExeption."

FIRM AND THE CODE.
IN THE SIMULATOR WORKS WELL AND SEND THE MAIL WITH THE ATTACHMENT BUT IN MY BLACKBERRY SEND THE ERRORS
Offline  
Old 11-12-2007, 09:51 AM   #6 (permalink)
CrackBerry Addict
 
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

ok...
__________________
new job doesn't allow a public profile - please do not contact this user with questions, you will not get a response. good luck!
Offline  
Old 11-12-2007, 12:10 PM   #7 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2007
Model: 8100
PIN: N/A
Carrier: movistar
Posts: 51
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default ok

You know where is the problem?
Offline  
Old 11-12-2007, 12:30 PM   #8 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2007
Model: 8100
PIN: N/A
Carrier: movistar
Posts: 51
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default ok

Some will need permission to read the files in memory?
Offline  
Old 11-18-2007, 05:20 AM   #9 (permalink)
Talking BlackBerry Encyclopedia
 
Skipper_Joe's Avatar
 
Join Date: Jan 2007
Location: Kharkov, Ukraine
Model: 8300
Carrier: N/A
Posts: 237
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

We trapped into the same problem and we asked RIM support. There answer was that files in /store/samples/ folder are RIM protected media and are defended against distribution in this way.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright © 2004-2014 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.