Skip to content

Instantly share code, notes, and snippets.

@zodani
Created December 15, 2016 02:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zodani/f07081ab683fae2de45ac0b90fcb709f to your computer and use it in GitHub Desktop.
Save zodani/f07081ab683fae2de45ac0b90fcb709f to your computer and use it in GitHub Desktop.
aidl server service
public class ServerService extends Service {
@Nullable
@Override
public IBinder onBind(Intent intent) {
return new CalculatorServiceImpl();
}
@Override
public void onCreate() {
super.onCreate();
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
return super.onStartCommand(intent, flags, startId);
}
private static class CalculatorServiceImpl extends ICalculator.Stub {
@Override
public int sum(int a, int b) throws RemoteException {
return a + b;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment