How to call PHP function from Android?
<p>I want to call specific php function on server and also to send some parameters.
Till now I achieved that I can open php file using HttpClient and executed data transfer to Json and show that in my app.
So, now I want to be able to call specific function and send parameter to it, how can I do that??
Sorry I didn't mansion that I need to call that function from Android.</p>

<p>here some code:</p>

<pre><code>try {
            HttpClient httpClient = new DefaultHttpClient();
            HttpPost httpPost = new HttpPost("http://10.0.2.2/posloviPodaci/index.php");
            HttpResponse response = httpClient.execute(httpPost);
            HttpEntity entity = response.getEntity();

            is = entity.getContent();

        } catch (Exception e) {
            Log.e("log_tag", "Error in http connection" + e.toString());
        }

        // Convert response to string
        try {
            BufferedReader reader = new BufferedReader(new InputStreamReader(is,   "iso-8859-1"), 8);
            sb = new StringBuilder();
            sb.append(reader.readLine() + "\n");

            String line = "0";
            while((line = reader.readLine()) != null){
                sb.append(line + "\n");
            }
            is.close();
            result = sb.toString();

        } catch (Exception e) {
            Log.e("log_tag", "Error converting result " + e.toString());
        }

        // Parsing data
        JSONArray jArray;
        try {
            jArray = new JSONArray(result);
            JSONObject json_data = null;

            items = new String[jArray.length()];

            for(int i = 0; i &lt; jArray.length(); i++) {
                json_data = jArray.getJSONObject(i);
                items[i] = json_data.getString("naziv");
            }

        } catch (Exception e) {
            // TODO: handle exception
        }
</code></pre>

<p>Thanks in advance,
Wolf.</p>
