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.

-- 
...Swapnil

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

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Return value for a PendingIntent launched via a Notification

Hello Mark,

Yes thanks, this is what I ended up doing in the end.

Serge





> 

2. VideoView causing an error

I am attempting to make a VideoView to obviously play videos on. When
I use the following code though I get the error "Cannot cast from View
to VideoView" on the marked line below.

public class VideoView extends Activity {

        private String video_link;
        private VideoView video_view;

        @Override
        public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.youtube_player);

                video_view = (VideoView) findViewById(R.id.video_view); ***ERROR
"Cannot cast from View to VideoView"

                Bundle video_bundle = getIntent().getExtras();
                video_link = video_bundle.getString("LINK");

        }

}

I have pretty much copied exactly what is shown in the API Demo
included in the SDK. Not sure what I've done wrong.

-- 

3. Implement Camera Support for Android Emulator using Web Cam

4. Starting activity witouth window from widget

5. CM-5.0.6 Stable!

6. Emulator disconnected

7. calling an existing app with an intent