[tool] LoveToAndroid - .love to .apk without thinking

Showcase your libraries, tools and other projects that help your fellow love users.
knuxyl
Citizen
Posts: 52
Joined: Sat Aug 13, 2016 4:40 am

Re: [tool] LoveToAndroid - .love to .apk without thinking

Post by knuxyl »

I was getting java exceptions like crazy and qubodup's solution worked for me.
OS = linux
ARCH = x64
I downloaded jdk-8u102-OSARCHH.tar.gz and StartGamedev-160804-OS.zip
Extracted jdk-8u102-linux-ARCH.tar.gz and StartGamedev-160804-OS.zip
Deleted everything in StartGamedev-160804-OS/tools/jdk-OSARCH
Copied everything in jdk-8u102-OSARCHH/ to StartGamedev-160804-OS/tools/jdk-OSARCH
Running ./make-apk now works without any errors. Thank you
User avatar
scissors61
Citizen
Posts: 76
Joined: Fri Jan 08, 2016 10:16 am

Re: [tool] LoveToAndroid - .love to .apk without thinking

Post by scissors61 »

Hey @qubodup I've got a new doubt. As I said before, your tool works great, but even it's not the fault of your LoveToAndroid but is of love-android-sdl2, the games are stuck in landscape mode. Is there any possibility of setting the game to portrait mode from your tool?
User avatar
qubodup
Inner party member
Posts: 775
Joined: Sat Jun 21, 2008 9:21 pm
Location: Berlin, Germany
Contact:

Re: [tool] LoveToAndroid - .love to .apk without thinking

Post by qubodup »

scissors61 wrote:Is there any possibility of setting the game to portrait mode from your tool?
Sure! It's an Android thing.

In tools/love-android-sdl2/original/AndroidManifest.xml replace "Landscape" with "Portrait".
Last edited by qubodup on Thu Aug 18, 2016 6:55 pm, edited 2 times in total.
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
User avatar
scissors61
Citizen
Posts: 76
Joined: Fri Jan 08, 2016 10:16 am

Re: [tool] LoveToAndroid - .love to .apk without thinking

Post by scissors61 »

I've just tried, but after using ./make-apk.sh the resulting apk is in landscape and AndroidManifest goes back too to landscape.
User avatar
qubodup
Inner party member
Posts: 775
Joined: Sat Jun 21, 2008 9:21 pm
Location: Berlin, Germany
Contact:

Re: [tool] LoveToAndroid - .love to .apk without thinking

Post by qubodup »

I'm sorry, I forgot that the scripts overwrite that file. The file you have to change is
tools/love-android-sdl2/original/AndroidManifest.xml
(I updated the above post)
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
User avatar
scissors61
Citizen
Posts: 76
Joined: Fri Jan 08, 2016 10:16 am

Re: [tool] LoveToAndroid - .love to .apk without thinking

Post by scissors61 »

That's it. It's perfect now. Thanks!
laperen
Prole
Posts: 27
Joined: Tue Jul 26, 2016 1:15 am

Re: [tool] LoveToAndroid - .love to .apk without thinking

Post by laperen »

is there any way to allow the game to run in the background of the device? or have i missed some functionality to allow this?
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: [tool] LoveToAndroid - .love to .apk without thinking

Post by raidho36 »

It's strongly discouraged to make your game run in background, for any reason, ever. You basically should never do this. It only drains the battery while the user doesn't even interact with it. Games made in GameMaker offer no such option altogether, the manual explicitly states that the game will just hibernate and may be shut down immediately afterwards too. I think Unity does something similar, so does LÖVE Android app it appears. And even then, many phones nowdays have power management options that flat out prevent apps from running in background sans select few exceptions. Surely enough if your game requires user interaction, having it run in background and screw everything up while the user doesn't have a chance to do anything about it is just cruel and shouldn't be done like this, just pause the game instead. If it doesn't requires interaction and just requires waiting, then there's no reason why it should run at all, you can simply save the timestamp immediately before hibernation and then grab a new timestamp immediately after wake up, this way you'll know how much time elapsed and you can do all the calculations offline post-factum.

So that's the long answer. Short answer: no, and please don't.
User avatar
qubodup
Inner party member
Posts: 775
Joined: Sat Jun 21, 2008 9:21 pm
Location: Berlin, Germany
Contact:

Re: [tool] LoveToAndroid - .love to .apk without thinking

Post by qubodup »

laperen wrote:is there any way to allow the game to run in the background of the device? or have i missed some functionality to allow this?
Unfortunately I can't help with that. This might require writing Java or perhaps this thread is enough:
You should use love.focus for that. The current version currently has some issues about android and background though, they'll be fixed in 0.10.1.
raidho36 wrote:just pause the game instead
That's probably what they meant. If I remember correctly, if you go to the home screen now and then return to the game, it will restart. [EDIT: thanks for clarifying in post below]
Last edited by qubodup on Sun Sep 04, 2016 5:47 pm, edited 1 time in total.
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: [tool] LoveToAndroid - .love to .apk without thinking

Post by raidho36 »

No it doesn't restart, it resumes execution from cache as if it never halted. If you however return to home screen and launch the app from the icon, it will restart.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 52 guests