×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    233

    check capabilities dinamically

    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.

  2. #2
    Nokia Developer Champion
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,192

    Re: check capabilities dinamically

    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

  3. #3
    Registered User
    Join Date
    Sep 2006
    Posts
    23

    Re: check capabilities dinamically

    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 08:27.

  4. #4
    Nokia Developer Champion
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,192

    Re: check capabilities dinamically

    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

  5. #5
    Registered User
    Join Date
    Sep 2006
    Posts
    23

    Re: check capabilities dinamically

    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

  6. #6
    Nokia Developer Champion
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,192

    Re: check capabilities dinamically

    First 0 (not allowed), then 1 (allowed). Remember to request the proper permissions in your JAD file!

    Hartti

  7. #7
    Registered User
    Join Date
    Sep 2006
    Posts
    23

    Re: check capabilities dinamically

    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

Similar Threads

  1. S60 2nd to 3rd/ PlatformSecurity / Capabilities
    By jarkoos in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 4
    Last Post: 2007-04-14, 14:08
  2. Replies: 5
    Last Post: 2006-09-01, 15:56
  3. Capabilities needed for constructing/deleting CTelephony object?
    By mgroeber9110 in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2006-08-14, 13:45
  4. GSM/GPRS Drivers check FAILED
    By hblume in forum Multimodecards
    Replies: 3
    Last Post: 2004-01-28, 21:37
  5. SMS Msg using VB Application
    By gurup83 in forum General Messaging
    Replies: 2
    Last Post: 2002-07-11, 04:48

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •