Hi,
I have been using Corona for quite a while now and I have several apps in Apple's App store. When Apple announced the changes to the TOS for the SDK (section 3.3.1) Apple lost my "trust". It seems that Apple have the power to ruin all my efforts and work (and not to mention the money spent on buying Corona and joining the developer program) at a whim. For several weeks after this I gave up writing apps for the iPhone and turned to other things (specifically a cluster/cloud ESMTP server written in Go: http://code.google.com/p/goesmtp/).
But now that I have calmed down a bit and I see that, as of yet, Apple hasn't actually rejected any apps for no being "originally written" in Obj-C. I am taking a different stance. I have bought myself an Android powered phone (running Android 1.6) and I want to turn my attention to developing (and porting my existing apps) to Android with the idea that if Apple put the iPhone versions in their App store as well then all the better for me.
So I took my simplest app (which calculates the distance of a thunder storm by measuring the time between the lightning and the thunder) and built it for Android using Corona 2.0 beta 5.
Here is what I discovered:
1) I needed to added a config.lua file to handle the resolution of my phone. In fact my phone's resolution is the same as the iPhone 3G so by adding the config.lua file everything scaled as expected.
2) I added a build.settings file. Without it the app was in landscape mode with some crazy zoom factor. Setting the orientation to portrait in build.settings fixed that.
3) It works! Well kind of...
Here are the problems:
1) No sounds... I am using playEventSound and I can't get it to work on the Android device. I have tried .caf, .wav and .mp3 files and I get nothing... PLEASE: Could a developer from Ansca please comment on this.
2) If I press the home key and then return to my application I only get a blank screen. This is discussed here: http://developer.anscamobile.com/forum/2010/06/19/app-has-stopped-unexpectedly-android but there doesn't seem to be a solution. PLEASE: Could a developer from Ansca please comment on this.
I have more complicated apps using webpopups, the accelerometer, background music and so on and at the moment I won't even try to port those.
Any comments, insights or news from an Ansca developer on these issues would be great.
Thanks,
Gary
For event sounds on Android, try OGG. For more info please see this thread:
http://developer.anscamobile.com/forum/2010/07/16/event-sounds-dont-work-android
We are continuing to work on the resume issues in Android.
Accelerometer is implemented. We're working on text and video at the moment.
@Eric:
What did you ment by "we are working on text atm"?
Hi,
OK, I am now trying beta 6...
I still can't get the sound events to work... I am now using a .ogg file (created using Audacity)... But still nothing... media.playSound works fine (including with MP3) but media.stopSound doesn't. I will keep trying...
As for the resume problem, I guess I can see what the issue is now... If something is happening on screen then resume works better, but if the app is on a menu and is waiting for an event the screen remains black.
So I tried just adding a simple text animation to my menu, this does help things as now the app comes back and works, but sometimes the screen is corrupt on return, especially after the phone has been in sleep mode.
I have done my initial port of my game which uses the accelerometer and indeed the accelerometer code seems to work and the game is playable... Obviously the above problems remain...
Gary
Hi,
I just want to revive this thread... I have now tried my application with Beta 7 and the same problems remain... A) The application can't recover from being suspended and then restored (the screen is either blank or corrupt), B) Sound events don't work. playEventSound() doesn't work (I have tried with .mp3, .wav and .ogg files), media.playSound() works fine (including with MP3) but media.stopSound() doesn't.
The same code works fine on the iPhone.
I AM STARTING TO GET FRUSTRATED... You keep releasing Betas but nothing is changing... THESE ARE FUNDAMENTAL PROBLEMS... If you fixed them I could release 4 apps for Android TODAY.
PLEASE, PLEASE, PLEASE TELL ME WHAT IS THE PLAN TO SOLVE THESE PROBLEMS.
Gary
PS. Sorry for shouting, but this is very frustrating.
The resume issue is FB#269 and is assigned priority 2 (pri 1 is for crashes, this isn't exactly a crash). Depending on your app, you may be able to workaround for now by drawing something on resume. It is hard to predict exactly when it'll be fixed, we've improved the behavior but not solved it yet. We work on it for the next beta, and discuss it with you if we can't find a solution yet.
On sound issues, see the other thread you posted this in:
http://developer.anscamobile.com/forum/2010/07/30/corona-20-sdk-beta-7-now-available
Thanks.
Eric,
Thanks for your replies... I really do appreciate it... Makes me feel like I am not alone!!!!
I have got the sound working (and I replied in the thread http://developer.anscamobile.com/forum/2010/07/30/corona-20-sdk-beta-7-now-available
The secret is to pre-load ALL the sound events and then call them when needed:
1 2 | local soundID1 = media.newEventSound( "sfx1.ogg" ) local soundID2 = media.newEventSound( "sfx2.ogg" ) |
And then when needed call:
1 2 | media.playEventSound(soundID1) media.playEventSound(soundID2) |
Now for the resume...
I have tried several techniques... First I tried a simple timer which changed some text every second... In general this approach meant that something came back when the application was resumed but generally the screen was corrupt with white blocks and the text was in the wrong place etc.
I also tried:
1 2 3 4 5 6 7 8 9 10 11 | local function onSystemEvent( event ) if (event.type== "applicationSuspend") then button1.isVisible = false button2.isVisible = false elseif (event.type== "applicationResume") then button1.isVisible = true button2.isVisible = true end end Runtime:addEventListener ("system", onSystemEvent); |
But that doesn't achieve anything, the screen remains blank / black on resume.
I don't mind workarounds... But I need some more clues on what to try...
Is applicationResume supported on Android????
Thanks,
Gary
We're working on fixing resume on android and hope to get this in the next beta.
Hi,
First a BIG thanks for the Corona developers for making such big improvements in Beta 8...
The resume problem "#269 Android: crash on resume (and various redraw issues on resume)" is almost fixed but not quite... If there is no screen activity the display remains blank but this can be solved by a simple 0.5 second timer function which makes any small and imperceivable change to the screen then it works!
I had a problem where the resume worked (as described above) but if the actual phone went to sleep then the application would resume at all (just black screen again). However after a reboot of my phone this problem seems to have disappeared.
So my App is almost ready for Android... But... I have now having trouble with the following:
1) I can't get the icons to work... My app appears with the standard Android icon (the green droid popping out of the right corner icon). Interestingly enough I haven't tried to do the icon until now as the icon.png copied over form the iPhone version was working (for reasons unknown) but now isn't, so I created the 3 Icon-?dpi.png files and looking at the build log they are found:
1 | [copy] Copying /blah/blah/Icon-hdpi.png to /var/folders/F2/F262wv5-Gi8UC88qnWzNbk+++TI/-Tmp-/1282986053/replace/res/drawable-hdpi/icon.png |
Any clues to what I could be doing wrong???
2) I can't seem to get any decent text rendering... I have tried using lots of different fonts but the fonts don't seem to change... Here is the code I am using:
1 2 3 4 | sysFont = native.newFont("DroidSerif-Regular") local t0 = display.newText( "Hello World", 0, 0, sysFont, 18 ) t0:setTextColor( 255, 255, 255, 255 ) |
native.getFontNames() is working and I can get a list of font names OK, but the default font is very ugly and almost unreadable...
Comments anyone?
3) Great news that WebPopup is now working on Android... But when I try to close the webpage with corona:close the web browser gives an error about "the protocol is not supported" and then there is a web page not available error. I get the same error if I build the weboverlay sample
Thanks,
Gary
PS. I am doing builds for Android 1.6
1) Looks like for some reason the multires icons aren't working for an Android 1.6 build. They are for 2.2. Please file a bug: https://developer.anscamobile.com/project/issues/
2) Looks fine to me, on N1, compiled for 1.6.
3) This is in the release notes. We just plain ran out of time. It'll be in the next drop.
I spoke too soon on the font issue. It works fine in 2.2, but not if compiled for 1.6. Please file a bug.
Garysims, regarding your comment:
The resume problem "#269 Android: crash on resume (and various redraw issues on resume)" is almost fixed but not quite... If there is no screen activity the display remains blank but this can be solved by a simple 0.5 second timer function which makes any small and imperceivable change to the screen then it works!
Do you have a reproducible test case? You can mail it to support at anscamobile dot com.
Eric,
Just build the HelloWord example, then press the home key, put your phone to sleep, resume and return to HelloWord... 1 time in 3 it won't work.
Thanks,
Gary
Gary,
Does Corona handle the different resolutions of phone's?
When i start the fishies example in de simulator for the different android phones the fishies will not hit the edge of the screen.
Did you already make an application for Andriod?
Danny
Danny,
I have several apps that are 90% working on Android, but as of yet Beta 8 isn't good enough for them to be released... I am using Android 1.6 and it seems that support for Android 2.2 is better... but I don't have an Android 2.2 phone nor do I have $500 to buy one!!!
To handle the different resolutions you need to use the config.lua file...
But I have run the fishies example and it works fine...
Gary
Gary,
I know about the config.lua file but if i use "zoomEven" the fishies will not hit the edge of the screen.
Also the font looks very blurry on the simulator.
I don't have an Andriod phone so i was wondering.
Danny
@garysims, I just tried 10x in a row (on N1) and didn't repro. This is with our current internal version.
Hi,
First a big well done to you guys... Corona 2.0 is looking good... So I have actually managed to release my first ANDROID app in the Android Market... I posted it late last night and I have a huge 68 downloads so far!!! :-)
So what's good about 2.0:
1) The fonts are working for Android 1.6
2) The icons are back for Android 1.6
Shame about "Android 1.6 on resume, animation sometimes is paused. Occasionally if there is no animation, a blank screen may occur. (1022)" but, I am living with it and I have gone ahead and released the app anyway...
So what is the app, well, my first iPhone App was called Thunder Clap: A simple to use utility to calculate the distance to a storm based on the time elapsed between the lightning and the thunder.
It seemed natural to start with the same app for Android and so I did and now it has been published.
You can get it from here: http://market.android.com/search?q=pname:uk.co.garysims.android.thunderclap
I think... See below
But (and sorry that there is always a but), I can't get the app using my Android 1.6 phone... Using the URL above doesn't work and the error page I get is exactly the same for apps that are marked for 2.0 etc. I actually managed to find the app by doing lots of scrolling in the Market place and when I clicked it to download it I got the same error.
Obviously people are downloading this as the stats tell me so...
So two things:
1) Could anyone here on the forum with a 1.6 and 2.x phones please try and download this and tell me your results.
2) Is it possible that somehow the package is marked for 2.x... How do I check?
Thanks,
Gary
PS. I just realized that I spelled 'experience' wrong in the original title post!!!!
PPS. Very much waiting for Game Edition to come out.
I've experienced most of these same issues. Missing icons, can't sign the device, sounds were messed up, resolution was off -
I fixed everything but the signing part. We are still working through that..
My key just won't sign a Corona app, but I've got many others app built using eclipse that the key works just fine for.
Richard
@MBD
I would be grateful if you could try and download my app from this URL http://market.android.com/search?q=pname:uk.co.garysims.android.thunderclap
Please tell if the download works and what version of Android you are using (as on my 1.6 device I can't download my app from the Market).
Much appreciated!
Gary
PS. With regards to signing, I just used the keytool as described in the documentation and it worked first time with no problem. Sorry I can't add any more light...
Downloaded and installed just fine Gary.
Nexus one, Froyo 2.2
Can't find your app on the market.
G1 with 1.6 on it.
@MBD, @MikeHart
Many thanks to both of you... So this has confirmed by suspicion... The app was built for 1.6 using Corona 2.0 and does indeed work on 1.6 (if you download and install the pkg from http://android.garysims.co.uk ). But in the market place it is only showing up for 2.x (I guess, MBD used 2.2).
Any comments anyone? Any ideas?
Is it possible that somehow the package is marked for 2.x... How do I check?
Thanks,
Gary
Unfortunately I have one - you might need to stop using the Corona SDK until they get it right for Android. My one and only app I built using Corona (lua) works fine on iphone, and device testing android, but I've got all sorts of issues getting the app into the Google marketplace as well. I can make, test, and sign my same app using the regular Google SDK in a matter of hours but it took me two days using Corona and it's still not published.
Corona team:
I'm a fan! Really! I like what you are doing here!
But the cross development platform plays much nicer with an iphone than it does an Android. I think you guys either need to focus more on the Android side and beef it up as solid as the iphone side, or have a way where we can use the Corona SDK outside of the Corona emulator. That way we can build, test, and release using a dedicated GUI such as eclipse.
I simply can't waste a bunch of time pouring over a document you published and following protocol, only to have the app give me fits in the end.
Our goal when purchasing the license was to have a dual platform solution that had a unified language, but so far I have to give Corona a 2 out of 5 stars.
Richard
Richard, you're the only person reporting this problem, and we have not seen it in our internal testing. We also suggested a workaround which is to re-sign manually, while this is not ideal it will allow you to publish.
Android documentation is no picnic to decipher, and there are a huge number of bugs and workarounds we've fixed over the last few weeks that are due to problems in the OS. Couple that with the large number of devices to test on, and to add to the fun, there are also differences and bugs in specific devices. I'm not trying to make an excuse here; I'm just pointing out that what we're doing is not easy.
Rest assured we're working to resolve your issue.
@garysims, we add the following to AndroidManifest.xml:
Where version is set according to the SDK specified at build time. So if you picked 1.6, we set the version to 4. The second line specifies OpenGL ES 1.1, which should be available in all 1.6 and higher devices.
Android market filters are documented here:
http://developer.android.com/guide/appendix/market-filters.html
An app built for 2.0 or 2.2 will not install on a 1.6 phone. So if you are able to install it, then it was built for 1.6, and the problem is in the market filters.
We'll continue to look into this.
It appears you're not the only one having problems with market filtering:
http://www.google.mw/support/forum/p/Android+Market/thread?tid=2156a1d8ddb8ba47&hl=en&start=120
Hi Eric,
did you read in your posted link what Jerry Brady posted on 07/21/10 about the permission settings? Could that be the case why 1.6 SDK Corona apps don't show up with 1.6 devices anymore?
Michael
I was able to finally get an app signed with my private key - only after I created a new one with a less secure password. My original key that worked fine in Eclipse and the android SDK used a "strong" password with special characters, uppercase and lowercase characters and a few numbers. After talking more with Eric I realized that more than likely the Corona SDK didn't like the strong password.
This could come back and bite you guys so until Corona fixes it, make sure you are using a keystore password that has little to no special characters in it.
Now I'm fighting the icon issue and hopefully will have a Corona app in the marketplace by sundown!
Richard
@MBD, what is the "icon issue"?
@TheGiant, regarding your earlier comment "if i use "zoomEven" the fishies will not hit the edge of the screen", this is probably because of the way dynamic content scaling works. This scaling mode maps a content rectangle (such as 320x480) into the display, maintaining aspect ratio, which means if the display is a different aspect ratio there are some pixels in it that aren't mapped from the content area. What happens then depends on the code -- and fishies moves the fish within the original content area.
@ MikeHart, I'm trying to find what "Jerry Brady posted on 07/21/10 about the permission settings". Can you find it by any chance?
If only your selfmade forum software here had a quoting functionality. This is what here wrote:
In the end, we had the existing "android:required=false" parameter set in our manifest, but what caused our market issues was the failure to include "android:required=false" to every other permission we had in our manifest that wasn't available before API level 5.
For us those were: android.permission.AUTHENTICATE_ACCOUNTS and android.permission.MANAGE_ACCOUNTS.
So, my recommendation for anyone having trouble is to carefully audit the hardware features you need and your manifest permissions and ensure you are explicit about how you define them.
Hi everyone!
I'm actually developing a little app for Android-Devices. Like you showed above, I'm preloading all sounds and I'm using
ogg's.
I've tried several times and I'm always getting the same error in the terminal after this line of code:
local test = media.newEventSound( "test.ogg" )
I'm getting this error : WARNING: Mac error(-1500) while creating event sound for file(/Users/.../Desktop/.../test.ogg)
WARNING: Failed to create event sound(test.ogg)
The ogg sound file is exactly in the folder of my app and has the name "test.ogg". The sound file is not damaged or something, i played it in iTunes and VLC.
What should I do? Is there a problem with the ogg's and my mac?
Thanks for your help.
@Ultima94, sorry for the slow response. OGG is an Android-only format. It is not supported on iOS or Mac at this point. We are looking into ways to support this and other cross-platform formats. See the AudioPlayer sample code for an example of how to support different platforms.
I am trying to find out if the resume issue has been addressed. You mentioned The resume issue is FB#269
How do I find out if this has been resolved in the latest build?
Wow this is a really old thread. According to FB, 269 was resolved over a year ago.
I've noticed the same issues. I have an Android game ready to go and my only issue right now is the event sounds.
As for event sounds not working, that's a major problem right now. I really hope they can fix that soon.
For the home key one, I THINK that's been fixed for the most part. Try rebuilding. The only issue I get with that now is textfields.