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 serialized Properties object from Bundle. */
    public static final String BUNDLE_PROPERTIES = "properties";

    /**
     * Extract a char[] received from the test package engine.
     * The char[] message is extracted via Bundle.getCharArray using {@link #BUNDLE_PROPERTIES} as the key for the item. 
     * The original intent here is to retrieve Java Properties stored as a char[] suitable for deserialization 
     * via the Java Properties.load method.<br>
     * NOTE: This has not yet been tested!
     * @param Parcelable Bundle received from the test package engine
     * @return char[] suitable for Java Properties.load
     * @see Bundle#putCharArray(String, char[])
     * @see Bundle#getCharArray(String)
     */
    public static char[] getParcelableProps(Parcelable parcelable) {
        Bundle bundle = (Bundle) parcelable;
        return bundle.getCharArray(BUNDLE_PROPERTIES);
    }
}