在Worklight / Dojo中进行Xtify集成

时间:2015-07-24 19:42:37

标签: java android dojo ibm-mobilefirst xtify

我有一个在Worklight 6.2中开发的应用程序,使用DoJo框架,我想将它与Xtify集成。 通过阅读集成教程,我在第7步中发现了一个问题:

  

第7步:

     

1.执行以下步骤以编辑主要活动类:为com.ibm.mobilepush.cordova.MobilePushCordovaActivity添加导入。

     

2.使您的主要活动覆盖MobilePushCordovaActivity而不是    CordovaActivity。

     

3.如果覆盖onSaveInstanceState方法或    onNewIntent,请确保调用超类方法。

但是,由于我正在使用DoJo应用程序,因此我的Main Activity类已经扩展了anoter类:

import com.worklight.androidgap.WLDroidGap;

public class DojoApp extends WLDroidGap {
    private static WebView webViewOverlay;
    public static Activity thisapp; 
    private static final String TAG = "DojoApp";
    private static ProgressDialog progressBar;
    ...

如何进行此集成?我想也许我可以扩展两个不同的类,但这似乎不可能。

1 个答案:

答案 0 :(得分:2)

看一下这篇文章: Xtify + Worklight 6.1 integration in android environment

您可能需要添加

public static final String XTIFY_APP_KEY = "xxxxxxxx-xxxxx-xxxx-xxxxx-xxxxxxxxx";
public static final String PROJECT_NUM = "xxxxxxxxxxxx"; // This is the Google Project Number

并将此行追加到onStart()方法:

XtifySDK.start(getApplicationContext(), XTIFY_APP_KEY, PROJECT_NUM);

我还会添加这两种方法:

@Override
protected void onSaveInstanceState(Bundle outState) {       
    super.onSaveInstanceState(outState);
    MobilePushCordovaPluginUtils.onSaveInstanceState(this, outState);
}

@Override
protected void onNewIntent(Intent intent) {     
    super.onNewIntent(intent);
    MobilePushCordovaPluginUtils.onNewIntent(this, intent);
}