I can’t the same application in my android as I see in the simulator ? please help

Hi All,

 

I am new to Corona and I am trying to build simple apps but unfortunately
 don’t get the same result in the real
android Galaxy S2 as I see in the simulator.  The code works fine in the simulator but when I
build it for android as .apk and install it in my Galaxy S2 I got the picture,
text but not the physics component.

 


 

Here is one example, I am trying to simulate one of physics
demo lab in the SDK.

 

[lua]

local physics = require “physics”

physics.start()

local bkg =display.newImage(“bkg_clouds.png”)

local grass=display.newImage(“ground.png”)

local intro =display.newText("This is a test app only  :slight_smile: ",50 ,200,“Halvetica”,22)

intro:setTextColor(50)

local intro =display.newText(" Author:Abdulaziz Al Zaabi ",50 ,250,“Halvetica”,18)

intro:setTextColor(20)

grass.y= 500

physics.addBody( grass, “static”, { friction=0.5, bounce=0.3 } )

local logo=display.newImage(“crate.png”)

logo.x,logo.y=200, 50

logo.rotation = 50

local OnTouch = function (event)

       if event.phase == “began” then

              physics.addBody(logo, { density=3.0, friction=0.5, bounce=1 } )          

          

              return true

         

       end

  

end

 

Runtime:addEventListener (“touch”, OnTouch)

 

[/lua]

 


 

Also I have attached the picture from the simulator and
picture from Galaxy s2. I don’t know what is wrong here. I trying few other
demos and I got the same problem. Please help !!

 

Please read this blog post:

http://www.coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/

We need to see the console log from the device to see what error you’re getting there.   This blog will help you get to your device’s console.log

Thanks

Rob

Hi Rob,

thanks for the advice, i am in the process of downding android sdk tools and undersdand how to read the console.log file as see it is long process :slight_smile:

Meanwhile i noticed one thing :

when repalce the crate.png picture only inside the demo physic code, I did not see the picture I load in the device but I see it working file in the simulator. I dont undersdand why this is happening even i did not change lines … Only 1 replace the following :

lcal crate= display.newImage( “crate.png” )

crate.x = 180; crate.y = -50; crate.rotation = 5

physics.addBody( crate, { density=3.0, friction=0.5, bounce=0.3 } )

with the following :

local oxy = display.newImage( “oxy.png” )

oxy.x = 180; oxy.y = -50; oxy.rotation = 5

physics.addBody( oxy, { density=3.0, friction=0.5, bounce=0.3 } )

nothing else. ? it works in simulaor and i see i dont see the oxy.png in the real device !!! strange… i hope you can help

regards

Abdulaziz

I would be willing to bet that oxy.png isn’t really named oxy.png.  Maybe Oxy.png, or oxy.PNG.  File names are case sensitive on device.

:)  :slight_smile: :)  :)  :)  :)  :)  :)  :)  

You are right the man !!!

Thank you soooo much… I renamed as Oxy.PNG and it works in the device … I am so
glad to get it working… I appreciate your help

Regards

Abdulaziz

 

Please read this blog post:

http://www.coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/

We need to see the console log from the device to see what error you’re getting there.   This blog will help you get to your device’s console.log

Thanks

Rob

Hi Rob,

thanks for the advice, i am in the process of downding android sdk tools and undersdand how to read the console.log file as see it is long process :slight_smile:

Meanwhile i noticed one thing :

when repalce the crate.png picture only inside the demo physic code, I did not see the picture I load in the device but I see it working file in the simulator. I dont undersdand why this is happening even i did not change lines … Only 1 replace the following :

lcal crate= display.newImage( “crate.png” )

crate.x = 180; crate.y = -50; crate.rotation = 5

physics.addBody( crate, { density=3.0, friction=0.5, bounce=0.3 } )

with the following :

local oxy = display.newImage( “oxy.png” )

oxy.x = 180; oxy.y = -50; oxy.rotation = 5

physics.addBody( oxy, { density=3.0, friction=0.5, bounce=0.3 } )

nothing else. ? it works in simulaor and i see i dont see the oxy.png in the real device !!! strange… i hope you can help

regards

Abdulaziz

I would be willing to bet that oxy.png isn’t really named oxy.png.  Maybe Oxy.png, or oxy.PNG.  File names are case sensitive on device.

:)  :slight_smile: :)  :)  :)  :)  :)  :)  :)  

You are right the man !!!

Thank you soooo much… I renamed as Oxy.PNG and it works in the device … I am so
glad to get it working… I appreciate your help

Regards

Abdulaziz