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
Developer
Posts: 86
Registered: ‎12-06-2012
My Device: Curve 8520
My Carrier: Blackberry store

how can get file installation notification in Application

Hi Friends,

I am developing one Application where i want to  install  file from server in background thread and when installation completed ,notification should send to the forground application.

is there any way to do it  ? 

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

Re: how can get file installation notification in Application

By 'installation' do you mean that the data you are downloading is an application that you are installing.  Or do you mean when the background process has finished doing its work. 

 

Either way, I think the usual approach here is to start the Background Thread form the foreground processing, and have the foreground processing act as an Observer (see the Observer pattern), in which case the Background Thread can inform an observers of the completion of its work.  So look at the Observer pattern - this is a standard development approach and not specific to BlackBerry, there is nothing in the API to specifically support this. 

Developer
Posts: 86
Registered: ‎12-06-2012
My Device: Curve 8520
My Carrier: Blackberry store

Re: how can get file installation notification in Application

Hi Peter,

 

Thanks for your quick reply.

 

As you suggested I have already worked with Observer pattern,As far as I know Observer patteren will help me in scenarios where we have to establish notification machanism between different modules.

 

But the issue i am currently facing is I want to get notified when user installs particular application.

 

Like in case of android we get Broadcast when user installs application.Do we have any way to get notified when any application gets installed.

 

Thanks

Developer
Posts: 16,997
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: how can get file installation notification in Application

there is no gobal event for an installation, you would have to check the list of installed modules from time to time with http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/system/ApplicationManager.html
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 86
Registered: ‎12-06-2012
My Device: Curve 8520
My Carrier: Blackberry store

Re: how can get file installation notification in Application

Hello Simon,

Thank you for your reply.

There is something like CodeModuleManager and CodeModuleListener with the use of this i can check when any application deleted from device or installed.

I already checked it .but my problem is about appworld application installation.

i am not able to get contentId from appworld application. 

Developer
Posts: 16,997
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: how can get file installation notification in Application

oh yes, i absolutely forgot about codemodulelistener. please disregard my previous post...
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter