Making separate service app and separate activity app

by swapnil kamble » Thu, 03 Sep 2009 01:45:20 GMT

Sponsored Links

Now I am using this code to call service as

Intent i = new Intent(ICounterService.class.getName());
ComponentName cn = startService( i );

but I am getting cn as null, ie, service not available.

How do I get list of running services ?

I have installed service with android.


Making separate service app and separate activity app

by swapnil kamble » Thu, 03 Sep 2009 01:46:57 GMT

 Hi All,
         I am new to android. I want to create a service, which will
installed independently. And there will be multiple activity apps
communicating with it, justlike doing IPC. I saw the DualSeviceClient sample
which itself writes a service and communicates with it. But I want to run
service only app separately and activity app separately.

I also tried a separate service wiht my own. I installed it also. Now to
start or stop from activity app I need to call startService (Intent) or
StopService (Intent).

And my problem is how do I know class name package name reqd for intent
before starting or stopping in following code,

Intent i = new Intent();

*i.setClassName( "com.DualServiceOnly",
                "com.DualServiceOnly.DualServiceOnly" );* // How to
associate service here

startService( i );

Is there any sample available for this ?

Thanks in advance.


|| Hare Krishna Hare Krishna Krishna Krishna Hare Hare ||
|| Hare Rama    Hare Rama   Rama   Rama    Hare Hare ||


Sponsored Links

Other Threads

1. Intents and Uris, for Ringtone Picker

I'd like to allow the user to choose a Ringtone from my application,
that I will play later for an alarm. Looking at the javadocs, I see
EXTRA_RINGTONE_DEFAULT_URI in RingtoneManager, and extra that, it
says, is Given to the ringtone picker as a Uri. There is also an
EXTRA_RINGTONE_PICKED_URI that I would get from the returning intent:
Returned from the ringtone picker as a Uri

However, I see no intent.putExtra(String, Uri) function, so no option
to give a Uri. And there is no getUri(String) function in the Bundle
for me to get a Uri in return.

Is the RingtoneManager documentation wrong and it is given and
returned as, say, a String? Or what am I missing?

2. Sms sending App (app to write and send sms in all intercepting all out going sms)

I posted before about wanting to intercept out going sms and
redirecting them but no one seemed to know a way to do this apart from
writing my own app to be used to write the sms's on the phone in the
first place.  So my question is there an open source app out there for
writing and sending sms's that i could just modify as i don't want to
re-invent the wheel and i would prefer not to have to built all the
functionality to look up contacts etc etc.

All i want to do is offer the user a choice of sending all sms's over
the web or the mobile network.  I would have preferred to let them use
their own sms clients but it seems like that is not possible :(

any tips would be great


3. new version of app - is the user notified?

4. Application icon not showing

5. 639,000 Android-based Phones Sold in 4th Quarter

6. Switch the language of all app dynamically!

7. new version of app - does it show on new content?