1

Hi I'm trying to download the image which I have upload in the Custom Object from the dashboard.uid is the id I'm getting on fetching that custom Object

  QBContent.downloadFile(uid, new QBEntityCallbackImpl<InputStream>(){
            @Override
            public void onSuccess(InputStream inputStream, Bundle params) {

                Bitmap bitmap = BitmapFactory.decodeStream(inputStream);

                if (bitmap != null) {
                    bankImage.setImageBitmap(bitmap);
                }else {
                    bankImage.setBackgroundColor(ContextCompat.getColor(getActivity(), R.color.blue));
                }
            }

            @Override
            public void onError(List<String> errors) {


                for (String error: errors){
                    Log.d(TAG , "--errors-"+error);
                }

            }
        }, new QBProgressCallback() {
            @Override
            public void onProgressUpdate(int progress) {

            }
        });

Getting this error:

Entity you are looking for was not found

Any Help is highly Appreciated.

Nitesh Tiwari
  • 4,742
  • 3
  • 28
  • 46
  • from where do u get the uid? – Veer3383 Jan 28 '16 at 11:30
  • @Veer3383 as mention in the question uid is the id I'm getting on fetching that custom Object – Nitesh Tiwari Jan 28 '16 at 11:45
  • i have uploaded my file to content module and what i have is the blob_id, i need to get the uid of the associated blob_id. its Showing me in the log. the body of blob contains uid, but no idea how to get it? can you help with this? – Veer3383 Jan 28 '16 at 11:51

1 Answers1

2

I was trying to fetch From Content rather that from Custom where I have uploaded the image.

Here's the code if any-one land up here:

QBCustomObject qbCustomObject = new QBCustomObject("Your_Class_Name", "Custom_Object_Id");

            QBCustomObjectsFiles.downloadFile(qbCustomObject, "YOUR_FIELD_TO_FETCH", new QBEntityCallbackImpl<InputStream>() {
                @Override
                public void onSuccess() {
                    super.onSuccess();
                }

                @Override
                public void onSuccess(final InputStream result, Bundle params) {
                    super.onSuccess(result, params);

                    Log.d(TAG, "successFull--bitmap");
                }

                @Override
                public void onError(List<String> errors) {
                    super.onError(errors);
                }
            }, new QBProgressCallback() {
                @Override
                public void onProgressUpdate(int i) {
                }
            });

Bingo that's it :-)

Nitesh Tiwari
  • 4,742
  • 3
  • 28
  • 46