Page 1 of 2

How to test for Android?

Posted: Tue Aug 28, 2012 6:07 pm
by Titousensei
Hi, I just finished a small game, and I wanted to test it on Android with love-native-android. I didn't try much so far, but I'm getting a blank (white) screen at start-up. I'm suspecting the filesystem access to cause problems, and I will try to comment it out next.

I have a few questions about how to proceed.

1. Is it currently possible to test in code for things that are not supported before making the call? For instance, can I add:

Code: Select all

if love.filesystem then
  -- do filesystem things
end
2. I like to use print to log in the console my game's activity. Is there such a thing on Android? Can I access the console log and do a post-mortem analysis to debug?

3. How do you guys trace what the problems are when trying a game on Android. Do you use the emulator or an actual device?

4. Is there a restriction on the Android versions supported? I have a 2.3 and a 1.6.

Thanks for love-native-android!

Re: How to test for Android?

Posted: Wed Aug 29, 2012 8:55 am
by T-Bone
Calling love.filesystem does not crash love-native-android, it just doesn't do anything.

If you are experiencing crashes/black screens, are you perhaps using Framebuffers? Because they crash everything.

Also, does the no-game screen work?

Re: How to test for Android?

Posted: Wed Aug 29, 2012 6:04 pm
by Titousensei
I am not using framebuffers. The no-game screen works fine and shows the animated love planet with the little ghosts.

Also, I'm not getting a black screen but a white screen (of the dimensions specified in the conf.lua), I'm not sure if that helps.

Any idea how to debug that?

Re: How to test for Android?

Posted: Wed Aug 29, 2012 9:41 pm
by Moe
Titousensei wrote:1. Is it currently possible to test in code for things that are not supported before making the call? For instance, can I add:

Code: Select all

if love.filesystem then
  -- do filesystem things
end
No, there is no test. I wonder if a test that locates yet unsupported function would be more effort than just implementing the actual functionality...
2. I like to use print to log in the console my game's activity. Is there such a thing on Android? Can I access the console log and do a post-mortem analysis to debug?
I think that we implemented the one of love, so any print should go to logcat.
3. How do you guys trace what the problems are when trying a game on Android. Do you use the emulator or an actual device?
We started our development on real devices. The emulator may work but we do not support it.
4. Is there a restriction on the Android versions supported? I have a 2.3 and a 1.6.
The core code in Java is only about 100-200 lines. We do not use anything special. I think any Android version that can use libraries from NDK should be fine. The lowest version we tested is 2.1. There are to many Android configurations to be tested by a just-for-fun project.
At the moment, we have one restriction: ARM only. This is not technical but laziness: Currently, we did not see a point in creating x86 or MIPS libs, we have not seen any devices using it.

Re: How to test for Android?

Posted: Fri Aug 31, 2012 3:07 am
by Titousensei
I found that my device has one of those graphic cards that need power of 2 padding. After I fixed that, the game worked, although it seems to use a lot of memory for this tablet. Thanks for the help!

Re: How to test for Android?

Posted: Fri Aug 31, 2012 7:42 am
by T-Bone
The po2 issue is standard on Android. I think it's mentioned in Google's documentation if Android if I remember correctly.

Re: How to test for Android?

Posted: Fri Aug 31, 2012 10:51 pm
by Moe
Which hardware do you have? I want to know all limitations and if we should consider to solve this non power of two (NPOT) texture problem.
There are many chips that need some special texture settings for NPOT textures...

Re: How to test for Android?

Posted: Sat Sep 01, 2012 12:46 am
by Titousensei
I have an Archos 101 (first model, not the G9). I don't know if it's popular or not.

I'm testing my with my own game, you can download it at http://rti-zone.org/eyes-in-the-night.php

Most of the love package's size is due to the music, and it's using so much memory the game is a little laggy, so I will build a smaller version with only one ogg file to see if this helps.

(Oh, and love.graphics.setLineWidth() doesn't seem to work)

Re: How to test for Android?

Posted: Sat Sep 01, 2012 5:41 am
by T-Bone
Or, you can solve the npot problem for all hardware by just upgrading to LÖVE 0.8 :)

Re: How to test for Android?

Posted: Sat Sep 22, 2012 11:17 am
by austinart2862
Have tried in my emulator in PC, but it says graphics not compatible..