Hey Android Devs, I've Got A Few Questions! :)

Hey guys (and girls?),

I love Corona. The more I use it the more I enjoy it. I’ll be taking a little break over Christmas however come January 3rd I hope to be back at it full time.

At that point I am hoping to start building games for Android as well as iOS, as I believe I can finally get my hands on an Android device and get access to another.

My questions are as follows;

  1. A device running Android 1.5 and one running 2.2 - is this suitable for testing? Will a compile for 2.2 be able to be tested on 1.5 as well? I’m totally blind to this and am desperately hoping to learn more :slight_smile:

  2. What differences are there between iOS and Android? I mean, if I planned to recreate a game I’d made for the iPhone for Android, what type of changes will that require?

  3. Tell me about Google; how often do they pay, how do they pay, what are the thresholds, what price tiers are available, how long does approval take, etc?

Any information would be greatly appreciated, I am still very new to Corona in general and any advice or information would be very much appreciated; in particular it would also be very useful to know where I might find a sample or information regarding the build.settings and config.lua files - or the equivalent for Android. (I have no idea what files are included.)

Thanks in advance for anyone taking the time to respond to any of the above :slight_smile:

Peach [import]uid: 10144 topic_id: 4600 reply_id: 304600[/import]

Hey Peach,

  1. Corona currently targets Android v.1.6, v2.01, and v2.2. Apps targeting 1.6 will work on all three, whereas 2.2 will only work on 2.2 (and above - 2.3 is about to drop). Basically they are not backwards compatible.

However, the performance of Android 1.6 (and previous) is abysmal. You will be able to make a regular app work ok, but a game will be awful.

  1. The performance of Android devices is generally not as good as iOS devices, especially iPhone4, iPad, and the new iTouches. So you will have to plan your game accordingly, and make sure your code is as optimized as possible. The other thing to think about is the many varied screen sizes for Android devices. The standard size is 480x800, whereas most iOS devices use a 320x480 aspect ratio. There are several ways that Corona tries to account for this, like dynamic image scaling, letterboxing, etc., but nothing is 100% perfect. You’ll definitely have to play around with it.

  2. Google seems to pay every few days. A few dollars here, a few dollars there. Google uses Google Checkout, which in my opinion is more geared towards the selling of physical objects. You will receive your customer’s names, countries, and other info, which is a little odd. Another issue is that Google, unlike Apple, does not take care of the sales taxes for you. I’m not sure how that translates to Australia/USA, but it is a bit of a drag.

One of the more interesting things when dealing with the android marketplace, is the ability to instantly publish your app. It goes live within seconds. So it is very easy to make bug fixes, etc. Very different from Apple’s approval process. Of course there is also no censorship, bug, or virus checking for your app.

Also, as convoluted as Apple’s App Store can be, it is miles ahead of the Android marketplace. It is really difficult to find anything. Likewise, your sales from android devices will generally be a fraction of those from iTunes. [import]uid: 8444 topic_id: 4600 reply_id: 14509[/import]

I’ve been reading similar thoughts on sales on Android and the conclusion reached by most devs is that the only way to tackle the platform is with free apps with ads. Android users being a lot more tech savvy usually, simply are not willing to pay for apps.

Hopefully Corona will have a robust ad solution soon, so targeting Android might be worthwhile. [import]uid: 10835 topic_id: 4600 reply_id: 14511[/import]

Thanks guys.

Another question - is a device running 1.5 (Cupcake) useless for testing purposes, then?

I have access to a 2.2 device but the one I’m looking at buying is on 1.5, so I’d like to know.

Damn confusion.

Thanks for all the detailed info though, it’s good; even if I made a $1 a day, that’s a $1 I didn’t have before ^-^; [import]uid: 10144 topic_id: 4600 reply_id: 14545[/import]

Oh and will 2.1 work on 2.2? [import]uid: 10144 topic_id: 4600 reply_id: 14546[/import]

Yeah, a device running 1.5 won’t do you any good for testing.
The minimum version you can target with Corona is 1.6

If you only have a choice between those two, go with the 2.2 [import]uid: 8444 topic_id: 4600 reply_id: 14558[/import]

Thanks FMG - great help :slight_smile:

I will likely buy one running 1.6 - I have found one with a larger screen than the one on 2.2 I’ve got/will have access to.

So that all sounds good.

As to building one when the time comes, besides things that only work on iOS - are there any changes?

For example, for my game Happy Doodle Sushi Smile - would I simply remove OF and FB integration?

Lastly, the build.settings and config.lua - where can one find examples of these for Android?

If you don’t know/don’t have time to explain it’s fine, I’m just hoping to get a good feel for things :slight_smile: Really appreciate all your help. [import]uid: 10144 topic_id: 4600 reply_id: 14561[/import]

Here is my build.settings file:

settings =  
{  
 android =  
 {  
 versionCode = "1"  
 },  
 orientation =  
 {  
 default = "landscapeRight",  
 supported =  
 {  
 "landscapeLeft", "landscapeRight"  
 }  
 },  
 iphone =  
 {  
 plist =  
 {  
 UIApplicationExitsOnSuspend = true,  
 UIPrerenderedIcon = false,  
 UIStatusBarHidden=true  
 }  
 }  
}  

The important bit is that “versionCode”. That is an integer that needs to be incremented for each version you submit. So even though the name of your game in the marketplace is “Happy Doodle Sushi Smile 1.5”, that versionCode will need to be something like 6

OpenFeint does not work. Facebook should? [import]uid: 8444 topic_id: 4600 reply_id: 14562[/import]

I was under the impression FB didn’t but I didn’t read any official things, just got it in my head somehow ^-^;

So, versionCode just needs to be greater for greater versions, basically? Or is there some logic/formula to it?

And what of config.lua, does that remain the same?

Thanks again for all the info - by the way, Google pays via Paypal now, right? I couldn’t recall what I read about bank accounts outside the US. XD

I’m looking forward to this :slight_smile: [import]uid: 10144 topic_id: 4600 reply_id: 14565[/import]

yep, versionCode simply gets incremented by 1 each time you make an update.

config.lua is the same for me. I am using letterboxing however. The config file is where you set the screen size for your app. Android devices have all sorts of different screen sizes though. You might have to play around with it. I just left mine at 320x480 and it has black bars on the sides.

Google pays me directly into my bank account. I’m not sure how it deals with foreign countries. Hopefully it does not pay you with PayPal as there would be a fee. [import]uid: 8444 topic_id: 4600 reply_id: 14566[/import]

Thanks again; I shall also be using letterbox when the time comes.

The one thing I’m a tad concerned about is how things will look on the larger screens - what I’ll have to test with is one of the smaller ones, 320 x 240 (or something like that) and the standard we’re all used to from the iPhone, 320 x 480.

When you create a game or app for that resolution, what DPI are you using?

Also, a bit of a big ask, but when I eventually complete my first app for Android, if you have a larger screened device (do you?) do you think there’d be any chance of testing it for me just to see that it looks fine on the device?

Lastly before I go to bed, I don’t need a lot of details as you’ve already been very helpful - but 3 things;

  1. Certificates; do we use them? Are they similar enough to Apple if so?

  2. Getting the app on the device, is this done via usb or does one load it onto the microSD card, or what? (I assume all this can be done on a Mac? Please let me know as if not I’ll be reinstalling Windows, heh.)

  3. Price tiers; do they exist, or is it anything goes?

Cheers again - and Paypal fees I’m happy to eat if need be, I used to make all my income online and I’ve become accustom to the blasted things to a certain extent. ^-^;

Good night! Thanks again oPeach [import]uid: 10144 topic_id: 4600 reply_id: 14574[/import]

@dpi: under all circumstances, use the default 72 dpi for everything. For both .pngs and jpegs. dpi is really only a term used for the printing industry.

All of the devices have larger/smaller pixels densities. What you only need to be concerned with is the number of pixels. The older iPhone devices use 320x480 pixels, the iPhone4 uses 640x960 pixels, and the iPad uses 1024x768 pixels.

You should simply make your graphics accordingly. One thing to consider is that the pixels are smaller on an iPhone than on your monitor, so a button that is 20x20 on your monitor is going to be too small on the device.

Android screen sizes are all over the map. Nexus One is 800x480, Droid X is 854x480, etc. etc.

Currently I design my graphics for 480x320 and use the pixel doubling technology of the phones to do all of the up-sizing.

  1. You do not use Certificates. You’ll use another thing call Key Signing. When you are ready, I can walk you through it. It’s just as unfriendly as the iPhone signing stuff is.

  2. The quickest way to get an “adhoc” build onto your android device that I’ve found is to upload your file online, and then use the web browser on the device to download it onto the phone.

  3. Like most of the android stuff, I’m pretty sure that it is anything goes.

I actually don’t have an Android phone, but my brother does. I borrowed it to test my game. It is running v2.2, so that is the version that I initially targeted for.

Carlos actually emailed me and asked if I could make him a 2.0.1 version. I built it for him and he told me that it ran great. So I built a new version for the marketplace targeting 2.0.1.

Ideally you want your game to work on as many devices as possible, but I think that you will find that it will run horribly on 1.6 devices. Especially games that use the physics system or transitions - you know, movement!

Hopefully I will get an Android device sooner or later. I will test how your game works on a larger screen and you can test mine on the smaller screen!

Joe [import]uid: 8444 topic_id: 4600 reply_id: 14588[/import]

Thanks Joe, that all sounds good :slight_smile:

If I need your help with the Key Signing stuff I will certainly ask and naturally I would be more than happy to test your games/apps on a smaller screen once I’ve got my device :slight_smile:

Pixel doubling I’m not familiar with, yet, but I’ll learn ^-^;

If you had a link to any resource regarding that it’d be useful but if not, I’m sure I’ll work it out :wink:

Thanks again!

Peach o

I just started building for Android myself, so I thought I’d add a few additional (rudimentary) thoughts:

I had a problem with my app because it uses network sockets, and that is something you have to permission the Android app for in the build.settings file. For a description of build.settings, see the following post:

http://developer.anscamobile.com/content/configuring-projects#Build_Configuration:_build.settings

And for a full list of Android permissions:

http://developer.android.com/reference/android/Manifest.permission.html

The Android device I purchased is a Viewsonic G Tablet (WIFI only - $399 or less). I chose it because it has a fast processor (Tegra 2 - dual core) along with good large screen. I like it very much as an Android device, but if you decide to get one, make sure you look at http://forum.xda-developers.com and search for instructions on flashing the device to a UI called TNT-Lite (or one of the other ones mentioned on the forums: Vegan, etc.) The UI that the device ships with is slow and just generally terrible.

Finally, for my development debugging, I just attach my device via USB, choose to activate USB transfer on the Android device (makes it show up as a drive on my Mac), then move the .apk file to the device and open it using the Android file manager “ASTRO”. This prompts me to install the app.

Also, .mp3 sounds do not appear to work on Android, so I downloaded a free OSX app called “Switch” that allows me to convert the .mp3 to .ogg. From what I have read on this forum, only .ogg is supported in Android. Be warned that you cannot have both the .mp3 and .ogg file (with the same name) in your build directory, otherwise you will get an error when you attempt to build.

Hope this helps!

Cheers,
Michael
[import]uid: 13121 topic_id: 4600 reply_id: 15321[/import]

Just a short addendum to my previous post regarding sound in Android:

Even with an .ogg file, I did not hear the sound when I used audio.loadStream() and audio.play(). I did, however, hear the sound when I used media.playSound() instead. [import]uid: 13121 topic_id: 4600 reply_id: 15323[/import]

Here are some functions I wrote to do sound on either iPhone or Android. Perhaps they can be useful to someone else as well. Essentially, it lets you either load a “short” sound (sound effects, etc.) and play those using the value returned from the function OR it lets you play a “background” sound (i.e. background music with an optional boolean argument for looping):
require “audio”

local isAndroid = “Android” == system.getInfo(“platformName”)
local isSimulator = “simulator” == system.getInfo(“environment”)

local DEBUG = true
local TIME_FORMAT = “%I:%M:%S %p”

function loadSound(filename)
local sound
if isAndroid then
sound = media.newEventSound(filename)
else
sound = audio.loadSound(filename)
end
return sound
end

function playSound(sound)
if isAndroid then
media.playEventSound(sound)
else
audio.play(sound)
end
end

function playBackgroundSound(filename, loop)
if isAndroid then
media.playSound(filename)
else
backgroundSound = audio.loadStream(filename)
if loop == true then
backgroundSoundChannel = audio.play(backgroundSound, {loops = -1})
else
backgroundSoundChannel = audio.play(backgroundSound)
end
end
end

function stopBackgroundSound(filename)
if isAndroid then
media.stopSound()
else
audio.stop(backgroundSoundChannel)
audio.dispose(backgroundSound)
backgroundSound = nil
end
end
[import]uid: 13121 topic_id: 4600 reply_id: 15363[/import]

mhatmaker, some really useful stuff there - thanks for sharing :smiley:

I still don’t fully “get” all of the Android stuff, but I’m learning.

The audio stuff is very interesting, will have a play around with it tonight :slight_smile:

Peach [import]uid: 10144 topic_id: 4600 reply_id: 15404[/import]