Android service architecture question -


i'm new android , i'm porting iphone app did. i've been reading on android services , useful network component of app. assume there common pattern i'm trying do, here details:

  1. user1 , user2 agree enter virtual room.
  2. they send messages each other , notified when receive messages.

i'm using remote server handle communication. basically, need 3 methods. 1 add users room, 1 send messages , 1 messages. nothing special.

what i'd have 1 service accepts few paramaters. 1 being web service method call, rest being parameters need passed respective web services. i'd prefer approach having different service each method call. suggestions on best approach? i'm not clear on how pass parameters services.

btw, not question polling, callbacks or broadcasting. i'm aware of those. want know if it's feasible pass variable amount of parameters service, or there perhaps else should into.

sure, read intents, context.sendbroadcast() , broadcastreceivers. it's quite easy. sample out code:

intent = new intent("com.domain.app.intent.status"); i.putextra("app", "com.domain.app.android.activityorserviceoftarget"); i.putextra("status", "some variable data, e.g. string"); sendbroadcast(i); 

Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -