Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Save Image File on Parse.com Android

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 988
    Comment on it

    Here I am getting image path from Native data

    Here IMAGEPATH is the path of image from Camera.

      ByteArrayOutputStream stream1 = new ByteArrayOutputStream();
                // Compress image to lower quality scale 1 - 100
                bitmap1.compress(Bitmap.CompressFormat.PNG, 100, stream1);

    Object image = null; try { String path = null; image = readInFile(IMAGEPATH); } catch (Exception e) { e.printStackTrace(); } FlexLogger.createLog("path : " + IMAGEPATH); // Create the ParseFile parseFile = new ParseFile("file1", (byte[]) image);

    Then save this

       
     parseFile.saveInBackground(new SaveCallback() {
                            @Override
                            public void done(ParseException e) {
                                if(e==null){

    } else{ } } });

    Put this file whenever required, user1 is the object of the Class which have column profilePicture

     user1.put("profilePicture", parseFile);

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: