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

Reply
Developer
livtext
Posts: 36
Registered: ‎01-20-2010
My Device: 8520
Accepted Solution

It is posible to make widget to run only on my device?

It is posible to make widget to run only on my device?

or to run only on my girlfried device

 

or to run on specific PIN DEVICE.?

 

If is posible give me an ideea how  to make it.

 

thanks.

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

Re: It is posible to make widget to run only on my device?

Hi There,

 

In the onLoad of the first page of your BlackBerry widget, you can run some JavaScript to check to see if the device PIN number, or the user's email address matches a desired list.

 

If this number doesn't match you can exit the application.

 

Checking the PIN or email address can be found here:

http://www.blackberry.com/developers/docs/widgetapi/Summary_identity.html

 

Closing your widget can be found here:

http://www.blackberry.com/developers/docs/widgetapi/blackberry.app.html

 

Hopefully that gets you going in the right direction :smileyhappy:

 

Cheers

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Developer
livtext
Posts: 36
Registered: ‎01-20-2010
My Device: 8520

Re: It is posible to make widget to run only on my device?

I understand. ant thank you tneil.

 Java touch with my knowledge is poor to nil. (english too).


 someone to do his mercy on me and show me an example.

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

Re: It is posible to make widget to run only on my device?

 

 

if (blackberry.identity.PIN == "12345678")
  blackberry.app.exit();

 

 

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Developer
livtext
Posts: 36
Registered: ‎01-20-2010
My Device: 8520

Re: It is posible to make widget to run only on my device?

[ Edited ]

thanks tneil, Sorry to have to answer stupid questions like mine.

but.. one more

 

how to implement your suggestion into first page.html (index.html)

 

i use this: 

 

<script type="text/javascript">
function registerEvents(){
    if (blackberry.identity.PIN == "2100000A")
  blackberry.app.exit();
}
</script>

and... 


<body onload="registerEvents()">

 

 

what is wrong?

 

Thanks.

 

 

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

Re: It is posible to make widget to run only on my device?

What doesn't seem to be working?

 

if the Device's PIN is 2100000A the application should exit.  Have you also declared the proper feature id's in the config.xml to allow the use of the "blackberry" JavaScript APIs.  The feature IDs needed are shown in the documentation for the Identity and App objects in the documentation links posted above.

 

You can also make your code run without an onload event.  You could simply place the exit code inside a <script> element and not in a function.  any code that is in-line in a script tag gets executed before the onload even runs.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Developer
livtext
Posts: 36
Registered: ‎01-20-2010
My Device: 8520

Re: It is posible to make widget to run only on my device?

[ Edited ]

Thanks work Perfect.

 

blackberry.app.exit  use blackberry.app Feature?