本文整理汇总了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";
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
}
示例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();
}
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}