Example usage for android.os Parcel writeInt

List of usage examples for android.os Parcel writeInt

Introduction

In this page you can find the example usage for android.os Parcel writeInt.

Prototype

public final void writeInt(int val) 

Source Link

Document

Write an integer value into the parcel at the current dataPosition(), growing dataCapacity() if needed.

Usage

From source file:org.droid2droid.internal.AbstractRemoteAndroidImpl.java

@Override
public boolean pingBinder(int connid, int oid, long timeout) throws RemoteException {
    if (D)//from  ww  w. j  a v  a2s .com
        Log.d(TAG_CLIENT_BIND, PREFIX_LOG + "pingBinder...");
    if (!isBinderAlive())
        return false;
    Parcel data = Parcel.obtain();
    Parcel reply = Parcel.obtain();
    try {
        data.writeInt(oid);
        transactRemoteAndroid(getConnectionId(), PING_BINDER, data, reply, 0, timeout);
        return reply.readByte() == 1;
    } finally {
        if (data != null)
            data.recycle();
        if (reply != null)
            reply.recycle();
    }
}

From source file:com.wellsandwhistles.android.redditsp.reddit.things.RedditSubreddit.java

public void writeToParcel(final Parcel out, final int flags) {
    out.writeString(header_img);/*from ww w .j  a va 2 s.c o m*/
    out.writeString(header_title);
    out.writeString(description);
    out.writeString(description_html);
    out.writeString(public_description);
    out.writeString(id);
    out.writeString(name);
    out.writeString(title);
    out.writeString(display_name);
    out.writeString(url);
    out.writeLong(created);
    out.writeLong(created_utc);
    out.writeInt(accounts_active == null ? -1 : accounts_active);
    out.writeInt(subscribers == null ? -1 : subscribers);
    out.writeInt(over18 ? 1 : 0);
}

From source file:org.droid2droid.internal.AbstractRemoteAndroidImpl.java

@Override
public boolean isBinderAlive(int connid, int oid, long timeout) throws RemoteException {
    if (D)/*  w  ww . j a  v  a  2  s. c o  m*/
        Log.d(TAG_CLIENT_BIND, PREFIX_LOG + "isBinderAlive...");
    if (!isBinderAlive()) {
        if (E)
            Log.e(TAG_CLIENT_BIND, PREFIX_LOG + "Binder is not alive");
        throw new RemoteException();
    }
    Parcel data = Parcel.obtain();
    Parcel reply = Parcel.obtain();
    try {
        data.writeInt(oid);
        transactRemoteAndroid(getConnectionId(), IS_BINDER_ALIVE, data, reply, 0, timeout);
        return reply.readByte() == 1;
    } finally {
        if (data != null)
            data.recycle();
        if (reply != null)
            reply.recycle();
    }
}

From source file:com.fanfou.app.opensource.api.bean.Status.java

@Override
public void writeToParcel(final Parcel dest, final int flags) {
    dest.writeString(this.id);
    dest.writeString(this.ownerId);
    dest.writeLong(this.createdAt.getTime());
    dest.writeInt(this.type);

    dest.writeString(this.text);
    dest.writeString(this.simpleText);
    dest.writeString(this.source);

    dest.writeString(this.inReplyToStatusId);
    dest.writeString(this.inReplyToUserId);
    dest.writeString(this.inReplyToScreenName);

    dest.writeString(this.photoImageUrl);
    dest.writeString(this.photoLargeUrl);
    dest.writeString(this.photoThumbUrl);

    dest.writeString(this.userId);
    dest.writeString(this.userScreenName);
    dest.writeString(this.userProfileImageUrl);

    dest.writeInt(this.truncated ? 1 : 0);
    dest.writeInt(this.favorited ? 1 : 0);
    dest.writeInt(this.self ? 1 : 0);

    dest.writeInt(this.isRead ? 1 : 0);
    dest.writeInt(this.isThread ? 1 : 0);
    dest.writeInt(this.hasPhoto ? 1 : 0);

    dest.writeInt(this.special ? 1 : 0);

}

From source file:com.ksk.droidbatterybooster.provider.TimeSchedule.java

@Override
public void writeToParcel(Parcel p, int flags) {
    p.writeLong(id);//  w w w . j a v  a2  s  . co  m
    p.writeInt(enabled ? 1 : 0);
    p.writeInt(hour);
    p.writeInt(minutes);
    p.writeInt(daysOfWeek.getCoded());
    p.writeLong(time);
    p.writeLong(modeId);
}

From source file:com.eTilbudsavis.etasdk.model.Share.java

public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(this.mName);
    dest.writeString(this.mEmail);
    dest.writeString(this.mAccess);
    dest.writeString(this.mShoppinglistId);
    dest.writeByte(mAccepted ? (byte) 1 : (byte) 0);
    dest.writeString(this.mAcceptUrl);
    dest.writeInt(this.mSyncState);
}

From source file:org.droid2droid.internal.AbstractRemoteAndroidImpl.java

/** Send transactions to remote cloud. */
@Override/*from   w w  w.  j a v  a2  s  .  c om*/
public int bindOID(int connid, int serviceConnectionOID, Intent intent, int flags, ComponentName[] name,
        long timeout) throws RemoteException {
    if (D)
        Log.d(TAG_CLIENT_BIND, PREFIX_LOG + "BindOID...");
    Parcel data = Parcel.obtain();
    Parcel reply = Parcel.obtain();
    try {

        data.writeInt(serviceConnectionOID);
        NormalizeIntent.writeIntent(intent, data, 0);
        data.writeInt(flags);
        transactRemoteAndroid(connid, BIND_OID, data, reply, 0, timeout);
        if (D)
            Log.d(TAG_CLIENT_BIND, PREFIX_LOG + "BindOID ok");
        name[0] = (ComponentName) reply.readParcelable(ComponentName.class.getClassLoader());
        return reply.readInt();
    } finally {
        if (data != null)
            data.recycle();
        if (reply != null)
            reply.recycle();
    }
}

From source file:org.droid2droid.internal.AbstractRemoteAndroidImpl.java

@Override
public void finalizeOID(int connid, int oid, long timeout) {
    if (oid == 0) {
        if (E)//from w w w .  ja v  a 2  s .  c om
            Log.e(TAG_CLIENT_BIND, PREFIX_LOG + "FinalizeOID with oid=0!");
        return;
    }
    if (!isBinderAlive())
        return;
    Parcel data = Parcel.obtain();
    Parcel reply = Parcel.obtain();
    try {
        data.writeInt(oid);
        transactRemoteAndroid(getConnectionId(), FINALIZE_OID, data, reply, 0, timeout);
        return;
    } catch (RemoteException e) {
        if (V)
            Log.v(TAG_CLIENT_BIND, PREFIX_LOG + "FinalizeOID", e);
    } finally {
        if (data != null)
            data.recycle();
        if (reply != null)
            reply.recycle();
    }

}

From source file:tv.yatse.plugin.avreceiver.api.PluginCustomCommand.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(PARCELABLE_VERSION);
    dest.writeLong(mId);/*from  ww  w. j a  v  a  2  s . c  om*/
    dest.writeInt(mColor);
    dest.writeString(mDescription);
    dest.writeInt(mDisplayOrder);
    dest.writeString(mIcon);
    dest.writeString(mParam1);
    dest.writeString(mParam2);
    dest.writeString(mParam3);
    dest.writeString(mParam4);
    dest.writeString(mParam5);
    dest.writeInt(mReadOnly ? 1 : 0);
    dest.writeString(mSource);
    dest.writeString(mTitle);
    dest.writeInt(mType);
    dest.writeString(mUniqueId);
}

From source file:com.frodo.github.bean.dto.request.RepoRequestDTO.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(this.name);
    dest.writeString(this.description);
    dest.writeString(this.homepage);
    dest.writeByte(isPrivate ? (byte) 1 : (byte) 0);
    dest.writeByte(has_issues ? (byte) 1 : (byte) 0);
    dest.writeByte(has_wiki ? (byte) 1 : (byte) 0);
    dest.writeByte(has_downloads ? (byte) 1 : (byte) 0);
    dest.writeString(this.default_branch);
    dest.writeByte(auto_init ? (byte) 1 : (byte) 0);
    dest.writeString(this.gitignore_template);
    dest.writeString(this.license_template);
    dest.writeInt(this.team_id);
}