Created
December 15, 2016 02:36
-
-
Save zodani/f07081ab683fae2de45ac0b90fcb709f to your computer and use it in GitHub Desktop.
aidl server service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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