hello,

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
project.

in first project, my AndroidManifest.xml looks like this
<manifest xmlns:android="http://schemas.android.com/apk/res/android";
     package="com.mypackage.service_server">
        <application>
                <service android:exported="true" 
android:name=".CalculatorService" /
>
        </application>
</manifest>

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
Calculator.java is generated from Calculator.aidl.

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

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
projects?

note: the Calculator.java file is shared between both projects by a
symlink.

thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to