• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps How does a Bound Service Provide Network Communication?

Damosull

Lurker
Hi,

I have started studying android development this year, and am currently looking at Bound Services.

Our lecturer has asked us to look at how Bound Services provide background processing & network communication.

I have been able to find out how it provides background processing, but not network communication.

Can you guys please help me with this issue, I'd really appreciate it?

Thanks a lot for any help in advance,

Damosull.
 
Can you explain further what you mean by 'provide network communication'? Does the service need to connect with a remote system over the network?
 
Hi LV426,

Thanks for the response.

Apologies for the question being unclear.

But this is the exact question which I was given:

Describe in detail how a bound service may be used to provide background processing and network communication to an Android application. Provide code examples where appropriate.

Would you know of some simple examples of communicating using a bound service?
 
Have a look at this for an explanation of Bound Services

https://developer.android.com/guide/components/bound-services.html

What part of the question are you struggling with? The above link gives you code samples of how to implement and use a service.

If you want examples of network comms, then look here

https://developer.android.com/training/basics/network-ops/connecting.html

Although the examples are geared towards network comms within AsyncTask, which is how it's usually achieved.

Thanks, I really appreciate the help.

Well I found a 'Bound Services' Youtube tutorial that went through how to use a service to display the current time on a button click.

Would that example be an example of background processing?
 
Back
Top Bottom