问题描述:

I have a web application that uses both localstorage but also server side SQL storage. When I test my APK file using Eclipse only the html pages with localstorage work and not the server stuff in the PHP files. How can I direct my PHP files to go to a server since all the APK does it package everything on the client side?

Thanks

网友答案:

You can run PHP on Android. Try SL4A. Web servers can exist on a mobile. There are quite a few that function as a local server, within Android apps.

网友答案:

You can't run php files on mobile except on the browser

So if you want to run PHP files put them on the server and invoke them to return or accept data from you

To run PHP files you need a web server which doesn't exist on a mobile

I believe that you asked this because you could run javascript & HTML files on the mobile

I will recommend two things

1- If you need to run PHP make ana AJAX request on it and keep it on the server and remember the cross-domain

2- you need to consider the performance of the app you are making because after personal experience its slow

One More thing it works on the chrome because you have a web server (APACHE) on your machine

相关阅读:
Top