declaring a service

by Mina Shokry » Sat, 26 Sep 2009 03:50:48 GMT

Sponsored Links

I am trying to run service example. I declare a service in a project
and want to call the service from an activity that exists in another

in first project, my AndroidManifest.xml looks like this
<manifest xmlns:android="" ;
                <service android:exported="true" 
android:name=".CalculatorService" /

the CalculatorService class extends the Service class and its onBind
method looks like this
public IBinder onBind(Intent intent) {
        if(calculator == null) {
                calculator = new CalculatorImpl();
        return calculator;

The CalculatorImpl class extends Calculator.Stub class and is generated from Calculator.aidl.

in the other project, in the activity onCreate there is a code like

Intent intent = new Intent(Calculator.class.getName());
boolean connected = bindService(intent, connection, BIND_AUTO_CREATE);

the method bindService returns false. what is missing in my both

note: the file is shared between both projects by a

thanks in advance.

Other Threads

1. Flip-book animation of map overlays to show time dependent images

Hi Roland,
can you post your solution? I've followed that link but without



2. General Question.....

Hi All,

You known How many application participate yet for ADC....


3. Developing distributed applications using Android

4. Eclipse Europa 3.3 on Win. XP

5. setWallpaper

6. GmmGeocoder - Latitude Longitude Span not working

7. ListView selection problem (with highlighting/selecting first element)