Page 1 of 1

First Time Android Woes

Posted: Wed Jun 24, 2020 5:17 am
by egolombek
Building an app for Android for the first time and having the expected newbie issues. Hoping the amazing community here can help.

Problem 1: I am trying to access a mySQL database. (Works fine in developer mode) Searching previous questions leads me to understand that I need to include a mySQL extension. So, I chose "select inclusions" and added the mySQL inclusion. (BTW, I have no idea which other inclusions I need to check off -- I have always had it automatically check). In any case, even still I get the message, Problem connecting to the Internet: Unknown MySQL server host. (Code follows picture) What am I doing wrong?
error_msg.png
error_msg.png (60.13 KiB) Viewed 3501 times
put "hv-par5-031.clvrcld.net:14287" into tDatabaseAddress
put "bvsxbw4b5vg63vkukwym" into tDatabaseName
put "u5egeljqvummy0z2" into tDatabaseUser
put "XXXXXXXXXXXXXXXXXX" into tDatabasePassword


-- connect to the database

put revOpenDatabase("MySQL", tDatabaseAddress, tDatabaseName, tDatabaseUser, tDatabasePassword) into tResult


Problem 2: The fonts on the Android simulator do not much the fonts on my stack. So, I tried adding the files in Copy Files but does not seem to make a difference. Ideas?

As always, thank you all for your help!!!

Re: First Time Android Woes

Posted: Wed Jun 24, 2020 8:24 am
by bangkok
INCLUSIONS
You checked "MySQL".
Just to be sure : have you checked as well the line "database", bellow ?


STEP2
Replace

Code: Select all

put revOpenDatabase("MySQL", tDatabaseAddress, tDatabaseName, tDatabaseUser, tDatabasePassword) into tResult 
with

Code: Select all

put "hv-par5-031.clvrcld.net" into tDatabaseAddress
put revOpenDatabase("MySQL", tDatabaseAddress, tDatabaseName, tDatabaseUser, tDatabasePassword,"14287") into tResult

STEP3
You Android might have an connexion/internet issue.
The best way to check : add a button in your stack :

Code: Select all

on mouseup
launch url "http://www.livecode.com"
end mouseup

Re: First Time Android Woes

Posted: Wed Jun 24, 2020 8:46 am
by mrcoollion
See this post for internet checking on android : viewtopic.php?f=53&t=33635&p=187768#p187768

Re: First Time Android Woes

Posted: Wed Jun 24, 2020 11:30 am
by egolombek
So, it turns out that there is a check box to allow the internet on the Android settings page. Who knew? (OK, that's why I post on the absolute beginners page -- clearly so newbie, no thought of asking this) Only discovered this after searching the forums for a while and coming across a 2011 post on a similar problem. Nice.

That said... it only works when I physically connect a phone. The emulator does not work with the internet. I wonder if there is a way...

Any thoughts about the font problem?

Thank you!!!

Re: First Time Android Woes

Posted: Wed Jun 24, 2020 3:49 pm
by jacque
Adding the font to the Copy Files pane of the standalone settings is the first step. You also need to add a line to the preOpenStack handler to start using the font. See "start using font" in the dictionary.