You Are Here:

Community: Developer Discussion Boards

#1 Old check capabilities dinamically - 2007-06-20, 17:01

Join Date: Apr 2007
Posts: 233
felixksp
Offline
Regular Contributor
Is it possible to check capabilities of the application dinamically? For instance to know if the application is allowed to send and receive data or to read user data. I am referring from code, to be able to display customized error messages depending on not allowed capabilities.

Thank you.
Reply With Quote

#2 Old Re: check capabilities dinamically - 2007-06-20, 18:51

Join Date: Apr 2003
Posts: 6,408
Location: USA, CA
hartti's Avatar
hartti
Offline
Nokia Expert
From MIDP 2 Javadocs

MIDlet.checkPermission

public final int checkPermission(String permission)Get the status of the specified permission. If no API on the device defines the specific permission requested then it must be reported as denied. If the status of the permission is not known because it might require a user interaction then it should be reported as unknown.

Parameters:
permission - to check if denied, allowed, or unknown.
Returns:
0 if the permission is denied; 1 if the permission is allowed; -1 if the status is unknown
Since:
MIDP 2.0

Hartti
Reply With Quote

#3 Old Re: check capabilities dinamically - 2007-12-12, 12:19

Join Date: Sep 2006
Posts: 13
nekinpatel's Avatar
nekinpatel
Offline
Registered User
hi dear,

i want to know that in method of checkpermission(String parameter)
what parameter should i pass as string to check permission. i passed as "javax.microedition.io.Connector.file.read" and it returns as 0 with no diff that application is signed or not.. so please tell me how can i resolve this issue.



Thanks,
Nekin
Last edited by nekinpatel : 2008-07-24 at 09:27.
Reply With Quote

#4 Old Re: check capabilities dinamically - 2007-12-12, 23:59

Join Date: Apr 2003
Posts: 6,408
Location: USA, CA
hartti's Avatar
hartti
Offline
Nokia Expert
You pass it the same permission strings what you need to define in the JAD file (so your string is correct)

Are you running the app on an operator branded phone? Which phone model?

Hartti
Reply With Quote

#5 Old Re: check capabilities dinamically - 2007-12-13, 08:02

Join Date: Sep 2006
Posts: 13
nekinpatel's Avatar
nekinpatel
Offline
Registered User
hi dear,
i have tested it with signed and unsigned application in nokia 6630,6680,n80 phones.

see what i have done is as below, please correct me if i have taken any wrong step.

1- int j= this.checkPermission("javax.microedition.io.Connector.file.read);
and then i am checking value of j which this api call returns.

so can you tell me what should it return in both case 1- when i have not given permission in suite setting and 2- when i have set permission always allow in suite setting.

Thanks,
Nekin
Reply With Quote

#6 Old Re: check capabilities dinamically - 2007-12-13, 09:08

Join Date: Apr 2003
Posts: 6,408
Location: USA, CA
hartti's Avatar
hartti
Offline
Nokia Expert
First 0 (not allowed), then 1 (allowed). Remember to request the proper permissions in your JAD file!

Hartti
Reply With Quote

#7 Old Re: check capabilities dinamically - 2007-12-13, 09:38

Join Date: Sep 2006
Posts: 13
nekinpatel's Avatar
nekinpatel
Offline
Registered User
ya that's fine dear

but have you checked with above permissin in you midlet
since i am checking for this permission "javax.microedition.io.Connector.file.read" and i am getting -1 instead according to your reply it should give me 0 or 1.

so can you please check this practically if you have not checked ?

so that i can get exact solution to it. :)

Thanks,
Nekin
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
S60 2nd to 3rd/ PlatformSecurity / Capabilities jarkoos Installation, Certification and Security 4 2007-04-14 15:08
signing a freeware with extended capabilities Jeepy General Symbian C++ 5 2006-09-01 16:56
Capabilities needed for constructing/deleting CTelephony object? mgroeber9110 Symbian Networking & Messaging 0 2006-08-14 14:45
GSM/GPRS Drivers check FAILED hblume Multimodecards 3 2004-01-28 22:37
SMS Msg using VB Application gurup83 General Messaging 2 2002-07-11 05:48

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia