I received in response 2 options: 1. adb push () (destination-path-remote). Where to get (destination-path-remote)? 2. add picture to sdcard. What should I do if there are no rights to add to the sdcard folder?

    1 answer 1

    According to en-SO, the gallery displays images available in the system database with images. You can add them there, for example, like this:

    public static void addImageToGallery(final String filePath, final Context context) { ContentValues values = new ContentValues(); values.put(Images.Media.DATE_TAKEN, System.currentTimeMillis()); values.put(Images.Media.MIME_TYPE, "image/jpeg"); values.put(MediaStore.MediaColumns.DATA, filePath); context.getContentResolver().insert(Images.Media.EXTERNAL_CONTENT_URI, values); } 
    • Here you can specify the path to the picture type: C: \ newFolder, etc.? And where to get the Context? Sorry for the stupid questions I'm new to android. If there are links to answers please drop. - Andrew Lawmaking
    • @AndrewLawmaking, well, you first need to write a picture to a file. It can be done differently, depending on how you get the picture - a photo camera, a link, a screenshot, a personal Bitmap, an icon from resources, etc. In this case, you need permission to write and read data. The context is activation, service etc. You can often get the getContext method from different objects - YuriySPb
    • Thanks for the clarification kind of work out. Another question: is it possible to select several pictures from the gallery and transfer to imageview? - Andrew Lawmaking
    • @AndrewLawmaking, you can. But your question is very vague - you need then switching between them, and if so, which one? Or should it all be simultaneously displayed in one widget? Try to clearly formulate the question and ask it in a new question - YuriySPb