Mobile Platform

Issue #66 resolved
Former user created an issue

Originally reported on Google Code with ID 66

This isn't really an issue but I saw nowhere to post this. Currently I use phpliteadmin
to manage all of the database that exist on my rooted Droid X. As an Android developer
it is extremely frustrating to have to pull and push your databases off your phone
and put them back on your phone whenever you are wanting to make a database change.
With phpliteadmin I now don't have to do this. While I am still waiting for multiple
bugs to be worked out I believe this is a solid solution for Android developers to
manage their development databases and get them ready for production. 

If you are un-experienced with Android development the process for creating a database
for an application is one of the most frustrating things to deal with and to MANAGE.
Your only hope really is to use the Eclipse debugger to make sure your code is executing
properly on the database. If you run into a problem or need to change the schema of
your database it is almost dauntingly impossible to perform this task inside of the
extremely slow debugging life cycle, developers you understand my frustration here.
Your only widely available solution is to use something like SQLite Browser and pull
the database off your phone and push it back, this just isn't fluent. Below I have
posted a process that I currently use for managing my dev and production databases
for Android development using phpliteadmin and a few other applications to make the
magic happen. 

There are a few steps to accomplishing this task. You need two applications and your
phone MUST be rooted.
 - PAW Server (PAW Server is an amazing web server for Android)
 - GScript Lite (Executes bash scripts with root access)

You must first install PAW Server from the Android market. Once you have done that
you need to install the PHP Plugin for PAW. You can find that by navigating to the
URL of your newly installed PAW Server(Your Device) and go to Plugins->PHP Setup. 

After you install PAW and the PHP Plugin verify that its working by adding your phpliteadmin.php
file to your /app/ folder on your mobile device. If you can navigate to the file and
hit it, then you should be good to proceed.

Next install GScript Lite. I have also attached my GScript file that I use to make
the magic happen. Take EXTREME caution with proceeding to the next step. If you mess
this up or don't perform some type of test before hand to make sure the logic of the
code will work for your phone DO NOT PROCEED. I would also encourage you to make a
backup of your mobile device before you even execute this script and be in a situation
to flash your phone if something messes up. 

Download DB Perm and put it on your SD card and load it into GScript. This script file
looks at your /data/data/ directory and applies the appropriate permissions to it,
so that phpliteadmin can scan the directory structure. In GScript you must give the
script file ROOT access so that it can perform this operation. Once the script is done
executing go back to your browser and navigate to your phpliteadmin file and you should
be able to access every single database for every application that is on your phone.


If you start getting a ton of force closes showing up on your phone then you have messed
up, and for some reason the logic of the DB Perm file did not work correctly (although
99% of the time it should work almost all Android devices have the same directory structure
at the root level). This is the worst case scenario. Again make a backup before your
proceed of your mobile device. 

The attached phpliteadmin file is version 1.8.7 I am getting ready to play with 1.8.8
in a moment. Good luck and I hope this works for anyone that tries it. I can help answer
any questions :).


Please Note: You must apply the DB Perm file often. The reason, is because of Androids
behavior with security and protecting the applications. Every time you open an application,
it re-applies the permissions to the application. So if you are working on a database
you manage for an app and then open that app up on the phone to test or something.
More than likely you will need to re-apply the DB Perm file. 

Reported by combsmsteven on 2011-10-26 13:37:11

<hr> * Attachment: DB Perm .sh * Attachment: phpliteadmin .php

Comments (11)

  1. Dane Iracleous

    ``` This would be a good article for the wiki. Can I give you wiki-editing permission so you can create the article? Also, which bug in particular is causing the most problems for you? ```

    Reported by `diracleo` on 2011-10-26 23:40:00

  2. Former user Account Deleted

    ``` Absolutely I would love to create an article. I have yet to investigate 1.8.8 yet. Previously the biggest thing I was running into was not being able to update records, I could select all day long just not update things. I know that is really vague and the problem might be resolved. Once I sit down and get my hands on some 1.8.8 I can post more issues as I run into them with a more in depth response. ```

    Reported by `combsmsteven` on 2011-10-27 00:33:49

  3. Dane Iracleous

    ``` I just gave you wiki-editing permissions. You can now create the article, and I think, attach files to it.

    Also, I released v1.9.0 earlier today, which includes a lot more features - not too many bug fixes though.

    When you say that you were unable to update records, were you using the SQL tab and writing your own queries? Because you can update records on an individual basis using the GUI. Under the Browse tab for a table, you can put checks in the checkboxes next to records and then from the drop down menu, select "Edit", which will bring up a page with all the selected records and their current values pre-filled in the input boxes. You can then make changes and click "Save", which will update the records. ```

    Reported by `diracleo` on 2011-10-28 01:37:09

  4. Former user Account Deleted

    ``` Ok, sweet.

    I think I was unable get success with self written queries to work correctly. However, that was a few versions ago. I am downloading 1.9 right now, cant wait :). ```

    Reported by `combsmsteven` on 2011-10-28 01:39:44

  5. Dane Iracleous

    ``` Awesome! I actually didn't release v1.9.0 yet. It is in SVN. You can grab it from there. ```

    Reported by `diracleo` on 2011-10-28 02:50:53

  6. Former user Account Deleted

    ``` I just added the article and put in the code for phpliteadmin 1.8.9

    1.8.9 has major performance increases. I don't know what you changed but going from table to table is MUCH faster. I did run into an issue while I was checking out 1.8.9. If I try to access a DB that does not have any permission tags in the bracket [] aka it didnt have rights. I get an error that says, "This application is unusable until permissions are fixed" or something to that effect. It would be nice if I could continue on using the app without having to reload the page. It might be beneficial to have some type of error box where all errors are reported.

    Because there are so many databases on a phone, depending on the amount of applications you actually have. Sometimes there can be up to 200 DB's you are filtering through. If I don't apply my DB Perm file, I get about a page and a half of errors before I actually see the application itself. If there was some type of error Control that you could build into it that receives all errors I think that would be pretty fluent. ```

    Reported by `combsmsteven` on 2011-10-29 17:24:51

  7. Dane Iracleous

    ``` That's a good idea. I'll add it to the feature request. I fixed the issue with the permissions bug, so that should not show anymore. ```

    Reported by `diracleo` on 2011-10-30 13:04:58

  8. Dane Iracleous

    ``` This information is now in the wiki ```

    Reported by `diracleo` on 2012-06-02 09:34:14 - Status changed: `Fixed`

  9. Former user Account Deleted
    but the links in the wiki is dead.
    

    Reported by SirVonThomas on 2012-11-21 04:25:40

  10. Former user Account Deleted
    I will update it sorry about that. 
    

    Reported by combsmsteven on 2012-11-21 04:27:18

  11. Log in to comment