Building Android app for running PHP and MySQL on Android Tablet

13,186

Solution 1

I am currently maintaining free and open source web server solution stack package, consisting mainly of the Lighttptd HTTP Server, MySQL database, PHP programming languages. It is still at beta stage.

It can give you a basic idea about how to develop this type of stuffs in android.

Yes, its true binaries must compiled for ARM CPU in order make file executable.

And you can use NDK but i recommend you to go with alternatives like CodeSourcery or Linaro

Here some starter tutorial for cross compiling Linux program to ARM

Anyway you can read this article how i cross compile for DroidPHP

Solution 2

here is some articles regarding cross compiling PHP, Nginx, Lighttpd on arm6

Cross compiling PHP

Cross compling LIghttpd

Cross compiling Nginx

Solution 3

I am New to android but something sounds wrong about all this.php is a server side scripting language. Now you are going to run around from hot spot to hot spot hosting I guess a web service backed by a mysql database. Do you have a static ip? Mysql is an excellent choice for a low end dbms if sqlite was not already built into droid. Like I said I am New and it's probably me but this just sounds wrong. From the answers I see someone talking about compiling php which would make it no longer script.

Share:
13,186
Manu
Author by

Manu

I am Manpreet from New Delhi, India.

Updated on July 24, 2022

Comments

  • Manu
    Manu almost 2 years

    I want to run PHP + MySQL server on my Android Device. People seem to suggest applications like KSWeb and Bit Web.

    Other solutions suggested are that I install an application that allows me to run Linux on Android. This requires the Android Device to be rooted. :(

    I don't want to use any other application for this. So I would like to build an application similar to KSWeb myself. I have searched around for how to start building such application but it has not helped so far. Any guidance on how to go about this?

    I mean how is it possible for KSWeb to build something like this, without root. :O

    Any guidance on how to go about building this application would be very helpful.

    Somewhere I was told to get the binaries compiled for ARMv6, but I don't know how to start.

    Can NDK be of any use to me?

    Please Help.

  • Manu
    Manu over 10 years
    Thanks. This looks very similar to what I need. I will study this and get back to you.
  • Manu
    Manu over 10 years
    Hey Shushant.. Can you explain me the steps to compile PHP, MySQL and Apache into Android? Compiling from source looks to be big work. I remember building Apache, PHP and MySQL on FreeBSD, it took several hours! :O I would be happy if you can explain the steps for compilation. :D
  • Shushant
    Shushant over 10 years
    compiling php along with commonly required extension is nightmare you will need to cross compile extension separately. if you need help in cross compiling create an new question at unix.stackexchange.com
  • Manu
    Manu over 10 years
    Thanks for a quick revert. I will learn more about cross compiling extension separately. Can you share with me the steps for compiling PHP in general on Android.
  • Manu
    Manu over 10 years
    Sorry Shushant for being a pain.. Do u have some link(s) for a tutorial on this. The above line is not much comprehensible for me.
  • Manu
    Manu over 10 years
    Actually we are going to run PHP+MySQL server on the tablet. That tablet won't be connected to Internet in general. The current application that I have runs over internet or LAN using Soap API. So I want to configure PHP + MySQL server on the tablet itself, so that there is not need to set up a different server on the LAN.
  • NoBugs
    NoBugs over 10 years
    All androids have sqlite built-in.
  • Manu
    Manu over 10 years
    If I was to write a new application, then I would rather write a native android application, why would I go the client-server way? :P
  • Shushant
    Shushant over 10 years
    if you want to make server access over world wide consider using dynamic dns service like freedns.afraid.org
  • Manu
    Manu over 10 years
    @Shushant.. No I won't make server access over world wide. Server would just be used as localhost or at max in LAN.
  • Manu
    Manu over 10 years
    Shushant.. I don't know if this is a bug with DroidPHP or no. But when I use getRunningServices I always get a service by the name of com.github.DroidPHP.ServerService. I get this even if the server is not running. I guess you need to add stopService in the btn_stopServer.setOnClickListener in the HomeActivity.java .
  • Manu
    Manu over 10 years
    I am using the cross compiled PHP, Lighttpd from your application to run the server on my android tablet. I am able to run these 2 successfully. But I am having issues running MySQL.. I need your help on this. Can you share your email address or something where we can talk?