0

I am trying to make wallpaper app but I am facing a problem which is the low resolution after setting the wallpaper.

Although the real picture before setting as wallpaper is very high resolution from url.

This is my code:

public void set(View view) {
    Toast.makeText(MainActivity.this, "Setting wallpaper", Toast.LENGTH_LONG).show();

    Intent intent = new Intent(Intent.ACTION_ATTACH_DATA);
    intent.setDataAndType(getImageUri(this,bitmaptwo), "image/*");
    intent.putExtra("Bitmap", "image/*");
    startActivity(intent);

    }

public Uri getImageUri(Context inContext, Bitmap inImage) {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
inImage.compress(Bitmap.CompressFormat.JPEG, 0, bytes);
String path = MediaStore.Images.Media.insertImage(inContext.getContentResolver(), inImage, "Title", null);
return Uri.parse(path);
}
madhan kumar
  • 1,560
  • 2
  • 26
  • 36

1 Answers1

0

Try and convert the wallpaper to a vector, it will scale without any loss of resolution

check this out regarding vectors https://developer.android.com/studio/write/vector-asset-studio.html

user3875913
  • 245
  • 2
  • 11