Listing 117 IAdditional Serviceaidl under the comcookbookadvancerpc

package com.cookbook.advance.rpc;

// Declare the interface. interface IAdditionService {

int factorial(in int value);

After the AIDL file is created, Eclipse generates an file under the gen/ folder when the project is built.The contents of this file should not be modified. It contains a stub class that is needed to implement the remote service.

Inside the first activity, rpcService, an mBinder member is declared as the stub from the IAdditionalService. It can also be interpreted as an IBinder. In the onCreate() method, the mBinder is initiated and defined to call the factorial() function. During the onBind(), it returns mBinder to the caller. After the onBind() is ready, the other process activities are able to connect to the service.This is shown in Listing 11.8.

Character Building Thought Power

Character Building Thought Power

Character-Building Thought Power by Ralph Waldo Trine. Ralph draws a distinct line between bad and good habits. In this book, every effort is made by the writer to explain what comprises good habits and why every one needs it early in life. It draws the conclusion that habits nurtured in early life concretize into impulses in future for the good or bad of the subject.

Get My Free Ebook

Post a comment