love-android-sdl2 (native, 0.9.2)

A project to port LÖVE to Android handhelds
Locked
Sind
Prole
Posts: 10
Joined: Mon Mar 31, 2014 4:40 pm

Re: love-android-sdl2 (native, 0.9.0)

Post by Sind »

Apparently it's caused by delays causing the number of touches to change while in the loop.

so, something like this would cause the error easily, if you are tapping several places repeatedly:

Code: Select all

function love.update(dt)
	for i = 1,love.touch.getTouchCount() do
		id, x, y, pressure = love.touch.getTouch(i)
		sleep(.1) -- wait a tenth of a second
	end
end

local clock = os.clock
function sleep(n) 
  local t0 = clock()
  while clock() - t0 <= n do end
end
Of course, the code I used didn't take even close to that much time, but apparently it was enough to cause this to happen sometimes.
User avatar
fysx
Citizen
Posts: 97
Joined: Mon Jan 30, 2012 8:36 pm
Contact:

Re: love-android-sdl2 (native, 0.9.0)

Post by fysx »

Thanks for the script! I can now reproduce the problem. Also I have created an issue here: https://bitbucket.org/MartinFelis/love- ... ouch-index. Feel free to watch it to get first-hand updates on it.
Bird thing: @fysxdotorg Blog thing: fysx.org
User avatar
Foxcraft
Prole
Posts: 49
Joined: Sat Mar 22, 2014 8:56 pm

Re: love-android-sdl2 (native, 0.9.0)

Post by Foxcraft »

Thank you for the port. I've just started working with it.

This helped me set up the SDK and things on my Ubuntu-based distro: http://askubuntu.com/questions/375128/a ... 13-10?rq=1
clofresh wrote:Yay, I'm so glad this is moving forward! I've tested it with my puzzle fighter clone on the ouya and it works great! Had to explicitly define the ouya controller though since the gamepad api wasn't pick it up.
That is very good to hear. I am very interested in making a game on OUYA. Could you point me in the right direction for explicitly defining controllers?

Also, I was wondering if after sideloading on the OUYA, if it shows up under Make>Software? Sideloaded apps are supposed to show up there, but my test with love-android-sdl2 did not. Currently, to test, I must install/reinstall the apk and choose the Open option in the dialog that appears afterward. Can't run it any other way. I was wondering if that was happening to others? I'm using the 0.9.1 RC1 version though.
bobbyjones
Party member
Posts: 730
Joined: Sat Apr 26, 2014 7:46 pm

Re: love-android-sdl2 (native, 0.9.0)

Post by bobbyjones »

It shows up under play. I think the manifest file has something in it so it could show in the launcher.
User avatar
Tanner
Party member
Posts: 166
Joined: Tue Apr 10, 2012 1:51 am

Re: love-android-sdl2 (native, 0.9.0)

Post by Tanner »

Foxcraft wrote:That is very good to hear. I am very interested in making a game on OUYA. Could you point me in the right direction for explicitly defining controllers?
josefnpat has a great resource in the dong2 lib: https://github.com/josefnpat/dong2/blob ... ndroid.lua

The buttons on the OUYA aren't 1 to 1 with the Xbox controller so it will require a little imagination but here's an example of me using love.joystick.setGamepadMapping to work with the OUYA controller: https://github.com/TannerRogalsky/Frien ... me.lua#L10
User avatar
Foxcraft
Prole
Posts: 49
Joined: Sat Mar 22, 2014 8:56 pm

Re: love-android-sdl2 (native, 0.9.0)

Post by Foxcraft »

Thank you very much! I finally found it under Play (last in my long list) and it works fine from there. And those links are really helpful.

I just thought to ask about saving. Where does love-android-sdl2 setup the save directory on Android devices? Also, is that left alone when the apk is uninstalled?
User avatar
fysx
Citizen
Posts: 97
Joined: Mon Jan 30, 2012 8:36 pm
Contact:

Re: love-android-sdl2 (native, 0.9.0)

Post by fysx »

Foxcraft wrote:I just thought to ask about saving. Where does love-android-sdl2 setup the save directory on Android devices? Also, is that left alone when the apk is uninstalled?
At the moment everything is saved in the internal storage which also gets cleared once the app is removed. There should be nothing left on the device if it was uninstalled. I do plan to add an option that lets you save to the external storage however haven't gotten to it yet (see https://bitbucket.org/MartinFelis/love- ... ether-save).
Bird thing: @fysxdotorg Blog thing: fysx.org
piernov
Prole
Posts: 1
Joined: Sat May 03, 2014 6:58 pm

Re: love-android-sdl2 (native, 0.9.0)

Post by piernov »

Hey, if someone is interested, I made an attempt to bind Android NSD to love-android-sdl2.
But since I'm not a good programmer (never done anything in Java, poor experience in C) it must be very dirty.
Some might still be interested : https://bitbucket.org/piernov/love-andr ... ndroid-nsd

Sadly we are affected by Android's issue 55913 : https://code.google.com/p/android/issue ... l?id=55913 . It's workarounded using str:gsub(gsub("\\032", " ")) for spaces.

Here is an example, look at what's inside `if love.system.getOS() == "Android"` : http://git.piernov.org/Mastermind/tree/ ... 4b2e75f2e0

PS: Would love a Bonjour binding if someone has this…
User avatar
Foxcraft
Prole
Posts: 49
Joined: Sat Mar 22, 2014 8:56 pm

Re: love-android-sdl2 (native, 0.9.0)

Post by Foxcraft »

fysx wrote:
Foxcraft wrote:I just thought to ask about saving. Where does love-android-sdl2 setup the save directory on Android devices? Also, is that left alone when the apk is uninstalled?
At the moment everything is saved in the internal storage which also gets cleared once the app is removed. There should be nothing left on the device if it was uninstalled. I do plan to add an option that lets you save to the external storage however haven't gotten to it yet (see https://bitbucket.org/MartinFelis/love- ... ether-save).
Thank you for your answer. I suppose that the external storage is what I am wanting then. I look forward to when the option is implemented.

piernov wrote:Hey, if someone is interested, I made an attempt to bind Android NSD to love-android-sdl2.
But since I'm not a good programmer (never done anything in Java, poor experience in C) it must be very dirty.
That is very cool, piernov. I also find it motivating for some attempts at the code I've been thinking of making. Thanks!
User avatar
fysx
Citizen
Posts: 97
Joined: Mon Jan 30, 2012 8:36 pm
Contact:

Re: love-android-sdl2 (native, 0.9.0)

Post by fysx »

piernov wrote:Hey, if someone is interested, I made an attempt to bind Android NSD to love-android-sdl2...
Hi piernov. I have no idea what NSD actually is but from a quick glance it seems to be something really awesome. Can you mabe create a new post where you give a bit more details what it is and what one can do with it? I fear this is too cool to get lost in a long thread such as this.
Bird thing: @fysxdotorg Blog thing: fysx.org
Locked

Who is online

Users browsing this forum: No registered users and 0 guests