01.11.2014 Views

The AndroidManifest.xml File - 안드로이드 기술 커뮤니티 : Korea ...

The AndroidManifest.xml File - 안드로이드 기술 커뮤니티 : Korea ...

The AndroidManifest.xml File - 안드로이드 기술 커뮤니티 : Korea ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

AIDL (Android Interface Definition Language)<br />

Implementing IPC Using AIDL : Pass by value Parameters using Parcelables<br />

AIDL will use these methods and fields in the code it generates to marshall and unmarshall your<br />

objects.<br />

Here is an example of how the Rect class implements the Parcelable protocol.<br />

import android.os.Parcel;<br />

import android.os.Parcelable;<br />

public final class Rect implements Parcelable {<br />

public int left;<br />

public int top;<br />

public int right;<br />

public int bottom;<br />

public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {<br />

public Rect createFromParcel(Parcel in) { return new Rect(in); }<br />

};<br />

public Rect[] newArray(int size) { return new Rect[size]; }<br />

public Rect() { }<br />

private Rect(Parcel in) { readFromParcel(in); }<br />

public void writeToParcel(Parcel out) {<br />

out.writeInt(left);<br />

out.writeInt(top);<br />

out.writeInt(right);<br />

out.writeInt(bottom);<br />

}<br />

public void readFromParcel(Parcel in) {<br />

left = in.readInt();<br />

top = in.readInt();<br />

right = in.readInt();<br />

bottom = in.readInt();<br />

}<br />

}<br />

// Rect.aidl<br />

package android.graphics;<br />

// Declare Rect so AIDL can find it and knows that it<br />

implements<br />

// the parcelable protocol.<br />

parcelable Rect;<br />

<strong>Korea</strong> Android Community- www.kandroid.org<br />

14

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!