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. <WTA> Update rom cyan

kk mw nny klo mw update cyan apakah tnggal aplly aja stelah donlot dgn cm
updater sblumnya saia menggunakan cyan 4.2.5 mw gnt ke
mhon pencerahan

Google Groups "Indonesian Android Community [id-android]" group.

To post to this group, send email to

To request to subscribe to this group:


2. When call mWifiManager.isWifiEnabled , it crash. thanks in advance.

Have you added the permission to read the wifi state?
Can you post the exception that is thrown?


3. Android around 2


5. When call mWifiManager.isWifiEnabled , it crash. thanks in advance.

6. Using Adapters

7. Android Framework and Kernel Develope