Skip to content
mdelamata edited this page Mar 11, 2013 · 2 revisions

###Configuration Module

This module allows the developer to configure some staff such as variables or the splash screen. You can access this settings at "Configuration" section in Malcom Web.

Using this module needs the following steps:

  • To copy the "mcmconfiginfo.json" file in the "assets" folder of the android application.

  • To rename the splash image that you want to have available on offline mode to "splash.img" and move it to the "assets" folder of your project. (This is optional, if you don't follow this step splash wont show up if it couldn't be loaded from server)

  • In the main activity or the activities that are going to use the Malcom Configuration you'll need to init like this:

      MCMCoreAdapter.getInstance().moduleConfigurationActivate(this);
    

###Accessing properties from Malcom

You can access properties from advance configuration using the following method:

    MCMCoreAdapter.getInstance().moduleConfigurationGetProperty("<property>")

###Secondary Splash feature

Displaying the secondary splash (loaded from server) is simple. After activate the module with the previous steps, just copy and paste the following elements to the proper layout activity:

    <LinearLayout
           android:id="@+id/splash_layout"
           android:layout_width="fill_parent"
           android:layout_height="fill_parent"
           android:orientation="vertical"
           android:visibility="gone"
           android:background="@android:color/black"
           android:gravity="center_vertical">
           <ImageView android:id="@+id/image_view"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent"
                  android:visibility="gone"/>
           <LinearLayout
                  android:id="@+id/splash_progresszone"
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content"
                  android:orientation="horizontal"
                  android:gravity="center_horizontal|center_vertical"
                  android:visibility="gone">
                  <ProgressBar
                         android:id="@+id/splash_progress_bar"
                         style="?android:attr/progressBarStyleSmall"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:padding="2dip"/>
                  <TextView android:layout_height="wrap_content"
                         android:layout_width="wrap_content"
                         android:textColor="@android:color/white"
                         android:text=""
                         android:paddingLeft="4dp"/>
           </LinearLayout>
     </LinearLayout>

###Displaying the interstitial

Just add the following elements to the proper layout activity:

    <LinearLayout
           android:id="@+id/webview_layout"
           android:layout_width="fill_parent"
           android:layout_height="fill_parent"
           android:orientation="vertical"
           android:background="@android:color/black"
           android:visibility="gone">
                <WebView
                      android:id="@+id/webview"
                      android:layout_width="fill_parent"
                      android:layout_height="0dp"
                      android:layout_weight="1"
				/>
                <LinearLayout
                      android:id="@+id/progresszone"
                      android:layout_width="fill_parent"
                      android:layout_height="wrap_content"
                      android:orientation="horizontal"
                      android:gravity="center_horizontal"
                      android:visibility="gone">
                      <ProgressBar
                             android:id="@+id/web_view_progress_bar"
                             style="?android:attr/progressBarStyleSmall"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:padding="2dip"/>
                      <TextView android:layout_height="wrap_content"
                             android:layout_width="wrap_content"
                             android:textColor="@android:color/white"
                             android:text="loading..."
                             android:paddingLeft="4dp"/>
                </LinearLayout>
                <LinearLayout
                      android:layout_width="fill_parent"
                      android:layout_height="wrap_content"
                      android:orientation="horizontal"
                >
                      <Button android:id="@+id/web_view_close"
                             android:layout_width="fill_parent"
                             android:layout_height="fill_parent"
                             android:text="Close" />
                </LinearLayout>
         </LinearLayout>
Clone this wiki locally