Hallo, i have made an application that is consisted of an activity and a service.The service has an interface (created by an aidl file) including methods implemented in the service.My activity binds to the service and calls some methods of the service.All good till now.My problem is when i want to bind to a service that belongs to a different package from my activity.My activity doesn't have visibility of the remote interface and i cannot import it :
public class Client extends Activity { /** Called when the activity is first created. */ IGps mservice=null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Intent i=new Intent(); i.setComponent(new ComponentName("aexp.share.sharedapp3", "aexp.share.sharedapp3.Service_impl")); bindService(i, conn, Context.BIND_AUTO_CREATE); } ServiceConnection conn=new ServiceConnection() { @Override public void onServiceDisconnected(ComponentName name) { Log.e("TAG","DISCONNECTED"); } @Override public void onServiceConnected(ComponentName name, IBinder service) { mservice=IGps.Stub.asInterface(service); try { double a=mservice.getLat(); String a_str=Double.toString(a); Log.e("TAG",a_str); } catch(RemoteException e) { } } }; } Here i cannot see the IGps interface,Am i doing something wrong? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en