title: how to sign up to parse.com with profile picture in android
body: <p>I want to sign up with parse.com user , I tried signup firstly with parsefile (profilePicture) but I got exception "java.lag.illegalStateException: Unable to encode an unsaved parsefile" with this code , </p>
  
  <pre><code>final ParseUser UserObject = new ParseUser();
  UserObject.setUsername(userModel.getUsername());
  UserObject.setEmail(userModel.getEmail());
  UserObject.setPassword(userModel.getPassword());
  UserObject.put("Mobile_Number",userModel.getMobile_Number());
  UserObject.put("Name",userModel.getName());
  if(Mem_photobitmap!=null){
  
      UserObject.put("ProfilePicture",profilepicFile);
  }
  UserObject.signUpInBackground(new SignUpCallback() {
  
      @Override
      public void done(ParseException ex) {
  
          // TODO Auto-generated method stub
          dismissProgressdialog();
          if (ex == null) {
  
              application.saveUser_UserName(userModel.getUsername());
              application.saveUser_Name(userModel.getName());
              application.savePassword(userModel.getPassword());
              application.saveUserEmail(userModel.getEmail());
              Toast.makeText(getApplicationContext(), "Signed Up Successfully", Toast.LENGTH_LONG).show();
          } else {
  
              Toast.makeText(getApplicationContext(), ex.getMessage(), Toast.LENGTH_LONG).show();
          }
      }
  });
  </code></pre>
  
  <p>I searched and got the link <a href="https://stackoverflow.com/questions/29059943/parse-file-saveing-error-unable-to-encode-an-unsaved-parsefile">Parse file saveing error,&quot;&quot;Unable to encode an unsaved parsefile&quot;</a></p>
  
  <p>I tried this code again , uploading first the profilepicture and then with ProgressCallback() i try to sign up but also got the same exception with this code </p>
  
  <pre><code>//first save profile pic to parse
  if(Mem_photobitmap !=null){
  
      profilepicFile = userModel.getProfilePicture();
      profilepicFile.saveInBackground(new SaveCallback() {
  
          @Override
          public void done(ParseException e) {
  
              if(e!=null){
  
                  Toast.makeText(getApplicationContext(), e.getMessage(), Toast.LENGTH_LONG).show();
              }      
          }
  }, new ProgressCallback() {
  
      @Override
      public void done(Integer arg0) {
  
          // TODO Auto-generated method stub
          // PrepareParseUser();
          final ParseUser UserObject = new ParseUser();
          UserObject.setUsername(userModel.getUsername());
          UserObject.setEmail(userModel.getEmail());
          UserObject.setPassword(userModel.getPassword());
          UserObject.put("Mobile_Number",userModel.getMobile_Number());
          UserObject.put("Name",userModel.getName());
          if(Mem_photobitmap!=null){
  
              UserObject.put("ProfilePicture",profilepicFile);
          }
          UserObject.signUpInBackground(new SignUpCallback() {
  
              @Override
              public void done(ParseException ex) {
  
                  // TODO Auto-generated method stub
                  dismissProgressdialog();
                  if (ex == null) {
  
                      application.saveUser_UserName(userModel.getUsername());
                      application.saveUser_Name(userModel.getName());
                      application.savePassword(userModel.getPassword());
                      application.saveUserEmail(userModel.getEmail());
                      Toast.makeText(getApplicationContext(), "Signed Up Successfully", Toast.LENGTH_LONG).show();
                  } else {
  
                      Toast.makeText(getApplicationContext(), ex.getMessage(), Toast.LENGTH_LONG).show();
                  }
              }
          });
      }
  });
  </code></pre>
  
  <p>any help please </p>