Open and save an image in Android Mode and share it on the net

edited March 2016 in Android Mode

Hi guys for a work at University I need to develop an Android App that open an image in the gallery, apply some filters, and then save image in the gallery in a new folder (better is the image can be shared on facebook/instagram using android built-in sharing api).

Do you know how to do this? I am not new in Processing and I developed a couple of very tiny apps on Eclipse, so I don't have problems using Eclipse, but I don't know how to do this (I am still learning Processing for Android with Eclipse compiler, and I know very little of Android SDK :( )

Thanks a lot to everyone

Tagged:

Answers

  • Did you find a solution to this???

  • @KessonDalef===

    in order to get your image from the gallery you have to use an intent and an action. Code snippet below:

        import android.net.Uri;
        import android.content.Intent;
    
        private static final int SELECT_IMAGE = 1;
    
    
        void setup(){
    
          size(800,600);
          background(255,0,0);
    
        }
    
        void draw(){
          println("jetourne");
        }
    
    
        void mouseReleased(){
    
         Intent intent = new Intent();
                        intent.setType("image/*");
                        intent.setAction(Intent.ACTION_GET_CONTENT);
                        startActivityForResult(Intent.createChooser(intent,
                                "Select Picture"), SELECT_IMAGE);
    
        }
    
         public void onActivityResult(int requestCode, int resultCode, Intent data) {
                if (resultCode == this.getActivity().RESULT_OK) {
                    if (requestCode == SELECT_IMAGE) {
                        Uri selectedImageUri = data.getData();
    
                    }
               }
         }
    
Sign In or Register to comment.