[Important] Changes since Mobage Native SDK (Android) 1.4

From Mobage Native SDK 1.4 onwards, applications with multiple activities, which were not sufficiently supported with former SDKs, are now fully supported. As a result, there have been major changes to the method used to call APIs and write AndroidManifest.xml, and the backward compatibility with versions prior to 1.4 has been lost.

This document is intended to indicate differences in the new SDK for developers who have been using former versions. If you are using a Mobage Native SDK for the first time, carry out implementation with reference to the descriptions about SDK 1.4 or later in the SDK documents.

Please make sure that you delete all librarys and resources from the previous SDK, before upgrading Mobage Native SDK. Especially when you are upgrading from previous Mobage Native SDK 1.4.4 or before to SDK 1.4.5 or later, confirm that the libmobage.so is deleted or you will have issue around Bank API's.

Changes to AndroidManifest.xml

  • Delete android:launchMode="singleTask" written inside the Main Activity of AndroidManifest.xml, and do not use singleTask. Only standard or singleTop launchMode can be used for the Main Activity.
  • Delete Intent Filter written inside the Main Activity of AndroidManifest.xml.
  • Add the following Activity.
  • Existing mobage-jp-${YourApplicationId} cannot be used. Should you need to start Intent for ad services, etc., set a scheme with another name the Main Activity.

List of Changed Methods

Changes in Mobage Native SDK 1.4 include the following changes to Methods. Most changes concern life cycle type Methods.

  • APIs that were deleted in Mobage Native SDK 1.4 and later
    • Mobage.onResume()
    • Mobage.onPause()
    • Mobage.onStop()
    • Mobage.onRestart()
    • Mobage.addPlatformListener(Mobage.PlatformListener listener)
  • APIs that were added in Mobage Native SDK 1.4 and later
    • Mobage.onCreate(Activity activity)
    • Mobage.onStart(Activity activity)
    • Mobage.onResume(Activity activity)
    • Mobage.onPause(Activity activity)
    • Mobage.onStop(Activity activity)
    • Mobage.onRestart(Activity activity)
    • Mobage.onDestroy(Activity activity)
    • Mobage.addPlatformListener(Activity activity, Mobage.PlatformListener listener)
  • APIs that became deprecated in Mobage Native SDK 1.4 and later
    • Mobage.setCurrentActivity(Activity activity)
      • Use of the above method is no longer necessary.

Changes to the Implementation Method

How to Implement the Main Activity

It is necessary to call the following methods in onCreate inside the Main Activity in the following order.
1. Mobage.registerResources();
2. Mobage.initialize();
3. Mobage.registerTick();
4. Mobage.onCreate(this);

Call the above methods 1 - 3 only once in the Main Activity.

Activity was added as a parameter for login listener registration. Call Mobage.checkLoginStatus as usual.

Specifically, implement inside onCreate as below. 

A boolean showSplashScreen Argument has been added to initialize method from Mobage Native SDK 1.4.7 and the post in initialize method has been deprecated.

Common implementation for Activities

It is necessary to call the Mobage SDK API in the life cycle method in each Activity.

Configuration of Login Listener

Parameters of addPlatformListener were changed as below.

  • After the change:

If you wish to receive login listener other than by Main Activity, note that it is necessary to implement login listener in other Activities as in the Main Activity.

Revision History

  • 13/11/2013
    • Updated lauchMode for Unity due to issues that can occur when using standard
  • 07/01/2013
    • Initial Release.

PREVIOUS

Mobage Native SDK (Android) ChangeLog

NEXT

Mobage Native SDK (Android) 1.7.2 ChangeLog