Skip to content

Instantly share code, notes, and snippets.

View PauloLinhares09's full-sized avatar

Paulo Linhares - Packapps PauloLinhares09

  • Packapps
  • Brasil
View GitHub Profile
public class MainActivity extends AppCompatActivity {
IMyAidl iMyAidl;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
public class MainActivity extends AppCompatActivity {
IMyAidl iMyAidl;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
// IMyAid.aidl
package br.com.packapps.aidlclient;
// Declare any non-default types here with import statements
interface IMyAid {
double soma(double a, double b);
}
...
<service
android:name=".MyServiceAidl"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="br.com.packapps.aidlserver.CALL"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</service>
public class MyServiceAidl extends Service {
MyIBind myIBind = new MyIBind();
public MyServiceAidl() {
}
@Override
public IBinder onBind(Intent intent) {
return myIBind;
public class MyServiceAidl extends Service {
public MyServiceAidl() {
}
@Override
public IBinder onBind(Intent intent) {
// TODO: Return the communication channel to the service.
throw new UnsupportedOperationException("Not yet implemented");
}
public class MyServiceAidl extends Service {
public MyServiceAidl() {
}
@Override
public IBinder onBind(Intent intent) {
// TODO: Return the communication channel to the service.
throw new UnsupportedOperationException("Not yet implemented");
}
}
// IMyAidl.aidl
package br.com.packapps.testeaidl;
// Declare any non-default types here with import statements
interface IMyAidl {
double soma(double a, double b);
}
public class MainActivity extends AppCompatActivity {
IMyAidl iMyAidl;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
public class MainActivity extends AppCompatActivity {
IMyAidlInterface aidlInterface;
private ServiceConnection serviceConnection;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);