Android Question Using Service to support socket listener

Markos

Active Member
Licensed User
Longtime User
Hi Again,

I have a TCP listener activity and I want to make it work even if the phone goes to asleep or locked or in power saving. Will a Service accomplish this? If so How will I keep the listener alive as it must be up constantly to receive a communication as quickly as it receives a request of message.

thanks
 

Markos

Active Member
Licensed User
Longtime User
I think I better explain how my app works.

It is triggered by b4aobject.Listen

this then activates a server socket listener that fires events as required. The listener pauses as the activity pauses. I want to have it immue from this pausing activity. One further point is as each new connection is extablished it is managed by these same events that have their respective code in the events. How will a service keep the listener alive and all these events? By relaunching the Listener command? Will that not destroy all existing connections?
 
Upvote 0

Markos

Active Member
Licensed User
Longtime User
The listener is a secure socket layer library using the functions and events from the standard Network library for b4a. I know must be an easy way to achieve this but I much rather talk to those who are more experienced to give me a head start ..
 
Upvote 0
Top