Storage permission issue in android 5 to 13

I build my app whith native.vue and java. I’m trying to store and read data to internal storage of device. When i running this code in android 10 any permission request to user doesn’t make.

In my manifest file i define:

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>

In my java file i have:

import static androidx.core.content.ContextCompat.startActivity;
import android.Manifest;
import android.app.Activity;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.os.StrictMode;
import android.provider.OpenableColumns;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.activity.result.ActivityResultLauncher;
import android.provider.Settings;
import android.content.ContentValues;
import android.provider.MediaStore;
import android.os.Environment;
import java.io.OutputStream;
import android.util.Log; 
import android.widget.Toast;

With this code below, i show that i have not permission

public static boolean checkStoragePermissions(Context context) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
  // Android est 11 (R) ou supérieur
  Log.d("createDir", "Android est 11 (R) ou supérieur");
  return Environment.isExternalStorageManager();
} else {
  // Inférieur à Android 11
  Log.d("createDir", "Inférieur à Android 11");
  int write = ContextCompat.checkSelfPermission(context, Manifest.permission.WRITE_EXTERNAL_STORAGE);
  int read = ContextCompat.checkSelfPermission(context, Manifest.permission.READ_EXTERNAL_STORAGE);

  return read == PackageManager.PERMISSION_GRANTED && write == PackageManager.PERMISSION_GRANTED;
}

}

So i try to get permission whith:

public static void requestForStoragePermissions(Activity activity,
  ActivityResultLauncher<Intent> storageActivityResultLauncher) {
// Android is 11 (R) or above
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
  Log.d("createDir", "Android est 11 (R) ou supérieur");
  try {
    Intent intent = new Intent();
    intent.setAction(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION);
    Uri uri = Uri.fromParts("package", activity.getPackageName(), null);
    intent.setData(uri);
    storageActivityResultLauncher.launch(intent);
  } catch (Exception e) {
    Intent intent = new Intent();
    intent.setAction(Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION);
    storageActivityResultLauncher.launch(intent);
  }
} else {
  Log.d("createDir", "Inférieur à Android 11");
  // Below android 11
  ActivityCompat.requestPermissions(
      activity,
      new String[] {
          Manifest.permission.WRITE_EXTERNAL_STORAGE,
          Manifest.permission.READ_EXTERNAL_STORAGE
      },
      STORAGE_PERMISSION_CODE);
}

But when i run it in android 10 ,i get “undefined” in my log and any dialog box in phone.
Below my vue method.

  requestStoragePermissions() {  
        const activity = Application.android.foregroundActivity || Application.android.startActivity;
        let ctx = Utils.android.getApplicationContext();
        let execc = com.ecodev.Mifi.MyUtils.requestForStoragePermissions(activity, null);
        let exec = com.ecodev.Mifi.MyUtils.checkStoragePermissions(ctx);
        console.log('requestForStoragePermissions' + execc);
        console.log(exec);
    },

I read several post on the same subject and test this in vain.
Storage Permission Issue In android 10+ devices https://medium.com/@kezzieleo/manage-external-storage-permission-android-studio-java-9c3554cf79a7

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa

Storage permission issue in android 5 to 13

I build my app whith native.vue and java. I’m trying to store and read data to internal storage of device. When i running this code in android 10 any permission request to user doesn’t make.

In my manifest file i define:

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>

In my java file i have:

import static androidx.core.content.ContextCompat.startActivity;
import android.Manifest;
import android.app.Activity;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.os.StrictMode;
import android.provider.OpenableColumns;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.activity.result.ActivityResultLauncher;
import android.provider.Settings;
import android.content.ContentValues;
import android.provider.MediaStore;
import android.os.Environment;
import java.io.OutputStream;
import android.util.Log; 
import android.widget.Toast;

With this code below, i show that i have not permission

public static boolean checkStoragePermissions(Context context) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
  // Android est 11 (R) ou supérieur
  Log.d("createDir", "Android est 11 (R) ou supérieur");
  return Environment.isExternalStorageManager();
} else {
  // Inférieur à Android 11
  Log.d("createDir", "Inférieur à Android 11");
  int write = ContextCompat.checkSelfPermission(context, Manifest.permission.WRITE_EXTERNAL_STORAGE);
  int read = ContextCompat.checkSelfPermission(context, Manifest.permission.READ_EXTERNAL_STORAGE);

  return read == PackageManager.PERMISSION_GRANTED && write == PackageManager.PERMISSION_GRANTED;
}

}

So i try to get permission whith:

public static void requestForStoragePermissions(Activity activity,
  ActivityResultLauncher<Intent> storageActivityResultLauncher) {
// Android is 11 (R) or above
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
  Log.d("createDir", "Android est 11 (R) ou supérieur");
  try {
    Intent intent = new Intent();
    intent.setAction(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION);
    Uri uri = Uri.fromParts("package", activity.getPackageName(), null);
    intent.setData(uri);
    storageActivityResultLauncher.launch(intent);
  } catch (Exception e) {
    Intent intent = new Intent();
    intent.setAction(Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION);
    storageActivityResultLauncher.launch(intent);
  }
} else {
  Log.d("createDir", "Inférieur à Android 11");
  // Below android 11
  ActivityCompat.requestPermissions(
      activity,
      new String[] {
          Manifest.permission.WRITE_EXTERNAL_STORAGE,
          Manifest.permission.READ_EXTERNAL_STORAGE
      },
      STORAGE_PERMISSION_CODE);
}

But when i run it in android 10 ,i get “undefined” in my log and any dialog box in phone.
Below my vue method.

  requestStoragePermissions() {  
        const activity = Application.android.foregroundActivity || Application.android.startActivity;
        let ctx = Utils.android.getApplicationContext();
        let execc = com.ecodev.Mifi.MyUtils.requestForStoragePermissions(activity, null);
        let exec = com.ecodev.Mifi.MyUtils.checkStoragePermissions(ctx);
        console.log('requestForStoragePermissions' + execc);
        console.log(exec);
    },

I read several post on the same subject and test this in vain.
Storage Permission Issue In android 10+ devices https://medium.com/@kezzieleo/manage-external-storage-permission-android-studio-java-9c3554cf79a7

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật