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: 1,650
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

pushenabled client apps lifecycle best practices

I have some questions how you're dealing with some aspects of pushenabled client apps (OS 5, OS 6)

 

OS 5:

application implements PushApplication and then onMessage() or onStatusChange() are called from PushService for incoming messages.

if the application isn't running, then push services  instantiate the app

 

so far so good, but some questions:

 

starting app 1st time -> register at content provider and push service

and immediately the app can receive messages

 

user quits application -> push messages are received -> app automagically started in background

in this case I have to carefully think about application startup.methods, because immediately after instantiating the app, onMessage() was called. in most cases at this time not all app-initializing was done.

so I have to buffer the incoming messages until I'm ready to process them

 

if I would have declared the app as auto-startup-app, then if user quits, the app would go into the background waiting there for messages. if they receive, no initializing work has to be done.

 

running apps autostarted and always moving to background if closing is some overhead for the system, but not auto-starting and then at autostart to do initializing again is also some overhead

 

also - if not autostarting and app was instantiated in background because of receiving push messages, the app remains in background. so I have to implement some logic to exit the app if sits in background waiting an amount of time for next messages.

 

How are you using this ? auto-started or always-again-started-as-receiving-incoming-messages

 

OS 6

Communication API doesn't work for me:

see http://supportforums.blackberry.com/t5/BlackBerry-Push-Development/OS6-Communication-API-no-Push-Msg...

unfortunately got no answers from forum or issuetracker

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Developer
Posts: 16,676
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: pushenabled client apps lifecycle best practices

i would suggest an autostart/system module entry point which receives messages and runs all the time. you can decide what to do with them without a hurry then.
----------------------------------------------------------
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: 1,650
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: pushenabled client apps lifecycle best practices

Simon,

that's also my opinion to go this way...

 

just wanted to hear from others outside there if this is the recommended way

 

thx

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner