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

Java Development

Reply
Contributor
adm1n
Posts: 38
Registered: ‎02-18-2011
My Device: Not Specified

Terminating process

Once I have a PID, how can I terminate/stop/kill it?

 

 

thanks.

Contributor
adm1n
Posts: 38
Registered: ‎02-18-2011
My Device: Not Specified

Re: Terminating process

[ Edited ]

Guys, anybody?

 

Something simmilar to sigsend unix C function

Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: Terminating process

I am not aware of an facility in the RIM API that will allow you to terminate a process that you are not on familiar terms with.  And I can understand why - you wouldn't want a rogue application killing off your process would you?

Contributor
adm1n
Posts: 38
Registered: ‎02-18-2011
My Device: Not Specified

Re: Terminating process

Have to disagree. What about Windows's Task Manager with kill process/process tree feature? Or *nix's top/ps with kill command? This may be very usefull and sometimes even essential. In any case, user must be responsible for which apps he/she installs on BB...

But back to my question - it means, that the only way to kill process is only if it was written by me and I have to implement posting/listening to global events?

Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: Terminating process

[ Edited ]

Point taken. 

 

What I didn't make it clear was that my comment applied to the BlackBerry, having factored in RIM's security model - which tries very hard to make sure that applications on the Blackberry are as sandboxed as they can be.

 

This sort of security model is not in place in any other OS that I am aware off, at least not to the degree that RIM has.  What other OS asks the user if an application can connect to the internet, or simulate key strokes, or even request a GPS location!

 

But back to the point.

 

As I said, I am not aware of a facility in the RIM API that will allow you to terminate a process that you are not on familiar terms with. By familiar terms, I mean you have established some form of Inter process communication. 

 

I am confident you will not find such a facility based on my understanding of the security model. 

 

And note that there is no similar facility procvided by the OS.  There is no Task Manager kill option, or nix's kill command.  So if you can't even do it using the OS, I would argue you have no chance of doing it in a program. 

 

And in fact I still stand by this comment:

"you wouldn't want a rogue application killing off your process would you?"

As you say:
"user must be responsible for which apps he/she installs on BB"

If they don't want my app, then they can delete it (or not as they case may be - for example if this is a corporate BlackBerry and the app is a corporate requirement). 

 

And back to your question:

"it means, that the only way to kill process is only if it was written by me and I have to implement posting/listening to global events"

 

Loosely yes, though

a) global events is only one way of proving Inter Process Communication

b) It is possible to establish relationships with other applications, such as RIM applicatins though various API mechanisms, like ApplicationMenuItems or Listeners. 

Contributor
adm1n
Posts: 38
Registered: ‎02-18-2011
My Device: Not Specified

Re: Terminating process

thanks for clarifying RIM's security model...

Trusted Contributor
Thecr0w
Posts: 178
Registered: ‎02-20-2011
My Device: 8700

Re: Terminating process

restriction is just one side of the security coin.

# I tried to change the world, but I couldn't find the source code #