SRemoteInterface.aidl
package com.gone.remote;
interface SRemoteInterface {
 int getAdd(int a , int b);
}

Remote.java
public class Remote extends Activity implements ServiceConnection{
 SRemoteInterface remoteInterface = null;
 public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.main);
      startService(new Intent(SRemoteService.SERVICE_PACKAGE));
     try {
          int c = remoteInterface.getAdd(20, 30);
          Log.i("Result", String.valueOf(c));
      } catch (RemoteException e) {
           e.printStackTrace();
      }
    
 }
 public void onServiceConnected(ComponentName name, IBinder service) {
           remoteInterface = SRemoteInterface.Stub.asInterface(service);
 }
 public void onServiceDisconnected(ComponentName name) {
          remoteInterface = null;
 }
}
SRemoteService.java
public class SRemoteService extends Service {
      public static final String SERVICE_PACKAGE = "com.gone.SRemoteService.SERVICE";

      public void onCrete(){
           super.onCreate();
      }
      public void onStart(Intent intent , int startId){
            super.onStart(intent, startId);
       }

      SRemoteInterface.Stub remoteInterface = new SRemoteInterface.Stub() {
             public int getAdd(int a, int b) throws RemoteException {
             return a+b;
       }
       public IBinder onBind(Intent intent) {
          return remoteInterface;
      }
 };
}


미니페스트

<service
   android:enabled="true"
   android:name=".SRemoteService">
   <intent-filter>
    <action android:name="com.gone.remote.SRemoteInterface" />
   </intent-filter>
  </service>
이부분 만 추가 했습니다.

이렇게 하고 실행을 하니
Sorry ! The application han stopped unexpectedly 라는 경고창이 나옵니다.


도저히 어디가 어떻게 잘못 된건지 감을 못 잡겠습니다.

무엇이 틀릴 것 인가요???