-5
  String url = "file:///app/src/main/assets/sample.jpg";

Error

W/System.err: java.io.FileNotFoundException: /app/src/main/assets/sample.jpg: open failed: ENOENT (No such file or directory)
W/System.err:     at libcore.io.IoBridge.open(IoBridge.java:491)
W/System.err:     at java.io.FileInputStream.<init>(FileInputStream.java:76)
W/System.err:     at org.apache.http.entity.mime.content.FileBody.writeTo(FileBody.java:100)
W/System.err:     at org.apache.http.entity.mime.HttpMultipart.doWriteTo(HttpMultipart.java:206)
W/System.err:     at org.apache.http.entity.mime.HttpMultipart.writeTo(HttpMultipart.java:224)
W/System.err:     at org.apache.http.entity.mime.MultipartEntity.writeTo(MultipartEntity.java:183)

enter image description here

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115

1 Answers1

2

If you want to load image from a assets folder you can use the assets Manager to load it

AssetManager assetManager = getAssets();
InputStream is = assetManager.open("sample.jpg");
Bitmap  bitmap = BitmapFactory.decodeStream(is);
imageView.setImageBitmap(bitmap);  

and for more detail look it the following link https://www.concretepage.com/android/android-assetmanager-example-to-load-image-from-assets-folder

I hope it will help you and one more thing you have also put your .properties file in java folder with classes which is also incorrect .so correct it also. If any problem then ask again.

thanks

Mudassir Khan
  • 1,714
  • 1
  • 20
  • 25