No problem. Just a note on Services that is probably important to you. If they do not belong to the current foreground process, they are given quite a low priority rating by the OS, so they will be terminated quite soon if resources get low. Generally for Services that only exist for a small task this will rarely come in to effect but for your long running Services, you are likely going to be effected by this over a period of time.
On Jun 4, 6:41 pm, aayush <abhatnagar192...@gmail.com> wrote: > Thank you Adam, > > you answered my question. I just needed to start my services from one > master service. > > A registration service may need to keep registered to the network for > a finite amount of time (ranging from 1 hour to even a week ! ) The > registration lifetime is governed by the server, so this service will > be a long running one as you observed. However, if the user > deregisters in between, this service will end. > > The call control service will exist only if the registration service > is active (the user needs to be registered to make any calls). > Similarly, for subscribing to server side resources, registration is > again a prerequisite. The call control service 'does something' only > upon user action ( suppose i need to call someone up, or send an > instant message etc). Otherwise, the service will be idle as you > observed. So, I agree with your suggestion that when the service is > idle, the service ends gracefully. > > Thanks for the help. > > aayush > > On Jun 4, 1:26 pm, adamphillips12 <adamphillip...@gmail.com> wrote: > > > > > I'm not quite sure what you're asking but it seems you are not in full > > understanding of Intents. > > > The "action" field is just a string value used with BroadcastReceivers > > and their IntentFilter, it is as named, the description of what action > > to take, it is not for the launching of Services or even Activities. > > For this you use the class property, like so: > > > Intent i = new Intent(); > > i.setClass(context, MyService.class); > > context.startService(i); > > //or context.startService(new Intent(context, MyService.class)); > > > You can also use the setComponent() and various other things but that > > is the simplest way to start a Service. I hope that helps, though I > > have to mention, your application design sounds very bad, 3 long > > running services from app launch till terminate? This is not very > > considerate of other applications, your services do not need to exist > > if they are not doing anything. Also you should not rely on being told > > when your application process is being shutdown, there is no guarantee > > you're going to get this message. > > > On Jun 4, 6:02 pm, aayush <abhatnagar192...@gmail.com> wrote: > > > > Hello, > > > > I had some conceptual doubts about Intents. Let me explain it with > > > respect to one of my upcoming applications: > > > > The application will be having three major logical facets: The call > > > control part, registration part and subscriptions (to a resource on > > > the remote server). > > > > I am thinking of designing these three logical facets as individual > > > android services. > > > > On application startup, i am thinking of creating a master > > > bootstrapping service, that invokes these other 3 services and starts > > > them up. Similarly, when the application needs to shut down, this > > > master service will perform the shutdown procedures. > > > > For doing so, i will need to use Intents as per the developer guide. > > > ( startService(Intent) for starting my services and stopService > > > (Intent) for stopping my services respectively). > > > > As my requirement is only to signal the service and start it, i will > > > specify the absolute class name of the target service to be started. > > > > My doubt comes here. The Intent object has 2 characteristics: action > > > and data. As my 3 logical services described above, do not have a UI > > > component (will be handled separately), providing an action is not > > > relevant for this use case. Data has to be represented as a URI. So > > > will the class name of the target service be specified as a URI ? > > > Secondly, class name here implies the entire package namespace of the > > > class (org.test....) ? > > > > Thanks in advance > > > > aayush --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---