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. Know if my Alarm is active


Is there a way to know if a previously set alarm is still active and
ready to go off? I'm currently saving the alarm state in a
SharedPreferences but it would be a lot more reliable to be able to
directly check on the alarm itself.

Trying to detect this scenario:
-Service schedules the alarm
-User "cleverly" kills the service/app thus killing the alarm with it
-Service stops updating until user boot the phone

I want to check within the app, I know that if A and B are true then
an alarm should be ready to go off at some point in the future....




2. how to maintain consistent UI over multiple versions of Android OS skinned by carriers and hardware manufacturers

Hello All!

I would like to know if its possible to prevent my application from
looking different every time I run it on a different android phone.
For example, on stock 2.2, my seek bar (with default values and theme)
has an orange color for the selected portion, whereas on a Samsung
Galaxy S (with 2.1), it is green. Also the tab background is grey in
stock 2.2, but blue in Galaxy S. On a similar note, my rating bar
changes size too.

I do not implement multiple screen resolutions and all my drawables
are located in the "drawables" folder under "res". I donot specify a
minimum sdk requirement, and I

Thanks in advance!


3. Comprehensive list of Android devices?

4. problem with AsyncTask

5. Adding my menu item to any text box' menu

6. EditText in a simple Activity

7. android in vmware the battery is getting low less than 15% remaining