Android Question Accessing online database - Best Approach?

Discussion in 'Android Questions' started by tsteward, Feb 28, 2015.

  1. tsteward

    tsteward Active Member Licensed User

    Yes I have searched and there are a million threads on this which becomes confusing.

    At the moment I have an online database for people to register my app as follows:
    Code:
    Sub regLicense
        
    Dim Register As HttpJob
        
    Dim mail, name As String
        name = manager.GetString(
    "UsersName")
        mail = manager.GetString(
    "UsersEmail")
        Register.Initialize(
    "Register", Me)
        Register.download2(
    "http://locksdownunder.XXX.com/register.php"Array As String ("Action""RegisterPH""UName", name, "Mail", mail))
    End Sub
    My php script does the database stuff end returns JSON formatted response which I deal with in jobdone:
    Code:
    sub JobDone(job As HttpJob)
        
    Log("JobName = " & job.JobName & ", Success = " & job.Success)
            
    If job.Success Then
            
    Dim res, action As String
            
    Dim parser As JSONParser
            res = job.GetString
            parser.Initialize(res)
            
    Select job.JobName
                
    Case "Register"
                    action = parser.NextValue
    ......
    end sub
    Now all this works fine for me.

    My question is I now want my app to search other tables and return the results.
    My app will provide the table name to search and the string and field to search.
    Returned may be many records which if:
    > 30 I will tell the user too many possibilities please refine your search.
    < 30 I will display the results.

    This is a text only database.
    So my question is to I keep using the same method as used above and return the results using json format. (I have now idea what i'm doing.)

    Or am I better of using RDC or similar.

    Does anyone have the time or patients to help me here please?
     
  2. edgar_ortiz

    edgar_ortiz Active Member Licensed User

    In my experience (i have 4 app) that access remote databases.

    The best approach is the way you are doing.

    I use Mysql and Store Procedure to handle the data.

    Regards,

    Edgar
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    If you can use RDC on your server then RDC is usually the best approach, assuming that you do not want to build a custom back end solution with B4J.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice