当前位置: 首页>>代码示例>>Java>>正文


Java SsdkUnsupportedException.printStackTrace方法代码示例

本文整理汇总了Java中com.samsung.android.sdk.SsdkUnsupportedException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java SsdkUnsupportedException.printStackTrace方法的具体用法?Java SsdkUnsupportedException.printStackTrace怎么用?Java SsdkUnsupportedException.printStackTrace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.samsung.android.sdk.SsdkUnsupportedException的用法示例。


在下文中一共展示了SsdkUnsupportedException.printStackTrace方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processUnsupportedException

import com.samsung.android.sdk.SsdkUnsupportedException; //导入方法依赖的package包/类
private boolean processUnsupportedException(final SsdkUnsupportedException e)
{

    e.printStackTrace();
    int errType = e.getType();
    // If the device is not a Samsung device or if the device does not support Pen.
    if (errType == SsdkUnsupportedException.VENDOR_NOT_SUPPORTED
        || errType == SsdkUnsupportedException.DEVICE_NOT_SUPPORTED)
    {
        // TODO: Nothing really
        return false;
    } else if (errType == SsdkUnsupportedException.LIBRARY_NOT_INSTALLED)
    {
        // If SpenSDK APK is not installed.
        // TODO: Prompt the user
        return false;
    } else if (errType
        == SsdkUnsupportedException.LIBRARY_UPDATE_IS_REQUIRED)
    {
        // SpenSDK APK must be updated.
        // TODO: Prompt the user
        return false;
    } else if (errType
        == SsdkUnsupportedException.LIBRARY_UPDATE_IS_RECOMMENDED)
    {
        // Update of SpenSDK APK to an available new version is recommended.
        // TODO: Prompt the user
        return false;
    }
    return true;
}
 
开发者ID:LorenK96,项目名称:slide-android,代码行数:32,代码来源:PenSettings.java

示例2: isSpenFeatureEnabled

import com.samsung.android.sdk.SsdkUnsupportedException; //导入方法依赖的package包/类
/**
 * checks if the Spen feature is enabled or not. Send the result as
 * SPEN_SUPPORTED if the Spen is supported otherwise the corresponding error
 * message.
 * 
 * @param context
 *                Context
 * @param callbackContext
 *                CallbackContext
 * @return spenState
 */
private int isSpenFeatureEnabled(Context context,
        CallbackContext callbackContext) {
    if (Log.isLoggable(Utils.SPEN, Log.DEBUG)) {
        Log.d(TAG, "inside isSpenFeatureEnabled");
    }
    int spenState = SPEN_INITILIZATION_ERROR;
    Spen spenPackage = new Spen();
    try {
        if (isStatic) {
            spenPackage.initialize(context, 5, Spen.SPEN_STATIC_LIB_MODE);
        } else {
            spenPackage.initialize(context);
        }
        if (spenPackage.isFeatureEnabled(Spen.DEVICE_PEN)) {
            spenState = SPEN_AND_HAND_SUPPORTED;
        } else {
            spenState = ONLY_HAND_SUPPORTED;
        }
    } catch (SsdkUnsupportedException e) {
        Log.d(TAG, "failed initializing the spen package " + e.getMessage());
        e.printStackTrace();
        // if the spen sdk version name (dynamic sdk) is lesser than
        // the jar version name (which is inlcuded in the spen plugin
        // then LIBRARY_UPDATE_IS_REQUIRED should be thrown.
        // Current, Spen SDK not handled it properly.
        SpenExceptionType errorType = null;
        boolean isExceptionTypeFound = false;
        if (spenPackage != null && !isStatic) {
            String dynamicSDKPkgName = Spen.SPEN_NATIVE_PACKAGE_NAME;
            try {
                PackageInfo packageInfo = mActivity.getPackageManager()
                        .getPackageInfo(dynamicSDKPkgName, 0);
                if (packageInfo != null) {
                    String dynamicSDKVersionName = packageInfo.versionName
                            .replace(".", "");
                    String pluginJarVersionName = spenPackage
                            .getVersionName().replace(".", "");
                    if (dynamicSDKVersionName
                            .compareTo(pluginJarVersionName) < 0) {
                        errorType = SpenExceptionType.LIBRARY_UPDATE_IS_REQUIRED;
                        isExceptionTypeFound = true;
                    }
                }
            } catch (NameNotFoundException e1) {
                e1.printStackTrace();
            }
        }
        if (!isExceptionTypeFound) {
            errorType = SpenException.processUnsupportedException(e);
        }
        PluginResult pluginResult = new PluginResult(
                PluginResult.Status.ERROR, errorType.toString());
        pluginResult.setKeepCallback(false);
        callbackContext.sendPluginResult(pluginResult);
    }
    spenPackage = null;
    return spenState;
}
 
开发者ID:Samsung,项目名称:CordovaPlugins,代码行数:70,代码来源:SpenPlugin.java


注:本文中的com.samsung.android.sdk.SsdkUnsupportedException.printStackTrace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。