The code below works great in IOS but just returns network Error when testing on an Android device. I have the latest build - CoronaSDK 2013.1171 -.
My build settings contain:
“android.permission.INTERNET”,
“android.permission.WRITE_EXTERNAL_STORAGE”,
“android.permission.ACCESS_FINE_LOCATION”,
“android.permission.ACCESS_COURSE_LOCATION”,
Any ideas?
Thanks
local function networkListenerLamp( event )
if ( event.isError ) then
print( “Network error!”)
native.showAlert( “Network Error!”, “Status: Try Again.”, { “OK” } )
else
print ( "RESPONSE: " … event.response )
end
end
local function LampHttp()
colortype ="#000000"
headers = {}
headers[“Content-Type”] = “application/json”
headers[“Accept-Language”] = “en-US”
body = ‘{“program”: "’ … programtype … ‘",“color”: "’ … colortype … ‘"}’
–*******************************
local params = {}
params.headers = headers
params.body = body
– **Note _G.Account and URL are not real but the format is exactly like the one not working
network.request( “https://agent.electric.com/”…_G.Accountt , “POST”, networkListenerLamp, params)
end