yes but I’ve never done it. I have my own code that lets me view it as it’s happening on the device. sorry not yet ready to release to the public
Sid - Correct. In fact, “Rob The Man” wrote a great article some time back here: http://coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/
Skip to the bottom and look at the ‘Android’ section which will take you to a second page for installing the right tools.
Once you get it going, you’ll find that ‘adb logcat’ is your best friend for debugging on android devices.
Cheers,
Ed
Thanks Ed
Hey Sid, you’ve got a great story. I’m thrilled to see you jumping into this. As for your specific problem:
The simulator can’t mimic hardware, nor can it mimic device specific behaviors, like case sensitivity or things that need SDK’s that only work on the device, like Facebook. This is why it’s imperative that you learn how to read your device’s console log as there are too many things that Corona can’t actually mimic.
Now for your questions:
What is the Main.lua supposed to contain?
This is a rather loaded question because it’s possible for some apps that it contains the entire program. But I would recommend doing the following in main.lua:
- Setup any hardware and system handlers like:
- system events (suspend, resume, etc,)
- keyEvent handling (catching the back key on Android)
- Initializing any features like ads, Facebook etc. Their callback listener functions would be in main.lua as well as their calls to .init() or .login().
- load any sounds that will be used throughout the app.
- call storyboard.gotoScene() to your splash or menu scene.
I tend to not do too much more there, though I have to admit my first game was entirely in main.lua. That code is awful and a pain to maintain. I should have learned about Storyboard much earlier.
Is “Storyboard” a good format to follow? (works pretty well in CORONA SIMULATOR"
Going forward, we recommend using the composer library instead of storyboard. It sounds like for this app, you’re probably to vested in storyboard to change it out. The composer library is really storyboard 2.0 and is very similar, but its different enough it’s not just a drop-in replacement. Storyboard is a pretty good tool for games that have multiple screens.
What is the best “config.lua” to use for cross platform compatibility?
Well since I wrote the Ultimate config.lua (see: http://coronalabs.com/blog/2012/12/04/the-ultimate-config-lua-file/ and http://coronalabs.com/blog/2013/09/10/modernizing-the-config-lua/)) I’m rather fond of it. It makes Letterbox apps fit screens picture perfect, but it has its drawbacks too. We recently learned that on Android if you try to support both Portrait and Landscape and swapping orientations, the content area’s shape changes, but the config.lua doesn’t re-evaluate. You have to make some positioning adjustments to make it work. The Ultimate config.lua also requires you to think a bit differently about how to position things.
The other config.lua that I would consider using is a fixed content area like 320x480 but just make sure your backgrounds are 360x570 and realize that the top left corner is not 0,0 and the bottom right is not 320x480. You have to use display.screenOriginX and display.screenOriginY to reach the top left corner and display.actualPixelWidth, display.actualPixelHeight to reach the bottom right corner.
What is “StoryBoard.lua” supposed to contain?
You shouldn’t have a storyboard.lua file. This will create issues with the built in storyboard module. Of course on device’s its case sensitive and storyboard.lua and StoryBoard.lua are different files on device, same files on the simulator. That said, we have open sourced our storyboard module as we are planning on removing it from the core. If that’s why you have a storyboard.lua, it should have the content that we put in it that you downloaded from our github.com repository.
Is there a StoryBoard Android app that I can open in Corona Simulator and my text editor to see how things work?
There is a Storyboard sample app in the CoronaSDK/SampleCode/Interface folder.
If I compiled a Corona Sample app for my SIII, would it work? (just thought of that). I’ll try it
Yes, you should do this.
Rob
$16*
/developer/month
(Billed Annually)
for upgrade
What exactly does this mean?
$16.00 per month for a year, with an annual contract?
or are they going to fool me with the $192.00 charge up front?
My Starter status won’t allow me to do any more test compiles. (I think I’ve messed it up)
Also opening the DeBugger first, freezes the Corona Simulator
Is there a way to get a “clean start” with Corona Starter?
Oh, by the way, I have used the “BounceAnimation” routine from the fishies.lua. I have nested it in a listener/timer to get a much desired delay.
With the listener in place, I can’t find a way to unload the “BounceAnimation”. But without the nested listener, in other instances, no problem unloading.
All your help is really appreciated. But I’m not “out of the woods” yet!
Thanks
1. $16 per month means that when you upgrade to Basic, you will be charged $192 for the year. After a year you will be billed the next $192.
-
I don’t understand what you mean by it wont allow you to do more test compiles?
-
What do you mean by opening the Debugger first?
-
You can always uninstall and re-install Corona SDK.
Rob
Rob,
Wow, your response time is amazing, and greatly appreciated I didn’t even expect a response today.
(Corona Simulator / file / Build for Android ) which I assumed was a “test compiler” doesn’t function anymore. It wants a password, and won’t accept it when I give it.
I tried un-installing and re-installing Corona (no change)
Your instructions below: “open corona terminal first” I couldn’t find terminal so settled for " debugger" (my bad)
I always get “Corona Simulator output” up when I start the simulator. Are “terminal” and “simulator output” different things.
Viewing Error Messages
There are various ways to see error reports while developing with Corona. One is to use the Terminal (Mac) or console window (Windows) to view diagnostic output and the value of print() statements from within your code. While this practice is considered “old fashioned” to some, it can be quite effective.
On Windows, the console loads automatically alongside the Simulator, but on Mac OS X, you need to “link” the Terminal to the Simulator. If you’re running the Corona Simulator by itself, please close and quit the Simulator for a moment — we need to reload it so the Terminal works in unison. Now, instead of opening Corona Simulator from the application folder, open Corona Terminal. The Terminal will load, then it will automatically open the “Corona Simulator Welcome Window” where you can choose the Simulator option. On Windows, the equivalent of the Terminal is the console window , which will load automatically when you start the Simulator.
Still “lost in the woods” I am.
Sid
Rob,
I think my first mistake was trying to “micromanage” the original Corona install. (I wanted to do things “My Way”) oops
Are you on a Mac or Windows?
Can you post the text of the message where it’s asking you for a password?
Rob
I am using windows 8.1
Here is a link to a screen shot on my Google Drive
https://drive.google.com/file/d/0B4MNtmTaseboc2VQaEppR1Q2QnM/edit?usp=sharing
I pasted it into my browser and it worked
Sid
You need to make the permissions on it public. I can’t see it.
Rob
Hopefully this gets what you want to see?
https://drive.google.com/file/d/0B4MNtmTaseboUzM0WVRjeGpGWWM/edit?usp=sharing
Does using “public setting” give up my proprietary rights?
Rob,
I un-installed Corona and deleted all references to Corona from the registry, then re-installed Corona and my Password problem went away. ( I didn’t meddle with the install)
My apk compiled without a problem, but it still doesn’t work. At least I am back to where I was a couple of days ago. :)
I have also completely revamped my project to work with your ultimate config.lua.
Sid
Glad you got that issue solved.
Rob
Tell me more about Mac in a Cloud, was the transition difficult?
I have Zero experience with a Mac.
I am having difficulty transitioning from Corona Simulator to Android Build.
The following code positions the image correctly in Corona Simulator, but in Android Build on my Samsung Galaxy S3, the image is positioned in the upper left corner.
I have tried the Android build after “commenting out” all of the code beyond the .x .y positioning and it doesn’t change the upper left positioning on the Samsung.
local TF30 = display.newImage( “TF30.png” )
TF30.x = 725
TF30.y = 675
HELP!
I’m going to take a blind stab and bet that your image isn’t named TF30.png. Perhaps its tf30.png or TF30.PNG or some other name with a different case. It’s going to be ahrd to know exactly without looking for errors in you device console.log. If you don’t know how to read the android device’s console log, please read this tutorial:
http://coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/
We probably should also see your config.lua as well.
Rob
Sid, do you use Skype? Your story has inspired me and i would be happy to help walk you through the steps needed in order to figure out and resolve your issue.
If so, add me on Skype: Gremlin_Interactive
Why not make the simulator case sensitive also…? Lol. I had the same problem … My file names didn’t match.