Connect button works with laptop, but not with Android

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Connect button works with laptop, but not with Android

Post by DR White » Fri Jan 29, 2016 6:09 pm

Using LC 7.1

Why does the connect button for "Connecting to a MySQL database" work from my laptop, but not when I test it with the android simulator?

The code for my button is below:

on mouseUp
  -- use a global variable to hold the connection ID so other scripts can use it
    global gConnectionID
    
    -- set up the connection parameters - edit these to suit your database
    put "runrev.com" into tDatabaseAddress
    put "runrev_test" into tDatabaseName
    put "runrev_example" into tDatabaseUser
    put "example" into tDatabasePassword
    
    -- connect to the database
    put revOpenDatabase("MySQL", tDatabaseAddress, tDatabaseName, tDatabaseUser, tDatabasePassword) into tResult
    
    -- check if it worked and display an error message if it didn't
    -- & set the connection ID global
    if tResult is a number then
        put tResult into gConnectionID
        answer info "Connected to the database." & cr & "Connection ID = " & gConnectionID
    else
        put empty into gConnectionID
        answer error "Unable to connect to the database:" & cr & tResult
    end if
end mouseUp

Thanks,

David

KimD
Posts: 225
Joined: Wed Jul 08, 2015 5:51 am

Re: Connect button works with laptop, but not with Android

Post by KimD » Mon Feb 08, 2016 8:25 pm

When I recently encountered something similar it was because I had forgotten to tick

Standalone Application Settings > Android > Application Permissions > Internet

Regards

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Connect button works with laptop, but not with Android

Post by LCNeil » Tue Feb 09, 2016 11:05 am

Also, make sure the MySQL external is included in your standalone application settings-
Screen Shot 2016-02-09 at 10.04.34.png

Kind Regards,

Neil Roger
--
LiveCode Support Team ~ http://www.livecode.com
--

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re: Connect button works with laptop, but not with Android

Post by DR White » Sat Mar 19, 2016 1:43 am

Neil,

Thanks,

David

Post Reply