Sending String and Image to PHP script from android
<p>Im using this code to make <strong>multipart entity</strong> and send String and Image to a PHP page - </p>

<pre><code>            HttpClient client = new DefaultHttpClient();
            HttpPost post = new HttpPost(URL);
            MultipartEntityBuilder entityBuilder = MultipartEntityBuilder.create();
            entityBuilder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);

            entityBuilder.addBinaryBody("Image", imageFile);              
            entityBuilder.addTextBody("name",name);

            HttpEntity entity = entityBuilder.build();
            post.setEntity(entity);
            HttpResponse response = client.execute(post);           
            HttpEntity httpEntity = response.getEntity();
            Log.d("result", EntityUtils.toString(httpEntity));
</code></pre>

<p>But <strong>DefaultHttpClient</strong> and <strong>HttpPost</strong> have been deprecated. </p>

<p>What should be the alternative code here ?</p>