Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Ghost in the machine - Tin Hat Time - Two strange errors in a row - open file - getting html?

Author
Message
JRNTexas
13
Years of Service
User Offline
Joined: 24th May 2011
Location: Austin, Texas
Posted: 10th Apr 2015 03:58
Below is my code. The last line is not executed until the file is opened and closed. There are more lines in my app below the http call but I left them out for brevity sake.

This code is in a subroutine (gosub) and I can call it before anything else and I get the same problem. There is no code before this code in the application.

The file exists. It's a simple text file with two lines in it.

The file is only two lines of text:
Quote: "
1
display.txt"


Here is what I get back:

A line of HTML which has nothing to do with the contents of the file.

Anybody ever experienced a similar problem?



JRNTexas
13
Years of Service
User Offline
Joined: 24th May 2011
Location: Austin, Texas
Posted: 14th Apr 2015 12:09 Edited at: 14th Apr 2015 12:31
This is happening to me again. Under slightly different circumstances.

I'm loading an rss feed using the http functions.

When I run the code on my windows system, it runs fine.

When I run it on Android it messes up.

Here is the situation:

I use two different sources (URLs) that I get the rss from.

Both seem to work just fine, but when I run a routine to pull out what I want from the rss feed, on Windows I can pull out the data I need. But when run on Android, the file is full of HTML instead of XML and the HTML has no usable data.

The only difference is that I used two different sources for the data.

But both sources work just fine in Windows but don't work on Android.

Also, this seems similar (yet different) to a problem I had from the difference between Windows and Android in filename use. Windows doesn't care if you use a capital or not and Android does.

I am not cross mixing the name of the file so I know that is not the problem. And I am consistent in my use of the variables.

I don't understand why switching sources works on Windows but gives me HTML from who knows where on Android?

Please help! I'm open to any suggestions on where to start looking

Please forgive the messiness. I pulled it out of the code for my app and did not clean up the changes I had to make to get it to run standalone.

I invite you to run the code on your Windows system then broadcast it to your Android and see if you get the same problem. I've used several Android systems and have the problem on all of them.

There are two things to look for. One is the "newsHeadlinesCounter" that is displayed on the screen upon execution.

If you run this on Windows, changing the "httpHost$ and "httpFile$" by commenting and un-commenting that section of the code, you will see that in Windows the counter progresses using either httpHost$.

However in Android, if you use "ABCNews" as the httpHost$, you get HTML (which has no data and does not advance the counter) and I have no clue where the HTML is coming from.

The other thing to look at is the actual print to the screen of the file contents as it reads it. In Windows you can see when the counter advances it has hit some XML it likes. In Android, if you look at what is printing out, it is not XML at all but HTML from somewhere.

I'm sure that I'm doing something wrong. I would just like for someone to point that out to me! Thanks for any help!!!!

Here is my code:

JRNTexas
13
Years of Service
User Offline
Joined: 24th May 2011
Location: Austin, Texas
Posted: 14th Apr 2015 13:23 Edited at: 14th Apr 2015 13:23
Well, I think I resolved my issue but it still seems a little strange. And by resolved, I mean I can't use the RSS feed I was trying to use.

AGK must be sending a header in http that tells the supplier of RSS, what device is requesting the information. If it's windows, it just gives the RSS, however when requesting from Android, I think it's giving back and error HTML page.

It's the only conclusion I've come to. Some other sites don't seem to have this problem.

I would still like to know if anyone else has a clue how to resolve this issue.

Thanks....
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Apr 2015 13:06
Download Fiddler (it's free). It will show you the HTTP requests and responses in plain text.

Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
JRNTexas
13
Years of Service
User Offline
Joined: 24th May 2011
Location: Austin, Texas
Posted: 16th Apr 2015 11:06
@BatVink

Thanks!

Login to post a reply

Server time is: 2024-11-25 20:47:24
Your offset time is: 2024-11-25 20:47:24