Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/** 
 ** Copyright (C) SAS Institute, All rights reserved.
 ** General Public License: http://www.opensource.org/licenses/gpl-license.php
 **/

import android.os.Bundle;

import android.os.Parcelable;

public class Main {
    /**
     * key used to extract from Bundle an int value, which indicates the total number of<br> 
     * parcels of a whole message to be sent.<br>
     * it is used when transferring a message by a few parcels<br>
     */
    public static final String BUNDLE_SMALL_PARCEL_TOTALNUMBER = "smallparceltotalnumber";

    /**
     * Extract an int received from the test package engine.
     * The int message is extracted via Bundle.getCharArray using {@link #BUNDLE_SMALL_PARCEL_TOTALNUMBER} as the key for the item. 
     * 
     * @param Parcelable Bundle received from the test package engine
     * @return int the total number of parcels to be sent for one message, generated at the engine side.
     * @see Bundle#putCharArray(String, char[])
     * @see Bundle#getCharArray(String)
     * @see #setBundleOfSmallParcel(String, int, int)
     */
    public static int getParcelableTotalNumberFromSmallParcel(Parcelable parcelable) {
        Bundle bundle = (Bundle) parcelable;
        return bundle.getInt(BUNDLE_SMALL_PARCEL_TOTALNUMBER);
    }
}