• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SsdkUnsupportedException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getImageFilterExceptionType

import com.samsung.android.sdk.SsdkUnsupportedException; //导入依赖的package包/类
public String getImageFilterExceptionType(int type) {
    switch (type) {
        case SsdkUnsupportedException.DEVICE_NOT_SUPPORTED:
            return "DEVICE_NOT_SUPPORTED";
        case SsdkUnsupportedException.LIBRARY_NOT_INSTALLED:
            return "LIBRARY_NOT_INSTALLED";
        case SsdkUnsupportedException.LIBRARY_UPDATE_IS_RECOMMENDED:
            return "LIBRARY_UPDATE_IS_RECOMMENDED";
        case SsdkUnsupportedException.LIBRARY_UPDATE_IS_REQUIRED:
            return "LIBRARY_UPDATE_IS_REQUIRED";
        case SsdkUnsupportedException.VENDOR_NOT_SUPPORTED:
            return "VENDOR_NOT_SUPPORTED";
        default:
            return "UNKNOWN_EXCEPTION";
    }
}
 
开发者ID:akexorcist,项目名称:Example-SamsungSDK,代码行数:17,代码来源:MainActivity.java


示例2: intializeMultiwindow

import com.samsung.android.sdk.SsdkUnsupportedException; //导入依赖的package包/类
/**
 * This method will initialize Multiwindow on the device.
 * 
 */
private int intializeMultiwindow() {
	
	if (Log.isLoggable(MULTIWINDOW, Log.DEBUG)) {
        Log.d(TAG, "Inside intializeMultiwindow,");
    }
    mMultiWindow = new SMultiWindow();

    try {
        mMultiWindow.initialize(this.cordova.getActivity());
    } catch (SsdkUnsupportedException e) {
        return e.getType();
    }

    return INIT_SUCCESS;
}
 
开发者ID:Samsung,项目名称:CordovaPlugins,代码行数:20,代码来源:MultiWindow.java


示例3: processUnsupportedException

import com.samsung.android.sdk.SsdkUnsupportedException; //导入依赖的package包/类
/**
 * This method processes the exception that is caused while initializing the
 * Spen package and return the type of exception
 * 
 * @param e
 *            SsdkUnsupportedException
 * @return SpenExceptionType
 */
public static SpenExceptionType processUnsupportedException(
        SsdkUnsupportedException e) {
    int errType = e.getType();
     
    if (errType == SsdkUnsupportedException.VENDOR_NOT_SUPPORTED) {
        // If the device is not a Samsung device
        return SpenExceptionType.VENDOR_NOT_SUPPORTED;
    } else if (errType == SsdkUnsupportedException.DEVICE_NOT_SUPPORTED) {
        //if the device does not support Pen.
        return SpenExceptionType.DEVICE_NOT_SUPPORTED;
    } else if (errType == SsdkUnsupportedException.LIBRARY_NOT_INSTALLED) {
        // If SpenSDK APK is not installed.
        return SpenExceptionType.LIBRARY_NOT_INSTALLED;
    } else if (errType == SsdkUnsupportedException.LIBRARY_UPDATE_IS_REQUIRED) {
        // SpenSDK APK must be updated.
        return SpenExceptionType.LIBRARY_UPDATE_IS_REQUIRED;
    } else if (errType == SsdkUnsupportedException.LIBRARY_UPDATE_IS_RECOMMENDED) {
        // Update of SpenSDK APK to an available new version is recommended.
        return SpenExceptionType.LIBRARY_UPDATE_IS_RECOMMENDED;
    }
    return SpenExceptionType.SPEN_NOT_SUPPORTED;
}
 
开发者ID:Samsung,项目名称:CordovaPlugins,代码行数:31,代码来源:SpenException.java


示例4: initialize

import com.samsung.android.sdk.SsdkUnsupportedException; //导入依赖的package包/类
@Override
public void initialize(final CordovaInterface cordova, CordovaWebView webView) {

    mSpass = new Spass();

    try {
        mSpass.initialize(this.cordova.getActivity().getApplicationContext());
        Log.d(TAG, "Spass was Initialized");

        isFeatureEnabled = mSpass.isFeatureEnabled(Spass.DEVICE_FINGERPRINT);

        if (isFeatureEnabled) {
            mSpassFingerprint = new SpassFingerprint(this.cordova.getActivity().getApplicationContext());
            Log.d(TAG, "mSpassFingerprint was Initialized");
        } else {
            Log.d(TAG, "Fingerprint Service is not supported in the device.");
        }
    } catch (SsdkUnsupportedException e) {
        Log.d(TAG, "Spass could not initialize" + e);
    }

}
 
开发者ID:tabrindle,项目名称:cordova-plugin-samsungpass,代码行数:23,代码来源:SamsungPassPlugin.java


示例5: setSpenAvailable

import com.samsung.android.sdk.SsdkUnsupportedException; //导入依赖的package包/类
public void setSpenAvailable(final Context context)
{
    final Spen spenPackage = new Spen();
    try
    {
        spenPackage.initialize(context);
        this.spenAvailable = spenPackage.isFeatureEnabled(Spen.DEVICE_PEN);
    } catch (SsdkUnsupportedException e)
    {
        if (processUnsupportedException(e))
        {
            this.spenAvailable = false;
        }
    } catch (final Exception e1)
    {
        this.spenAvailable = false;
    }
}
 
开发者ID:LorenK96,项目名称:slide-android,代码行数:19,代码来源:PenSettings.java


示例6: onCreate

import com.samsung.android.sdk.SsdkUnsupportedException; //导入依赖的package包/类
@Override
public void onCreate() {
	super.onCreate();
	Log.i(TAG, "onCreate");

	SA mAccessory = new SA();
	try {
		mAccessory.initialize(this);
	} catch (SsdkUnsupportedException e) {
		// Error Handling
	} catch (Exception e1) {
		Log.e(TAG, "Cannot initialize Accessory package.");
		e1.printStackTrace();
		/*
		 * Your application can not use Accessory package of Samsung Mobile
		 * SDK. You application should work smoothly without using this SDK,
		 * or you may want to notify user and close your app gracefully
		 * (release resources, stop Service threads, close UI thread, etc.)
		 */
		stopSelf();
	}

}
 
开发者ID:tgardner,项目名称:cordova-galaxygear,代码行数:24,代码来源:GearProviderService.java


示例7: MultiWindowFunction

import com.samsung.android.sdk.SsdkUnsupportedException; //导入依赖的package包/类
public MultiWindowFunction(Activity activity) throws SsdkUnsupportedException {
    this.activity = activity;
    mMultiWindow = new SMultiWindow();
    mMultiWindow.initialize(activity);
    mMultiWindowActivity = new SMultiWindowActivity(activity);
}
 
开发者ID:konir,项目名称:RadioRecPlus,代码行数:7,代码来源:MultiWindowFunction.java


示例8: setupSPass

import com.samsung.android.sdk.SsdkUnsupportedException; //导入依赖的package包/类
private boolean setupSPass() {
    spass = new Spass();
    try {
        spass.initialize(this);
        if (spass.isFeatureEnabled(Spass.DEVICE_FINGERPRINT)) {
            spassFingerprint = new SpassFingerprint(this);
            return true;
        }
    } catch (SsdkUnsupportedException | UnsupportedOperationException e) {
        // Fingerprint Service is not supported in this SDK
    }
    return false;
}
 
开发者ID:akexorcist,项目名称:Example-SamsungSDK,代码行数:14,代码来源:MainActivity.java


示例9: setupImageFilter

import com.samsung.android.sdk.SsdkUnsupportedException; //导入依赖的package包/类
public boolean setupImageFilter() {
    sif = new Sif();
    try {
        sif.initialize(this);
        return true;
    } catch (SsdkUnsupportedException e) {
        // Error Handling
        Toast.makeText(this, getImageFilterExceptionType(e.getType()), Toast.LENGTH_SHORT).show();
    }
    return false;
}
 
开发者ID:akexorcist,项目名称:Example-SamsungSDK,代码行数:12,代码来源:MainActivity.java


示例10: setupSpen

import com.samsung.android.sdk.SsdkUnsupportedException; //导入依赖的package包/类
private boolean setupSpen() {
    spen = new Spen();
    try {
        spen.initialize(this);
        if (spen.isFeatureEnabled(Spen.DEVICE_PEN)) {
            return true;
        }
    } catch (SsdkUnsupportedException e) {
        // Error Handle
    }
    return false;
}
 
开发者ID:akexorcist,项目名称:Example-SamsungSDK,代码行数:13,代码来源:MainActivity.java


示例11: 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


示例12: 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


示例13: isRichNotificationSupported

import com.samsung.android.sdk.SsdkUnsupportedException; //导入依赖的package包/类
/**
 * Checks if the device supports RichNotification feature.
 *
 * @param callbackContext
 *            The callback id used when calling back into JavaScript.
 * @return true if the RichNotification is supported or false if not supported.
 *
 */
private boolean isRichNotificationSupported (CallbackContext callbackContext) {
    if (mIsRichSupported)
        return true;

    if(Log.isLoggable(RICHNOTI, Log.DEBUG))
    	Log.d(TAG, "Checking RichNotification support...");
    Srn srn = new Srn();
    try {
        // Initialize an instance of Srn.
        srn.initialize(mContext);
    } catch (SsdkUnsupportedException e) {
        // Error handling
        if (e.getType() == SsdkUnsupportedException.VENDOR_NOT_SUPPORTED) {
            Log.e(TAG, "Initialization error. Vendor is not Samsung.");
            callbackContext.error(RichNotificationHelper.VENDOR_NOT_SUPPORTED);
        }
        else if (e.getType() == SsdkUnsupportedException.DEVICE_NOT_SUPPORTED) {
            Log.e(TAG, "Initialization error. Device not supported.");
            callbackContext.error(RichNotificationHelper.DEVICE_NOT_SUPPORTED);
        }
        else if (e.getType() == SsdkUnsupportedException.LIBRARY_NOT_INSTALLED) {
            Log.e(TAG, "Initialization error. Device not supported.");
            callbackContext.error(RichNotificationHelper.LIBRARY_NOT_INSTALLED);
        }
        else if (e.getType() == SsdkUnsupportedException.LIBRARY_UPDATE_IS_RECOMMENDED) {
            Log.e(TAG, "Initialization error. Device not supported.");
            callbackContext.error(RichNotificationHelper.LIBRARY_UPDATE_IS_RECOMMENDED);
        }
        else if (e.getType() == SsdkUnsupportedException.LIBRARY_UPDATE_IS_REQUIRED) {
            Log.e(TAG, "Initialization error. Device not supported.");
            callbackContext.error(RichNotificationHelper.LIBRARY_UPDATE_IS_REQUIRED);
        }
        else {
            Log.e(TAG, "Initialization error.");
            callbackContext.error("Initialization error");
        }
        return false;
    }
    mIsRichSupported = true;
    return true;
}
 
开发者ID:Samsung,项目名称:CordovaPlugins,代码行数:50,代码来源:RichNotification.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Log类代码示例发布时间:2022-05-22
下一篇:
Java SAMLObject类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap