Android quirks

I just tried my first build for Android and found that a few things work differently. If anyone has recommendations about how to fix these issues, I’d be happy to hear about it.

First, the Mailto: button I have, which works fine on the iPhone, puts the escaped text into the To box of the Android email client:

[lua]local emailButtonPress = function ( event )
system.openURL(“mailto:?subject=I%20scored%20” … points … “%20playing%20TK&body=Think%20you%20can%20do%20better%3F%0Ahttp%3A%2F%2Fwww.TK.com%2F%0D”)
return true
end[/lua]

ends up as an email address that looks like

<?subject =I%20scored%20" .. points .. "%20playing%20Blocfall&body=Think%20you%20can%20do%20better%3F%0Ahttp%3A%2F%2Fwww.blocfall.com%2F%0D>,   

Second, the keyboard that open to type this email doesn’t have an obvious button to dismiss it. You can get rid of it by the back button on the Nexus One but it would be good to have a way to dismiss the keyboard as an touch event.

Third, Android saves the game state through some mechanism of it own and relaunching the app resumes the game from the exact same spot. This would be fine but for the fact that I have already coded a save game mechanism so that the user has a choice to resume play from the home screen. Is there an additional step that needs to be taken in applicationExit events, like os.exit(), to make sure the app has really quit and that a relaunch resumes using the methods coded through Corona rather than through however it is that Android caches the app state?

Thanks.

[import]uid: 1560 topic_id: 3456 reply_id: 303456[/import]

I don’t think that Android caches the app but rather think that it still runs. I have to test this. [import]uid: 5712 topic_id: 3456 reply_id: 10372[/import]

I should add that the Ansca-provided Facebook code doesn’t work as expected in Android either.

The session = facebook.newConnection( fb_api_key, fb_secret ) call concatenates the FB URL with the directory path in Android that gets sent, so that you get this browser error:

Web page not available

The Web page at /data/data/<android_app_id>/app_datahttp://www.facebook.com/login.php?next=fbconnect…[etc]
might be temporarily down…

The same FB code works fine presently in an iPhone build I’ve tried. [import]uid: 1560 topic_id: 3456 reply_id: 10392[/import] </android_app_id>

Android apps can suspend. There’s no built in way to save state, so that’s most likely what is going on.

You can dismiss the soft KB by setting focus to nil.

The escaped text is clearly a bug. I logged that.

The FB web problem should be fixed in Game Edition builds. See this thread:
http://developer.anscamobile.com/forum/2010/10/12/do-webpopups-just-not-work-android
[import]uid: 54 topic_id: 3456 reply_id: 10974[/import]

There’s still a problem with the Facebook demo code on Android: No native keyboard pops up when the UID or password field is made the focus.

I’ve been using this code in my iPhone app and it works fine. But not on Android.

There’s no way to actually login to Facebook using the demo code for Android. [import]uid: 1560 topic_id: 3456 reply_id: 11047[/import]

The problem with email and escaped text is fixed for next build. [import]uid: 54 topic_id: 3456 reply_id: 11277[/import]

Great, thanks. Soon I hope :slight_smile: [import]uid: 1560 topic_id: 3456 reply_id: 11285[/import]