View Single Post
  #98  
Old November 21st 18, 08:13 PM posted to comp.mobile.android,alt.comp.freeware,microsoft.public.windowsxp.general
Bill[_40_]
external usenet poster
 
Posts: 346
Default Report: My first "hello world" using Android Studio freeware on Windows worked just fine (in about an hour)

In message , arlen michael holder
writes
On Wed, 21 Nov 2018 10:27:10 +0000, Bill wrote:

"W/System.err: java.sql.SQLException: Unable to connect to any hosts due
to exception: java.net.SocketException: java.net.ConnectException:
Connection refused"


Hi Bill,
It's good that you're working on solving that SQL connection, as the
ability to access an SQL database seems to be a fundamental skill.

As you noted, I can't help you with that, most likely, as I can't even
spell SQL, but where, it seems, you "may" be running into this Network on
Main Thread exception:
https://developer.android.com/refere...kOnMainThreadE
xception

Googling, it's a common message, but that doesn't mean it's easy to debug:

https://www.google.com/search?&q=W%2...ql.SQLExceptio
n%3A+Unable+to+connect+to+any+hosts+due++to+excep tion%3A+java.net.Socket
Exception%3A+java.net.ConnectException%3A++Connec tion+refused

The "implication" is that the main activity can't do networking:
https://stackoverflow.com/questions/...tion-java-sql-
sqlexception-unable-to-connect-to-any-hosts-due-to
Where there are two workarounds proposed in that cite.

It seems this restriction is "new" so maybe the version Butterfield used
doesn't have this problem.

I think we should, if we can, use tutorials that are current with at least
Android Studio version 3 moving forward (if possible). To that end, I'll
search for a few, particularly with respect to a timer.

I also thought of another simple KISS app, which is a family birthday
reminder, which has a single-button click to tell you the next upcoming
birthday.


I'm beginning to think that you were right about avoiding Butterfield 4
for the time being. Every step I take seems to lead into something else
that I don't know. The complications I have include:
1. I actually built the database in MariaDB, the more open version of
Mysql. Mostly it identifies itself as mysql, but I can see it might lead
to complications. I see that there are MariaDB connectors. I might try
one of them.
2. I am not sure how the database should be set up wrt servers. MySQL
has a server on port 3306, but would usually be accessed via the
internet through an Apache server.
3. My fruits database is there and I can access it via a MySQL command
line, but I'm not sure how the connector relates to this. If I poke a
browser at 127.0.0.1:3306 I see gibberish with a few recognisable words.
4. I see a warning that my main activity is too busy. Maybe this relates
to the main activity and any networking restriction, although the fact I
am seeing "Connection refused" in an error message implies that it is
trying to connect.

All the above would normally make me dig in and try to fathom out each
lack of knowledge individually, but Android Studio would probably be
about 100 versions later on by the time I came out of the fog.

I think the birthday suggestion is OK as long as it didn't involve a
database at this stage. We have quite a lot of family birthdays, and I
usually just keep them in the Google Calendar app.

The following is half a joke, half not: For security reasons, I'm
beginning to think I should have a real birthday and then an online
birthday, just like the British Royal Family have Official Birthdays as
well as real ones. The online birthday, or birthdays, could be issued to
sites that demand a birthday as part of the registration process. Maybe,
if I used them, I should have a Twitter birthday, a Facebook birthday,
and so on.

I'll poke around a bit as well re timers and cameras. My computer time
tends to be in 10 to 15 minute segments between other things, so intense
concentration on anything is a problem.
--
Bill

---
This email has been checked for viruses by AVG.
https://www.avg.com

Ads