You can use the web view approach that is the app will open the webpage of you PHP without having to write it in java for the app.
For example java web view containers code will help you display your website or PHP page inside you app and not in the smartphone web browser.
Example code (main activity, android xml):
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/urlContainer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android
rientation="horizontal" >
<WebView
android:id="@+id/webView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</LinearLayout>
--------------------------------------------------------------------
Java code for the web view function:
public class WebViewActivity extends Activity
{
private WebView webView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_webview);
webView = (WebView) findViewById(R.id.webView);
webView.setWebViewClient(new MyWebViewClient());
String url = "http://THELOCATIONYOURPHPORWEBSIDE.com";
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl(url);
}
private class MyWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
}
}