简体   繁体   中英

How do I add PHP files to my android APK file?

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'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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM