First Time Android Woes

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
egolombek
Posts: 74
Joined: Thu Jan 30, 2020 2:11 pm

First Time Android Woes

Post by egolombek » Wed Jun 24, 2020 5:17 am

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 2649 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!!!

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: First Time Android Woes

Post by bangkok » Wed Jun 24, 2020 8:24 am

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

mrcoollion
Posts: 720
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

Re: First Time Android Woes

Post by mrcoollion » Wed Jun 24, 2020 8:46 am

See this post for internet checking on android : viewtopic.php?f=53&t=33635&p=187768#p187768

egolombek
Posts: 74
Joined: Thu Jan 30, 2020 2:11 pm

Re: First Time Android Woes

Post by egolombek » Wed Jun 24, 2020 11:30 am

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!!!

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7237
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: First Time Android Woes

Post by jacque » Wed Jun 24, 2020 3:49 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”