Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8195567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:10:51+00:00 2026-06-07T05:10:51+00:00

I have two apps between which I want some data exchanged. As they are

  • 0

I have two apps between which I want some data exchanged. As they are running in different processes, so, I am using AIDL to communicate between them. Now, everything is happening really great in one direction (say my apps are A and B) i.e. data is being sent from A to B but, now I need to send some data from B to A.

I noticed that we need to include the app with the AIDL in the build path of app where the AIDL method will be called. So in my case A includes B in its build path. For B to be able to send something to A, by that logic, B would need A in its build path. This would create a cycle.

I am stuck at this point. And I cannot think of a work around this loop.

—-EDIT—-

So, I following the advice mentioned in one of the comments below, I have the following code
In the IPCAIDL project the AIDL file resides,
its contents are

package ipc.android.aidl;
interface Iaidl{
        boolean pushBoolean(boolean flag);
 }

This project is being used as a library in both the IPCServer and the IPC Client.

The IPCServer Project has the service which defines what happens with the AIDL method.
The file is booleanService.java

 package ipc.android.server;

 import ipc.android.aidl.Iaidl;
 import android.app.Service;
 import android.content.Intent;
 import android.os.IBinder;
 import android.os.RemoteException;
 import android.util.Log;

   public class booleanService extends Service {

@Override
public IBinder onBind(Intent intent) {
    return new Iaidl.Stub() {

        @Override
        public boolean pushBoolean(boolean arg0) throws RemoteException {
            Log.i("SERVER(IPC AIDL)", "Truth Value:"+arg0);
            return arg0;
        }
    };
  }

  }

The IPCClient file which calls this method is

   package ipc.android.client2;

   import ipc.android.aidl.Iaidl;
   import android.app.Activity;
   import android.content.ComponentName;
   import android.content.Context;
   import android.content.Intent;
   import android.content.ServiceConnection;
   import android.os.Bundle;
   import android.os.IBinder;
   import android.os.RemoteException;
   import android.view.View;
   import android.widget.Button;

   public class IPCClient2Activity extends Activity {

Button b1;
Iaidl iAIDL;
boolean k = false;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    bindService(new Intent("ipc.android.server.booleanService"), conn, Context.BIND_AUTO_CREATE);
    startService(new Intent("ipc.android.server.booleanService"));

    b1 = (Button) findViewById(R.id.button1);

    b1.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if(k){
                k = false;
            }
            else{
                k = true;
            }
            try {
                iAIDL.pushBoolean(k);
            } catch (RemoteException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }               
        }
    });
}

private ServiceConnection conn = new ServiceConnection() {

    @Override
    public void onServiceDisconnected(ComponentName name) {
        // TODO Auto-generated method stub

    }

    @Override
    public void onServiceConnected(ComponentName name, IBinder service) {
        iAIDL = Iaidl.Stub.asInterface(service);
    }
};
  }

The manifest file for IPCServer includes the declaration of the service. The Manifest file is below

<?xml version="1.0" encoding="utf-8"?>
   <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="ipc.android.server"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="15" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:name=".IPCServerActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <service android:name=".booleanService">
            <intent-filter>
                <action android:name="ipc.android.server.booleanService">
                </action>
            </intent-filter>
            </service>
    </application>

   </manifest>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T05:10:53+00:00Added an answer on June 7, 2026 at 5:10 am

    You only need to include the AIDL specs in both projects (no need to reference all of the other project). You can keep one copy of the AIDL and reference that one copy in both projects. If you’re using Eclipse, find the build path properties and add the directory containing the AIDL as a source directory.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is difference between this two lines, they are in different apps but first
I have two apps that use custom URL schemes to switch between each other.
I have two apps, both of which force the user to use the iPhone
I have two PHP apps which have twho class with the same name. -
Say I have two Java apps that I wrote: Ping.jar and Pong.jar and they
I have two Express.js apps running on my server. A plain vanilla app called
I have a need of implementing two apps that will exchange data with each
I'm using tcp sockets to provide interprocess communication between two apps on Windows XP.
I have to pass parameters between two rails apps. In one side (sender) I
I currently have two apps: app1/ app2/ templates/ app1.html app2.html In app1.html, I'm including

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.