How to draw four boundary corner for qr code scanner

How to draw four Boundary for qrcode? Answer I created a vector drawable for this: <vector xmlns:android=”” android:width=”220dp” android:height=”220dp” android:viewportHeight=”230.0″ android:viewportWidth=”230.0″> <path android:fillColor=”#00000000″ android:fillType=”evenOdd” android:pathData=”M165,5C178.2,5 198.2,5 225,5L225,30.79L225,65″ android:strokeColor=”@color/qr_code_reader_square” android:strokeWidth=”10″/> <path android:fillColor=”#00000000″ android:fillType=”evenOdd” android:pathData=”M5,65C5,51.8 5,31.8 5,5L30.79,5L65,5″ android:strokeColor=”@color/qr_code_reader_square” android:strokeWidth=”10″/> <path android:fillColor=”#00000000″ android:fillType=”evenOdd” android:pathData=”M165,225C178.2,225 198.2,225 225,225L225,199.21L225,165″ android:strokeColor=”@color/qr_code_reader_square” android:strokeWidth=”10″/> <path android:fillColor=”#00000000″ android:fillType=”evenOdd” android:pathData=”M5,165C5,178.2 5,198.2 5,225L30.79,225L65,225″ android:strokeColor=”@color/qr_code_reader_square” android:strokeWidth=”10″/> </vector> You … Read more

BitmapFactory can’t decode a Bitmap from Uri after photos taken on Android Nougat

I tried to take a photo and then to use the photo. Here is what I did. My device was Nexus 6P (Android 7.1.1). First, I created a Uri: Uri mPicPath = UriUtil.fromFile(this, UriUtil.createTmpFileForPic()); //Uri mPicPath = UriUtil.fromFile(this, UriUtil.createFileForPic()); And then, I started Intent: Intent intent = ActivityUtils.getTakePicIntent(mPicPath); if (intent.resolveActivity(getPackageManager()) != null) { startActivityForResult(intent, RequestCode.TAKE_PIC); … Read more

Android Studio: Failed to create MD5 HashFile

I am creating a simple android application… I ran into some kind of trouble when I updated gradle when I launched Android Studio and it prompted me too. Upon the update completing I receive the following error: Error:Execution failed for task ‘:app:compileDebugJavaWithJavac’. Failed to create MD5 hash for file ‘/Users/damenTomassi/AndroidStudioProjects/AstraeaDemo/app/src/main/res/libs/gson-2.3.1.jar’. I used to have the … Read more

Why we use ViewTreeObserver#addOnGlobalLayoutListener()

Why do we use ViewTreeObserver, please can anyone explain it? In below code creditsView is TextView object. By this whole code I understand that “this is to hide some text based on condition”, but only thing is why we are using ViewTreeObserver? mainLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { int heightDiff = mainLayout.getRootView().getHeight() – … Read more

“Error using newLatLngBounds(LatLngBounds, int): Map size can’t be zero….” using react-native-maps on Android

I get an error: “Error using newLatLngBounds(LatLngBounds, int): Map size can’t be zero. Most likely layout has not yet occured for the map view. Either wait until layout has occurred or use newLatLngBounds(LatLngBounds, int, int, int) which allows you to specify the map’s dimensions”. But I set up an alert for getCurrentPosition and I’m receiving … Read more

Google sign-in error with Firebase Auth UI after upgrade

I was using an older version of firebase auth ui successfully but after upgrading to the latest releases I receive the following error while trying to login with Google: E/AuthUI: A sign-in error occurred. com.firebase.ui.auth.FirebaseUiException: Code: 10, message: 10: at at com.firebase.ui.auth.ui.idp.AuthMethodPickerActivity.onActivityResult( at at at at Source:0) at$H.handleMessage( at … Read more

Crash on calligraphy library by chris Jenx for Android Q

I have a calligraphy library I am using for custom fonts which seems to work on all versions except for android Q , where it crashes my app right on launch.Any one else has had to deal with the same issue lately? Here’s my crash report : Caused by: android.view.InflateException: Binary XML file line #17 … Read more