Example usage for android.os Parcel writeString

List of usage examples for android.os Parcel writeString

Introduction

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

Prototype

public final void writeString(String val) 

Source Link

Document

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

Usage

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

protected final void updateData(Parcel data) // TODO: a placer plutot cot serveur
{
    if (UPDATE_PARCEL) {
        int v = VERSION.SDK_INT;
        data.setDataPosition(0);/*from w  ww.ja  v a 2s  .  com*/
        if (v >= 10) // Gingerbread_MR1+
        {
            data.readInt();
        }
        String enforceInterfaceName = data.readString(); // Read the interface name (see Parcel.cpp)
        assert (enforceInterfaceName != null);
        byte[] bufDatas = data.marshall(); // Return all the buffer (with the specific enforceInterface
        int startDatas = data.dataPosition(); // Position after the first string

        // Create a new one with interface name + buffers
        Parcel p = Parcel.obtain();
        p.setDataPosition(0);
        p.writeString(enforceInterfaceName);
        int sizeInterface = p.dataPosition();
        byte[] bufInterface = p.marshall(); // Part of buffer only for the string
        p.recycle();

        // Extract the rest of the buffer
        byte[] result = new byte[sizeInterface + bufDatas.length - startDatas];
        System.arraycopy(bufInterface, 0, result, 0, sizeInterface);
        System.arraycopy(bufDatas, startDatas, result, sizeInterface, bufDatas.length - startDatas);
        data.unmarshall(result, 0, result.length);
    }
}

From source file:saphion.batterycaster.providers.Alarm.java

public void writeToParcel(Parcel p, int flags) {
    p.writeLong(id);/*from ww  w.  j a va 2s .  c  om*/
    p.writeInt(enabled ? 1 : 0);
    p.writeInt(battery);
    p.writeInt(charge);
    p.writeInt(daysOfWeek.getBitSet());
    p.writeInt(vibrate ? 1 : 0);
    p.writeString(label);
    p.writeParcelable(alert, flags);
    p.writeInt(deleteAfterUse ? 1 : 0);
}

From source file:com.marianhello.cordova.bgloc.Config.java

public void writeToParcel(Parcel out, int flags) {
    out.writeFloat(getStationaryRadius());
    out.writeInt(getDistanceFilter());//from   ww  w .  j  a  v  a  2 s . c o m
    out.writeInt(getDesiredAccuracy());
    out.writeValue(isDebugging());
    out.writeString(getNotificationTitle());
    out.writeString(getNotificationText());
    out.writeString(getLargeNotificationIcon());
    out.writeString(getSmallNotificationIcon());
    out.writeString(getNotificationIconColor());
    out.writeValue(getStopOnTerminate());
    out.writeValue(getStartOnBoot());
    out.writeValue(getStartForeground());
    out.writeInt(getServiceProvider().asInt());
    out.writeInt(getInterval());
    out.writeInt(getFastestInterval());
    out.writeInt(getActivitiesInterval());
    out.writeString(getUrl());
    out.writeString(getMethod());
    out.writeSerializable(getHeaders());
    out.writeSerializable(getParams());
}

From source file:com.tlongdev.bktf.model.Item.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(defindex);/*from  w ww. j  a v  a 2 s. co  m*/
    dest.writeString(name);
    dest.writeInt(quality);
    dest.writeByte((byte) (tradable ? 1 : 0));
    dest.writeByte((byte) (craftable ? 1 : 0));
    dest.writeByte((byte) (australium ? 1 : 0));
    dest.writeInt(priceIndex);
    dest.writeInt(weaponWear);
    dest.writeParcelable(price, flags);
}

From source file:io.openkit.OKLeaderboard.java

@Override
public void writeToParcel(Parcel out, int flags) {
    //private String name;
    out.writeString(name);
    //private int OKAPP_id;
    out.writeInt(OKAPP_id);// w  w  w  .  j a v a 2  s .c o  m
    //private int OKLeaderboard_id;
    out.writeInt(OKLeaderboard_id);
    //private LeaderboardSortType sortType;
    out.writeString((sortType == null) ? "" : sortType.name());
    //private String icon_url;
    out.writeString(icon_url);
    //private int playerCount;
    out.writeInt(playerCount);
}

From source file:io.github.hidroh.materialistic.data.HackerNewsItem.java

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeLong(id);//w  w  w.ja  va2s  .co m
    dest.writeString(title);
    dest.writeLong(time);
    dest.writeString(by);
    dest.writeLongArray(kids);
    dest.writeString(url);
    dest.writeString(text);
    dest.writeString(type);
    dest.writeInt(favorite ? 1 : 0);
    dest.writeInt(descendants);
    dest.writeInt(score);
    dest.writeInt(favorite ? 1 : 0);
    dest.writeInt(viewed ? 1 : 0);
    dest.writeInt(localRevision);
    dest.writeInt(level);
    dest.writeInt(dead ? 1 : 0);
    dest.writeInt(deleted ? 1 : 0);
    dest.writeInt(collapsed ? 1 : 0);
    dest.writeInt(contentExpanded ? 1 : 0);
    dest.writeInt(rank);
    dest.writeInt(lastKidCount);
    dest.writeInt(hasNewDescendants ? 1 : 0);
    dest.writeLong(parent);
    dest.writeInt(voted ? 1 : 0);
    dest.writeInt(pendingVoted ? 1 : 0);
    dest.writeLong(next);
    dest.writeLong(previous);
}

From source file:com.scvngr.levelup.core.net.LevelUpResponse.java

@Override
public void writeToParcel(final Parcel dest, final int flags) {
    super.writeToParcel(dest, flags);
    dest.writeString(mStatus.name());
    dest.writeTypedList(mServerErrors);// www.  j a  v a 2  s . c  o m
    dest.writeSerializable(mServerErrorReadError);
    dest.writeParcelable(mOriginalResponse, flags);
}

From source file:com.android.emailcommon.provider.HostAuth.java

/**
 * Supports Parcelable//from w  w  w.j a  v  a2  s  .  co m
 */
@Override
public void writeToParcel(Parcel dest, int flags) {
    // mBaseUri is not parceled
    dest.writeLong(mId);
    dest.writeString(mProtocol);
    dest.writeString(mAddress);
    dest.writeInt(mPort);
    dest.writeInt(mFlags);
    dest.writeString(mLogin);
    dest.writeString(mPassword);
    dest.writeString(mDomain);
    dest.writeString(mClientCertAlias);
    if ((mFlags & FLAG_OAUTH) != 0) {
        // TODO: This is nasty, but to be compatible with backward Exchange, we can't make any
        // change to the parcelable format. But we need Credential objects to be here.
        // So... only parcel or unparcel Credentials if the OAUTH flag is set. This will never
        // be set on HostAuth going to or coming from Exchange.
        dest.writeLong(mCredentialKey);
        if (mCredential == null) {
            Credential.EMPTY.writeToParcel(dest, flags);
        } else {
            mCredential.writeToParcel(dest, flags);
        }
    }
}

From source file:com.sayar.requests.RequestArguments.java

public void writeToParcel(final Parcel dest, final int flags) {
    dest.writeString(this.method.toValue());
    dest.writeString(this.url);
    dest.writeString(this.userAgent);
    dest.writeString(this.parseAs);
    final Bundle params = new Bundle();
    params.putSerializable("map", (Serializable) this.params);
    dest.writeBundle(params);/*from  www.  j  a v  a 2  s .  c o m*/

    final Bundle headers = new Bundle();
    params.putSerializable("map", (Serializable) this.headers);
    dest.writeBundle(headers);
}

From source file:com.amossys.hooker.common.InterceptEvent.java

private void writeReturnsEntry(Parcel out) {
    if (returns == null) {
        out.writeInt(0);//w  w w .ja v  a  2s.  c o m
    } else {
        out.writeInt(1);
        out.writeString(returns.getKey());
        out.writeString(returns.getValue());
    }
}