File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java Micro Edition and the fly likes sms app gives security exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "sms app gives security exception" Watch "sms app gives security exception" New topic
Author

sms app gives security exception

sanjay ramaswamy
Greenhorn

Joined: Feb 11, 2009
Posts: 29
Hello,

I am not able to get rid of the security exception when i test it in the nokia E71x phone i.e i get result is false. I tested my below code in netbeans with Nokia S40 6th edition sdk and it works fine meaning i get the value of result as true when a message is sent .

when the send button is clicked a new thread is started in the commandAction method and in the run method sendSms is called which returns true if message is sent or false from the catch block . Please help me understand what is the problem here ???



"People who are unable to motivate themselves must be content with mediocrity , no matter how impressive their other talents " -Andrew Carnegie
Vijay Dogra
Greenhorn

Joined: Sep 16, 2004
Posts: 22
Have you mentioned the permissions required in your file?
sanjay ramaswamy
Greenhorn

Joined: Feb 11, 2009
Posts: 29
Vijay Dogra wrote:Have you mentioned the permissions required in your file?


This is my manifest.mf file inside my jar file that i try to install in my nokia phone which is on a US carrier .

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.1
Created-By: 1.6.0_23-b04 (Sun Microsystems Inc.)
MIDlet-1: How To SendTextSMSMidlet, , HowToSendTextSMSMidlet
MIDlet-Permissions: javax.wireless.messaging.sms.send, javax.wireless.
messaging.sms.receive
MIDlet-Vendor: Vendor
MIDlet-Name: How To SendTextSMSMidlet
MIDlet-Version: 1.0
MicroEdition-Configuration: CLDC-1.1
MicroEdition-Profile: MIDP-2.0

I have just added the extra receive permission although it is not needed in this case . when i test the code in an nokia s40 emulator, i get result = true (Please interpret this meaning from the code ) . I then install the jar in my phone(E71) and it shows the form . I enter the phone number and a message and press send and the result is false which means the message is not getting sent !!! it seems to me an issue of app-signing or a case of handsets here in US which are locked or deny me access to basic sms sending features of j2me apps.
Vijay Dogra
Greenhorn

Joined: Sep 16, 2004
Posts: 22
Can you replace System.out.println with Dialog that shows. Then it would be clear as to what SecurityException (if at all this is the case) is raised.
Vijay Dogra
Greenhorn

Joined: Sep 16, 2004
Posts: 22
Hi Sanjay,

Can you please try to set the settings of installed application on your phone (Options->Application Access).

If this even doesnt help, then you have to sign your application before installing it to the real device.

VJ
sanjay ramaswamy
Greenhorn

Joined: Feb 11, 2009
Posts: 29
Vijay Dogra wrote:Hi Sanjay,

Can you please try to set the settings of installed application on your phone (Options->Application Access).

If this even doesnt help, then you have to sign your application before installing it to the real device.

VJ


I could not find that i.e Options-> Application access .

I think in USA the carriers like AT&T that i am using gives us locked phones (I am guessing!!!) which is why we can install our apps but not be able to use wireless api's .

I want to simulate over an emulator now instead of in a phone....so i have a different problem and will start a new thread !!! Thanks to vijay
 
jQuery in Action, 2nd edition
 
subject: sms app gives security exception
 
Similar Threads
Not able to Receive sms messages in my emulator over port 50000 but able to send
GUI chat room
NullPointerException
back button won't work.
Command buttons display on screen