Code working on Simulator but doesn't work on android smartphone

I have a Lua code and it works fine on my simulator on Mac, but when i install the apk on Android (Android 4.1) the system.preference code and the os.time() function doesn’t work, anyone knows what is happen? Then random result is always the same on android smartphone, but in simulator it always change, and the language is always en in my smartphone, but it is with language pt.

Bellow follows my calls of this functions and my config.lua, anyone can help me? Thanks!

Call 1:

function passaroVoar( event ) -- random x e ymath.randomseed( ( os.time() + progresso) \* 2 ); local x = math.random(1,screenW); if ( x \< 45 ) then x = 45; elseif (x \> screenW - 45) then x = screenW - 45; end math.randomseed( os.time() \* 3 ); local y = math.random(1,screenH); if ( y \< 45 ) then y = 45; elseif (y \> screenH - 45) then y = screenH - 45; end if ( x \> screenW - 305 and y \< 30) then passaroVoar ( event ) else birdSprite.x = x; birdSprite.y = y; end end

Call of system.getPreference:

if (system.getPreference("ui", "language") == "pt") then textoTempo = textoTempo; else textoTempo = "Time:"; end

and my config.lua

local aspectRatio = display.pixelHeight / display.pixelWidth application = { content = { width = aspectRatio \> 1.5 and 320 or math.ceil( 480 / aspectRatio ), height = aspectRatio \< 1.5 and 480 or math.ceil( 320 \* aspectRatio ), scale = "letterBox", fps = 30, imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, }

Thanks!

95 times out of 100, when someone says “It works in the sim but not on the device” its a file name case sensitivity problem.  Devices are case sensitive and the sim is not (Actually the Windows and OS-X file handling routines are not).  You should check every file name you’re accessing, images, module’s you are requiring, audio, storyboard/composer scene names, etc.

There should be an error or warning in your console log as to why you are having a problem.  Without looking at that all you and we can do is guess at the problem.  If you don’t know how to read your console log, please read:

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

Rob

95 times out of 100, when someone says “It works in the sim but not on the device” its a file name case sensitivity problem.  Devices are case sensitive and the sim is not (Actually the Windows and OS-X file handling routines are not).  You should check every file name you’re accessing, images, module’s you are requiring, audio, storyboard/composer scene names, etc.

There should be an error or warning in your console log as to why you are having a problem.  Without looking at that all you and we can do is guess at the problem.  If you don’t know how to read your console log, please read:

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

Rob