android - How to control a Service from both remote and local? -
i have situation: app has local service(used pool slave devices), app able start or stop pool. however, other authorized apps have ability start or stop pool, , when so, alse passes values service(such slave address). how can control service both remote , local, have conflicts?
if have 2 functions perform start , stop operations in app, like:
public startpool(string address){} public stoppool(string address) {}
then there high chances of conflict if called multiple threads. conflict can handled 2 approach :
- synchronization
- using looper queue request, happens in serial fashion.
Comments
Post a Comment