diff --git a/samples/android/15-puzzle/src/org/opencv/samples/puzzle15/puzzle15Activity.java b/samples/android/15-puzzle/src/org/opencv/samples/puzzle15/puzzle15Activity.java index 7905192d8..91e58c61d 100644 --- a/samples/android/15-puzzle/src/org/opencv/samples/puzzle15/puzzle15Activity.java +++ b/samples/android/15-puzzle/src/org/opencv/samples/puzzle15/puzzle15Activity.java @@ -45,6 +45,21 @@ public class puzzle15Activity extends Activity ad.show(); } } break; + /** OpenCV loader cannot start Google Play **/ + case LoaderCallbackInterface.MARKET_ERROR: + { + Log.d(TAG, "Google Play service is not accessible!"); + AlertDialog MarketErrorMessage = new AlertDialog.Builder(mAppContext).create(); + MarketErrorMessage.setTitle("OpenCV Manager"); + MarketErrorMessage.setMessage("Google Play service is not accessible!\nTry to install the 'OpenCV Manager' and the appropriate 'OpenCV binary pack' APKs from OpenCV SDK manually via 'adb install file_name.apk' command."); + MarketErrorMessage.setCancelable(false); // This blocks the 'BACK' button + MarketErrorMessage.setButton(AlertDialog.BUTTON_POSITIVE, "OK", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + mAppContext.finish(); + } + }); + MarketErrorMessage.show(); + } break; default: { super.onManagerConnected(status); diff --git a/samples/android/color-blob-detection/src/org/opencv/samples/colorblobdetect/ColorBlobDetectionActivity.java b/samples/android/color-blob-detection/src/org/opencv/samples/colorblobdetect/ColorBlobDetectionActivity.java index b959dd267..bd1bf8334 100644 --- a/samples/android/color-blob-detection/src/org/opencv/samples/colorblobdetect/ColorBlobDetectionActivity.java +++ b/samples/android/color-blob-detection/src/org/opencv/samples/colorblobdetect/ColorBlobDetectionActivity.java @@ -40,6 +40,21 @@ public class ColorBlobDetectionActivity extends Activity { ad.show(); } } break; + /** OpenCV loader cannot start Google Play **/ + case LoaderCallbackInterface.MARKET_ERROR: + { + Log.d(TAG, "Google Play service is not accessible!"); + AlertDialog MarketErrorMessage = new AlertDialog.Builder(mAppContext).create(); + MarketErrorMessage.setTitle("OpenCV Manager"); + MarketErrorMessage.setMessage("Google Play service is not accessible!\nTry to install the 'OpenCV Manager' and the appropriate 'OpenCV binary pack' APKs from OpenCV SDK manually via 'adb install file_name.apk' command."); + MarketErrorMessage.setCancelable(false); // This blocks the 'BACK' button + MarketErrorMessage.setButton(AlertDialog.BUTTON_POSITIVE, "OK", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + mAppContext.finish(); + } + }); + MarketErrorMessage.show(); + } break; default: { super.onManagerConnected(status); diff --git a/samples/android/face-detection/src/org/opencv/samples/fd/FdActivity.java b/samples/android/face-detection/src/org/opencv/samples/fd/FdActivity.java index 1577a0148..bc63b3827 100644 --- a/samples/android/face-detection/src/org/opencv/samples/fd/FdActivity.java +++ b/samples/android/face-detection/src/org/opencv/samples/fd/FdActivity.java @@ -54,6 +54,21 @@ public class FdActivity extends Activity { ad.show(); } } break; + /** OpenCV loader cannot start Google Play **/ + case LoaderCallbackInterface.MARKET_ERROR: + { + Log.d(TAG, "Google Play service is not accessible!"); + AlertDialog MarketErrorMessage = new AlertDialog.Builder(mAppContext).create(); + MarketErrorMessage.setTitle("OpenCV Manager"); + MarketErrorMessage.setMessage("Google Play service is not accessible!\nTry to install the 'OpenCV Manager' and the appropriate 'OpenCV binary pack' APKs from OpenCV SDK manually via 'adb install file_name.apk' command."); + MarketErrorMessage.setCancelable(false); // This blocks the 'BACK' button + MarketErrorMessage.setButton(AlertDialog.BUTTON_POSITIVE, "OK", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + mAppContext.finish(); + } + }); + MarketErrorMessage.show(); + } break; default: { super.onManagerConnected(status); diff --git a/samples/android/image-manipulations/src/org/opencv/samples/imagemanipulations/ImageManipulationsActivity.java b/samples/android/image-manipulations/src/org/opencv/samples/imagemanipulations/ImageManipulationsActivity.java index de71365c0..d265f310c 100644 --- a/samples/android/image-manipulations/src/org/opencv/samples/imagemanipulations/ImageManipulationsActivity.java +++ b/samples/android/image-manipulations/src/org/opencv/samples/imagemanipulations/ImageManipulationsActivity.java @@ -63,6 +63,21 @@ public class ImageManipulationsActivity extends Activity { ad.show(); } } break; + /** OpenCV loader cannot start Google Play **/ + case LoaderCallbackInterface.MARKET_ERROR: + { + Log.d(TAG, "Google Play service is not accessible!"); + AlertDialog MarketErrorMessage = new AlertDialog.Builder(mAppContext).create(); + MarketErrorMessage.setTitle("OpenCV Manager"); + MarketErrorMessage.setMessage("Google Play service is not accessible!\nTry to install the 'OpenCV Manager' and the appropriate 'OpenCV binary pack' APKs from OpenCV SDK manually via 'adb install file_name.apk' command."); + MarketErrorMessage.setCancelable(false); // This blocks the 'BACK' button + MarketErrorMessage.setButton(AlertDialog.BUTTON_POSITIVE, "OK", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + mAppContext.finish(); + } + }); + MarketErrorMessage.show(); + } break; default: { super.onManagerConnected(status); diff --git a/samples/android/tutorial-1-addopencv/src/org/opencv/samples/tutorial1/Sample1Java.java b/samples/android/tutorial-1-addopencv/src/org/opencv/samples/tutorial1/Sample1Java.java index 7581639a6..f8885f0b3 100644 --- a/samples/android/tutorial-1-addopencv/src/org/opencv/samples/tutorial1/Sample1Java.java +++ b/samples/android/tutorial-1-addopencv/src/org/opencv/samples/tutorial1/Sample1Java.java @@ -45,6 +45,21 @@ public class Sample1Java extends Activity { ad.show(); } } break; + /** OpenCV loader cannot start Google Play **/ + case LoaderCallbackInterface.MARKET_ERROR: + { + Log.d(TAG, "Google Play service is not accessible!"); + AlertDialog MarketErrorMessage = new AlertDialog.Builder(mAppContext).create(); + MarketErrorMessage.setTitle("OpenCV Manager"); + MarketErrorMessage.setMessage("Google Play service is not accessible!\nTry to install the 'OpenCV Manager' and the appropriate 'OpenCV binary pack' APKs from OpenCV SDK manually via 'adb install file_name.apk' command."); + MarketErrorMessage.setCancelable(false); // This blocks the 'BACK' button + MarketErrorMessage.setButton(AlertDialog.BUTTON_POSITIVE, "OK", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + mAppContext.finish(); + } + }); + MarketErrorMessage.show(); + } break; default: { super.onManagerConnected(status); diff --git a/samples/android/tutorial-2-opencvcamera/src/org/opencv/samples/tutorial2/Sample2NativeCamera.java b/samples/android/tutorial-2-opencvcamera/src/org/opencv/samples/tutorial2/Sample2NativeCamera.java index 13437d73d..d72bea8d0 100644 --- a/samples/android/tutorial-2-opencvcamera/src/org/opencv/samples/tutorial2/Sample2NativeCamera.java +++ b/samples/android/tutorial-2-opencvcamera/src/org/opencv/samples/tutorial2/Sample2NativeCamera.java @@ -52,6 +52,21 @@ public class Sample2NativeCamera extends Activity { ad.show(); } } break; + /** OpenCV loader cannot start Google Play **/ + case LoaderCallbackInterface.MARKET_ERROR: + { + Log.d(TAG, "Google Play service is not accessible!"); + AlertDialog MarketErrorMessage = new AlertDialog.Builder(mAppContext).create(); + MarketErrorMessage.setTitle("OpenCV Manager"); + MarketErrorMessage.setMessage("Google Play service is not accessible!\nTry to install the 'OpenCV Manager' and the appropriate 'OpenCV binary pack' APKs from OpenCV SDK manually via 'adb install file_name.apk' command."); + MarketErrorMessage.setCancelable(false); // This blocks the 'BACK' button + MarketErrorMessage.setButton(AlertDialog.BUTTON_POSITIVE, "OK", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + mAppContext.finish(); + } + }); + MarketErrorMessage.show(); + } break; default: { super.onManagerConnected(status); diff --git a/samples/android/tutorial-3-native/src/org/opencv/samples/tutorial3/Sample3Native.java b/samples/android/tutorial-3-native/src/org/opencv/samples/tutorial3/Sample3Native.java index f4d9bf790..e228f2e4c 100644 --- a/samples/android/tutorial-3-native/src/org/opencv/samples/tutorial3/Sample3Native.java +++ b/samples/android/tutorial-3-native/src/org/opencv/samples/tutorial3/Sample3Native.java @@ -43,6 +43,21 @@ public class Sample3Native extends Activity { ad.show(); } } break; + /** OpenCV loader cannot start Google Play **/ + case LoaderCallbackInterface.MARKET_ERROR: + { + Log.d(TAG, "Google Play service is not accessible!"); + AlertDialog MarketErrorMessage = new AlertDialog.Builder(mAppContext).create(); + MarketErrorMessage.setTitle("OpenCV Manager"); + MarketErrorMessage.setMessage("Google Play service is not accessible!\nTry to install the 'OpenCV Manager' and the appropriate 'OpenCV binary pack' APKs from OpenCV SDK manually via 'adb install file_name.apk' command."); + MarketErrorMessage.setCancelable(false); // This blocks the 'BACK' button + MarketErrorMessage.setButton(AlertDialog.BUTTON_POSITIVE, "OK", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + mAppContext.finish(); + } + }); + MarketErrorMessage.show(); + } break; default: { super.onManagerConnected(status); diff --git a/samples/android/tutorial-4-mixed/src/org/opencv/samples/tutorial4/Sample4Mixed.java b/samples/android/tutorial-4-mixed/src/org/opencv/samples/tutorial4/Sample4Mixed.java index 2ea0fe1c3..1ac4aec19 100644 --- a/samples/android/tutorial-4-mixed/src/org/opencv/samples/tutorial4/Sample4Mixed.java +++ b/samples/android/tutorial-4-mixed/src/org/opencv/samples/tutorial4/Sample4Mixed.java @@ -51,6 +51,21 @@ public class Sample4Mixed extends Activity { ad.show(); } } break; + /** OpenCV loader cannot start Google Play **/ + case LoaderCallbackInterface.MARKET_ERROR: + { + Log.d(TAG, "Google Play service is not accessible!"); + AlertDialog MarketErrorMessage = new AlertDialog.Builder(mAppContext).create(); + MarketErrorMessage.setTitle("OpenCV Manager"); + MarketErrorMessage.setMessage("Google Play service is not accessible!\nTry to install the 'OpenCV Manager' and the appropriate 'OpenCV binary pack' APKs from OpenCV SDK manually via 'adb install file_name.apk' command."); + MarketErrorMessage.setCancelable(false); // This blocks the 'BACK' button + MarketErrorMessage.setButton(AlertDialog.BUTTON_POSITIVE, "OK", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + mAppContext.finish(); + } + }); + MarketErrorMessage.show(); + } break; default: { super.onManagerConnected(status);