showing lua error after build application for android

Hi Guys

I have created application and i am getting response from web services, its working on Simulator and when i build it and run on tablet or bluestaks its showing error .What is reason for that?. [import]uid: 209400 topic_id: 34852 reply_id: 334852[/import]

The number 1 reason for “It works in the simulator but not on the device” is case sensitivity of a filename that you’re trying to access. The simulator doesn’t care about case, devices do:

pic = display.newImage(“myfile.jpg”)

will successfully load MyFile.jpg, myFile.jpg, myfile.JPG or any other combination. On device it will error out.

You need to install the “Android Debug Bridge” tools (use Google to find a guide on installing it) and then you can use the command line tool:

adb logcat   

to view the console log of the device to see what errors are being generated.
[import]uid: 199310 topic_id: 34852 reply_id: 138529[/import]

Hi Rob

Thanks for your response.Its working fine if i am putting static data.If i am getting dynamic data from web services its not working. [import]uid: 209400 topic_id: 34852 reply_id: 138558[/import]

What error are you getting? [import]uid: 199310 topic_id: 34852 reply_id: 138596[/import]

Hi Rob

I am not getting any error .Its working fine on simulator.After build showing blank screen. I am running
my apps on BlueStacks.This is my code.

ocal function networkListener( event )
if ( event.isError ) then
print( “Network error!”)
else
print ( "RESPONSE: " … event.response )
local data = (event.response)
local t = display.newText(data, 0, 0, native.systemFontBold, 50)
t:setTextColor(255, 255, 255)
t.x = math.floor(t.width/2) + 12
t.y = 46
end
end
local headers = {}
headers[“Content-Type”] = “text/xml”
vartest = [[<?xml version="1.0" encoding="utf-8"?>






]]
–print(vartest)

local params = {}
params.body = vartest
params.headers = headers
network.request( “http://localhost:4983/Service1.asmx?op=HelloWorld”, “POST”, networkListener, params)

//------------------------------this is service method--------
[WebMethod]
public string HelloWorld()
{
Context.Response.Write(“Hello Mk”);
return “Hello World”;
} [import]uid: 209400 topic_id: 34852 reply_id: 139025[/import]

The number 1 reason for “It works in the simulator but not on the device” is case sensitivity of a filename that you’re trying to access. The simulator doesn’t care about case, devices do:

pic = display.newImage(“myfile.jpg”)

will successfully load MyFile.jpg, myFile.jpg, myfile.JPG or any other combination. On device it will error out.

You need to install the “Android Debug Bridge” tools (use Google to find a guide on installing it) and then you can use the command line tool:

adb logcat   

to view the console log of the device to see what errors are being generated.
[import]uid: 199310 topic_id: 34852 reply_id: 138529[/import]

Hi Rob

Thanks for your response.Its working fine if i am putting static data.If i am getting dynamic data from web services its not working. [import]uid: 209400 topic_id: 34852 reply_id: 138558[/import]

What is this printing out:

print ( "RESPONSE: " … event.response )

???
[import]uid: 199310 topic_id: 34852 reply_id: 139110[/import]

Nothing .Showing blank. [import]uid: 209400 topic_id: 34852 reply_id: 139113[/import]

I missed the part about you running this on Bluestacks. I had to go look up what that was. I’ll ask the team, but I’m pretty sure the answer will be that it’s not supported there.

Unless you have a way to get to the console log (not the screen where you’re drawing things like your display.newText()) to see what error messages and you’re prints are, there isn’t a whole lot of help we can give you.

[import]uid: 199310 topic_id: 34852 reply_id: 139114[/import]

What error are you getting? [import]uid: 199310 topic_id: 34852 reply_id: 138596[/import]

One other thing. What happens when you try to hit the URL:

http://localhost:4983/Service1.asmx?op=HelloWorld

with a web browser? [import]uid: 199310 topic_id: 34852 reply_id: 139116[/import]

Hi Rob

I am not getting any error .Its working fine on simulator.After build showing blank screen. I am running
my apps on BlueStacks.This is my code.

ocal function networkListener( event )
if ( event.isError ) then
print( “Network error!”)
else
print ( "RESPONSE: " … event.response )
local data = (event.response)
local t = display.newText(data, 0, 0, native.systemFontBold, 50)
t:setTextColor(255, 255, 255)
t.x = math.floor(t.width/2) + 12
t.y = 46
end
end
local headers = {}
headers[“Content-Type”] = “text/xml”
vartest = [[<?xml version="1.0" encoding="utf-8"?>






]]
–print(vartest)

local params = {}
params.body = vartest
params.headers = headers
network.request( “http://localhost:4983/Service1.asmx?op=HelloWorld”, “POST”, networkListener, params)

//------------------------------this is service method--------
[WebMethod]
public string HelloWorld()
{
Context.Response.Write(“Hello Mk”);
return “Hello World”;
} [import]uid: 209400 topic_id: 34852 reply_id: 139025[/import]

What is this printing out:

print ( "RESPONSE: " … event.response )

???
[import]uid: 199310 topic_id: 34852 reply_id: 139110[/import]

Nothing .Showing blank. [import]uid: 209400 topic_id: 34852 reply_id: 139113[/import]

I missed the part about you running this on Bluestacks. I had to go look up what that was. I’ll ask the team, but I’m pretty sure the answer will be that it’s not supported there.

Unless you have a way to get to the console log (not the screen where you’re drawing things like your display.newText()) to see what error messages and you’re prints are, there isn’t a whole lot of help we can give you.

[import]uid: 199310 topic_id: 34852 reply_id: 139114[/import]

One other thing. What happens when you try to hit the URL:

http://localhost:4983/Service1.asmx?op=HelloWorld

with a web browser? [import]uid: 199310 topic_id: 34852 reply_id: 139116[/import]