aidl

Android: Task or application equivalent of onPause

My application uses a remote service to play audio. I do this so that no activity owns the playback of the audio - the user can trigger some audio to be played from one Activity, and the audio will continue to play as they navigate around the app. I do, however, want to tell the service to pause or stop playing audio when the user "unl...

How do I use AIDL tool from command line using SDK sample code?

My question concerns using aidl.exe (on a Windows system) from the command line. This question has nothing to do with Eclipse, Netbeans, etc. Included with the Android SDK are the following three AIDL definition files: IRemoteService.aidl IRemoteServiceCallback.aidl ISecondary.aidl located in the following directory: C:\androi...

Android - Using method from a Service in an Activity?

I have the folowing method in a Service in my appplication: public void switchSpeaker(boolean speakerFlag){ if(speakerFlag){ audio_service.setSpeakerphoneOn(false); } else{ audio_service.setSpeakerphoneOn(true); } } So my question is whats the best and most effective way to be able...

Best way for Service that starts Activity to communicate with it

I have a service that listens to a socket. When receiving certain input it is to create an activity. When receiving other input, it is to kill this activity. I have struggled for a while to make the service communicate with the activity through AIDL (http://developer.android.com/guide/developing/tools/aidl.html), but this seems to not be...

Android - AIDL gen files causing warnings?

Hi, I have created some aidl files for IPC in my Android project. They compile and run file however in the generated .java files I am getting warnings of un-used imports as follows: The import android.os.Binder is never used EngineInterface.java /gen/com//phone/engine line 10 Java Problem Now I presume that they are there for a...

How to get a modified generated Android IInterface file in an apk?

I'd like to add a step to the Android build process in Eclipse, which will modify the generated IInterface files that are based on aidl files. I've written a custom rewriter, which does the rewriting. I inserted this rewriter as a custom builder in Eclipse between the Android Pre Compiler and the Java Builder. The problem is that the ...

Can't bind to Service

Hi I have an aidl file defined as follows: package com.erbedo.callalert; interface RemoteCallAlert { void notifyCallEnded(); } The service is: package com.erbedo.callalert; public class CallAlert extends Service { Filter callListener; private final RemoteCallAlert.Stub mBinder = new RemoteCallAlert.Stub() { ...

AIDL: Stub class methods not being called

Hello, I am using AIDL to pass objects from an Activity to a Service and am getting some strange behavior. To my understanding, the idea behind AIDL is to create an interface in a .aidl file, which android will then implement (partially) in a dynamically generated class. Android will create an abstract class called Stub, which you the...

Callback from another thread causes an exception

I'm trying to create a simple multiplayer game. There's a WorkerService which is supposed to handle all network communication and all interaction between this service and my Activities is done with AIDL. I think this is a standard approach - to enable two way interaction I use also an IWorkerCallback interface (also AIDL). The problem i...

How to pass Remote Interface (aidl) throughout Activities ?

Hi All, I am developing an application using services and Remote interface. I have a question about passing the reference of my Remote interface throughout Activities. In my first Activity, I bind my service with my activity, in order to get a reference to my interface I use private ServiceConnection mConnection = new ServiceConnec...

Android remote service doesn't call service methods

Hello, I'm developing a GPS tracking software on android. I need IPC to control the service from different activities. So I decide to develop a remote service with AIDL. This wasn't a big problem but now it's always running into the methods of the interface and not into those of my service class. Maybe someone could help me? Here my AI...

Does oneway declaration in Android .aidl guarantee that method will be called in a separate thread?

I am designing a framework for a client/server application for Android phones. I am fairly new to both Java and Android (but not new to programming in general, or threaded programming in particular). Sometimes my server and client will be in the same process, and sometimes they will be in different processes, depending on the exact use ...

Android RemoteExceptions and Services

So I've written a Service and an Activity for the Android OS. My service is running in it's own process, so all the communication between my Activities and the Service happens via IPC. I use the standard Android .aidl mechanism for this. So far everything works fine. However, the AIDL generates all method stubs using "throws RemoteExc...

Android - Service with Application lifecycle

I am trying to create a Servicefor my application which will negotiate Bluetooth connections and data. I want this service's lifecycle to start and end with the Application, but still be able to have specific Activities listen for events that occur within this service (in addition an Activty should be able to call specific methods of the...

Is it possible to remotely call methods on another computer through AIDL (Android Interface Definition Language)?

I am curious whether the AIDL only serves for inter-process communication between several Android apps on the same device, or AIDL provides much wider functionality. Let's say I have a Java application running on some server, is it possible to remotely call methods on that server through AIDL from an Android phone? If yes, do I need som...

When to use an aidl based service?

Under what circumstances would using AIDL to define a service interface be the correct decision (rather than just creating an extension to the service class)? ...

Bytearray of large size over AIDL interface

Is it recommended to send large amounts of data as parameter in AIDL interface.?I have a remote service that fetches the data using REST network calls and sends data over AIDL callback to caller. Sometimes the data fetched from network can be a image data which is several kilobytes. What is the best way to send the data to the caller.? ...

Android - Updating TextView String through AIDL Service

Hello, I have an app that uses a TabHost. Several of the Tabs share a common HUD. I am using a service to periodically update those values by calling an AIDL function when ready. However, since several of the Tabs are using the same HUD I would like to abstract that part out. I thought about having the HUD.xml use a String resource as...

GREF increasing / decreasing in multi-threaded service (aidl) - what does it mean?

I have an android activity and a service implemented using aidl. Works like a champ, I have a callback setup to pass some thread notifications back to the UI, and that appears to work fine, with the exception of lots of GREF has increased to 101, 201,301,401, 501.. etc, and GREF has decreased. I did some searching online and found that ...

Aidl callback interface implementing another callback interface

I have a service with AIDL callbacks. I would like to know if it is possible to make an AIDL callback implement another AIDL callback in order to avoid multiple callback register For example : A.aidl : interface A { void doSomething(); } B.aidl : interface B implements A { void doSomethingMore(); } IService.aidl : interfac...