Hi,
I am struggling to understand why my network.request works fine in simulator, but once I package APK file and install it doesnt work.
I cut down the code to show demo, and it does not work on my samsung galaxy s
display.newText(“first line of code”, 0, 50, native.systemFontBold, 15)
local function networkListener( event )
display.newText(“network listener fired”, 0, 100, native.systemFontBold, 15)
if ( event.isError ) then
print( “Network error!”)
display.newText( “network error”, 2, 125, native.systemFont,25 )
else
display.newText(“worked”, 2, 125, native.systemFont,25 )
end
end
network.request( “http://x.x.x.x/location.aspx ”, “GET”, networkListener )
My build.settings allows android.permission.INTERNET, it will show the first line of text “first line of code” but nothing else.
Please can anyone help me? [import]uid: 22405 topic_id: 5786 reply_id: 305786[/import]
I’m running into a similar problem when I attempt to pass parameters in a network request:
local params = {}
params["name"] = reader\_SID
params["domain"] = ".google.com"
params["path"] = "/"
params["expires"] = "1600000000"
network.request( "http://www.google.com/reader/api/0/subscription/list", "GET", readerShowFeeds, params)
Works perfect in the Corona Simulator, throws a 401 error in the iOS Simulator.
Can anyone shed some light on this?
Thanks
EDIT: @joshuaand Also, have you tried testing it in the iOS Simulator at all? Just wondering if your issue is Android specific… [import]uid: 27896 topic_id: 5786 reply_id: 20020[/import]
vkrist
February 9, 2011, 12:05pm
3
For what it is worth, network.request is not working for me either.
I have build 2011.288 (Jan 28 2011) for Windows and I get nothing out of network.request even in the simulator. I have Windows XP Pro Version 2002 SP3.
I do have the correct build.settings file per specification at http://developer.anscamobile.com/content/network
I tried joshuaand’s code with a valid url and all I see is “first line of code” when I run it in the simulator.
Even the supposedly “working” example code at documented at http://developer.anscamobile.com/reference/asynchronous-http does nothing for me.
[import]uid: 30243 topic_id: 5786 reply_id: 21794[/import]