0

I'm new, so, before all, I apologize for my mistakes (about english and more).

I found lots of questions about this problem but there are no answers that can solve my problem.

Here it is:

public class DeusCaritasEst extends Activity implements OnClickListener {

private String mFileName = "HelloWorld";

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_deus_caritas_est);

    Button button = (Button) findViewById(R.id.invia);

    button.setOnClickListener(this);

}

@Override
public void onClick(View v) {

    new MyAsyncTask().execute(mFileName);

}

private class MyAsyncTask extends AsyncTask<String, Integer, Double> {

    @Override
    protected Double doInBackground(String... params) {
        // TODO Auto-generated method stub

        post();

        return null;
    }

}

public void post() {
    MultipartEntity multipartEntity = new MultipartEntity();
    HttpPost httpPost = new HttpPost();
    httpPost.setEntity(multipartEntity);

}

}

I created a simple class that do nothing, just for seeing what was the error, and:

12-06 15:15:53.128: E/AndroidRuntime(16126): Caused by: java.lang.NoClassDefFoundError: org.apache.http.entity.mime.MultipartEntity

I linked httpmime (tried many different versions) library by "Project/Properties/JavaBuildPath/Libraries/add External Jars". But nothing work.

Tried many times Project/Clean, reboot Eclipse or pc :D

Same error with MultiPartEntityBuilder, with every version of httpmime/core.

What can I do?

  • you can look here for your answer http://stackoverflow.com/questions/20284542/upload-photo-using-httppost-multipartentitybuilder – Nitin Misra Dec 06 '14 at 15:01
  • Might also be useful: http://stackoverflow.com/questions/17159492/android-java-cant-find-multipartentity-class-despite-adding-it-to-build-path – stkent Dec 06 '14 at 15:15
  • Hi, thanks for the answers. stkent, unfortunately the jar in your answer doesn't contain multipartEntity (or the builder), so I cannot understand how he did it. Nitin Misra, it didn't work. Tried to check, tried the second answer too but always the same stupid error. It seems Eclipse can't really find that class. And I don't know any other way to send an audio file to my db. – BloodyEdivad Dec 06 '14 at 16:33

0 Answers0