1

I have 2 * different projects* within the same workspace in eclipse (most AIDL examples handle different processes within the same project). Project A is simply HelloWorld, that just displays the sum of 2 numbers. I'm calling this remotely from a client called MyFirstApp to display it.

Problem: The onServiceConnected() method is never invoked.

What I've tried so far:

1) Manifest file has android:process=":remote"> tag. Intent filter is present. AND YES, ALL OF IT IS WITHIN THE application tag. Here it is:

<service android:name=".ArithmeticService"
 android:process=":remote">
 <intent-filter >
 <action android:name="com.example.helloworld.ArithmeticService"/>
 </intent-filter>
 </service>
 </application>

2) In my ArithmeticService, the function onBind() does not simply return Null, but returns mBinder. Here it is:

@Override
 public IBinder onBind(Intent intent) {
 // Return the interface
 Log.d(getClass().getSimpleName(),"IBinder");
 return mBinder;
 }

3) At client-side, the implementation of the interface is in the same package at the server side.

4) In the onCreate() function of my client's MainActivity, I'm calling the function initConnection(), which is as follows:

void initConnection(){
 mServiceConnection = new ServiceConnection() {
 @Override
 public void onServiceDisconnected(ComponentName name) {
 // TODO Auto-generated method stub
 mService = null;
 Toast.makeText(getApplicationContext(), "no", Toast.LENGTH_SHORT).show();
 Log.d("IRemote", "Binding - Service disconnected");
 }
 @Override
 public void onServiceConnected(ComponentName name, IBinder service)
 {
 // TODO Auto-generated method stub
 mService = IRemote.Stub.asInterface((IBinder) service);
 Toast.makeText(getApplicationContext(), "yes", Toast.LENGTH_SHORT).show();
 Log.d("IRemote", "Binding is done - Service connected");
 }
 };
 if(mService == null)
 {
 Intent it = new Intent();
 it.setAction("com.example.helloworld.ArithmeticService");
 //binding to remote service
 bindService(it, mServiceConnection, Service.BIND_AUTO_CREATE);
 }
}

Rest of the code is pretty simple. On click of a button, the remote server should be invoked and the sum of 2 numbrs should be displayed.

Any Help shall be very appreciated.

asked Sep 11, 2013 at 12:03
1
  • The Error I get is, "Unable to start service intent {act=com.example.helloworld.ArithmeticService} U=0 Not found Commented Sep 12, 2013 at 6:08

1 Answer 1

1

Got it after days of trying: The name of the project should be in small-case. Is it an Eclipse quirk, or Android quirk ? I don't know. BUT IT WORKS.

answered Sep 12, 2013 at 10:11
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.