SQL connection on Android SDK
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 81
- Joined: Mon Jan 09, 2012 4:48 pm
SQL connection on Android SDK
my app works great on iphone and within simulator and on my desktop.
when i test the app within the Android SDK i get a fail to connect.
works on on everything else.
i am using version 2.2 in the android simulator and i have clicked the the mysql box in the build options.
thanks
when i test the app within the Android SDK i get a fail to connect.
works on on everything else.
i am using version 2.2 in the android simulator and i have clicked the the mysql box in the build options.
thanks
Re: SQL connection on Android SDK
Hi,
Are you trying to use a local database on the Android device or a database on a remote server? If locally, then you should probably use SQLite instead of MySQL. If remotely, there might be a problem with the use of sockets (just a hunch). A solution would depend on what you'll reply.
What happens if you use a newer version of Android?
Kind regards,
Mark
Are you trying to use a local database on the Android device or a database on a remote server? If locally, then you should probably use SQLite instead of MySQL. If remotely, there might be a problem with the use of sockets (just a hunch). A solution would depend on what you'll reply.
What happens if you use a newer version of Android?
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Posts: 81
- Joined: Mon Jan 09, 2012 4:48 pm
Re: SQL connection on Android SDK
its on a remote server.
i followed a few of the business-academy lessons, and this one
http://lessons.runrev.com/s/lessons/m/4 ... l-database
and like i said it works a treat on iOS and my desktop..
does that help at all?
i followed a few of the business-academy lessons, and this one
http://lessons.runrev.com/s/lessons/m/4 ... l-database
and like i said it works a treat on iOS and my desktop..
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 "www.something.com" into tDatabaseAddress
put "something" into tDatabaseName
put "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
does that help at all?
-
- Posts: 81
- Joined: Mon Jan 09, 2012 4:48 pm
Re: SQL connection on Android SDK
i also used version 4.0
Re: SQL connection on Android SDK
You might check your standalone settings and make sure you check mySql under the externals section of the android settings.
-
- Posts: 81
- Joined: Mon Jan 09, 2012 4:48 pm
Re: SQL connection on Android SDK
yes i have already tired that.
Re: SQL connection on Android SDK
I had this problem also...
Built the app for iPhone and android.
Works perfectly on LiveCode IDE RUN mode, works well on my iPhone, but I can't make it work on Android. I don't have a slight idea why...
I sure checked MySQL support on my standalone application settings.
Can somebody please advise?
Thanks,
Genie
Built the app for iPhone and android.
Works perfectly on LiveCode IDE RUN mode, works well on my iPhone, but I can't make it work on Android. I don't have a slight idea why...

Can somebody please advise?
Thanks,
Genie
Re: SQL connection on Android SDK
What is in "the result" after the connections fails?
Re: SQL connection on Android SDK
It says:Klaus wrote:What is in "the result" after the connections fails?
Unknown MySQL server host 'www.***.com'(13)"
Re: SQL connection on Android SDK
Hi genie,
Sorry, no idea.
Best
Klaus
hmm, if that works on iOS and desktop then this is indeed very mysterious!genie wrote:It says:Unknown MySQL server host 'www.***.com'(13)"Klaus wrote:What is in "the result" after the connections fails?
Sorry, no idea.
Best
Klaus
Re: SQL connection on Android SDK
Hi thread starter!
Kindly check you standalone application settings...
On the bottom right corner of the Android tab, there is "Application Permissions". Make sure you tick "Internet" in there. Doing this ensures that your adroid app can connect to your server via the Internet.
I got this advise from runrev.
I tried and it worked on my end.
Regards,
Genie
Kindly check you standalone application settings...
On the bottom right corner of the Android tab, there is "Application Permissions". Make sure you tick "Internet" in there. Doing this ensures that your adroid app can connect to your server via the Internet.

I got this advise from runrev.

Regards,
Genie