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

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
qubodup
Inner party member
Posts: 775
Joined: Sat Jun 21, 2008 9:21 pm
Location: Berlin, Germany
Contact:

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

Post by qubodup »

Update Aug 2nd, 2016: To put your game on Android, follow the instructions in the following video:


https://youtu.be/TAZo-pin4nE

Backups (public, no need for FB account) at https://www.facebook.com/love2Dengine/p ... 9545637201

You'll need Linux, Mac OS X or Windows and "Start Gamedev" from https://qubodup.itch.io/startgamedev
You have a game.love file and want to play it on Android? Okay. Do this:

1. Download and extract loveToAndroid for Windows, OSX or Linux: from https://archive.org/download/lovetoandroid .
2. Override the game.love in project root.
3. Run the make-apk script.
4. Copy the game.apk file to your phone and install it.

5. (optional) edit the lines starting with a 'sed' command in the make-apk script to find out how to change the app name. App ID might be more complicated. This package is mainly used for workshops where you want to install multiple results next to each other.

Old version quoted below because why not.
1. Download and extract LoveToAndroid-v01.zip (107MB) from Mega, Mediafire or Box.net. If chrome blocks the download because it tries to protect naive uses, press Ctrl + J to open the download manager and check the links under the download, one of them allows you to get the file, against Chrome's better judgement. Alternative: http://superuser.com/questions/387724/
2. Open the folder. And your eyes. This is what you see:
lta-screen.png
lta-screen.png (21.48 KiB) Viewed 26657 times
3. Replace the game.love file with your game.love.
4. OPTIONAL replace icon.png with an 144x144 png image.
5. Start 2_love2apk.bat by clicking it and press a key when it asks you to, to close it.
6. Copy the game.apk file to your phone and install it.

Don't like text? Okay, watch this instead:

http://youtu.be/vfn1nTjPuOY

If you want more details, read the readme file and http://bitbucket.org/MartinFelis/love-android-sdl2/wiki or ask here.

This is for windows users who have trouble following the love-android-sdl2 instructions. And for workshops performed on 3rd party computers without admin rights (for example ESPWS).

Readme (v01):
LoveToAndroid is a collection of tools to make it easy to port your LÖVE game to Android.

Steps:
1. Create zip with your game, rename to "game.love" in this folder
2. Start 2_love2apk.bat - this will create "game.apk"
3. Copy "game.apk" to your Android device and open it in the file browser to install

That is it.

OPTIONAL Steps:
4. Replace icon.png (144x144px png) and run 2_love2apk.bat again.
5. Edit tools\love-android-sdl2\AndroidManifest.xml to change name and other details
6. For your apk to have an own ID, not only edit AndroidManifest.xml but also adjust the folder/file names and file content of
tools\love-android-sdl2\src\love\
tools\love-android-sdl2\src\love\to\
tools\love-android-sdl2\src\love\to\android
tools\love-android-sdl2\src\love\to\android\LtaActivity.java
7. Oh yeah, you might want to create a backup of
tools\love-android-sdl2\
so you can use it for other projects

For more, for now, check love-android-sdl2 wiki for more info or ask in the love2d.org LoveToAndroid forum thread.

Background info:
tools\ant is from https://ant.apache.org/bindownload.cgi ; removed documentation, maybe more
tools\jdk is from http://www.oracle.com/technetwork/java/ ... 80260.html JDK, NOT JRE, NOT JAVA PLATFORM , openjdk didn't work; removed as much as I could without breaking ant debug
tools\android is downloaded with Android SDK Manager https://developer.android.com/sdk/index.html SDK TOOLS ONLY, NOT ANDROID STUDIO; removed as much as possible without breaking ant debug
tools\love-android-sdl2 from https://bitbucket.org/MartinFelis/love-android-sdl2 , self-compiled early 2015

CREDITS
Collected by Iwan Gabovitch http://qubodup.net . Check subdirectories for licenses and credits
Last edited by qubodup on Thu Jan 05, 2017 6:44 am, edited 5 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
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

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

Post by Nixola »

Could you make it ask for the name and other things in the prompt, so that it changes them on the fly and then sets them back to default?
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
Crossing
Prole
Posts: 42
Joined: Sat Mar 21, 2015 3:37 pm

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

Post by Crossing »

Just a stupid question.

Does this bypass having to install sdk, jdk, ndk, ant apache and whatever else?

Havent had wifi in awhile i downloaded love using my phone and transfered it over to my pc. I really have no way of installing stuff.
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 »

Nixola wrote:Could you make it ask for the name and other things in the prompt, so that it changes them on the fly and then sets them back to default?
Yes, although I think allowing to set a new ID, so you can install you apps side by side would be even more interesting. For now you should copy the tools/love-android-sdl2/ folder for backup and edit the AndroidManifest.xml directly.
Crossing wrote:Does this bypass having to install sdk, jdk, ndk, ant apache and whatever else?
Yes, that's the point of this package. JDK, Android SDK and ant are included, NDK is not required, since love is pre-compiled. You have to download the 107MB zip though and unpacking it can take a long while depending on PC specs.
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
Crossing
Prole
Posts: 42
Joined: Sat Mar 21, 2015 3:37 pm

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

Post by Crossing »

Okay great. Ill try it out when i get home.
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

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

Post by davisdude »

Looks great! Can we have it on GitHub? Chrome won't let me download it :x
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
User avatar
TurtleP
Party member
Posts: 147
Joined: Thu Mar 22, 2012 9:20 pm
Contact:

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

Post by TurtleP »

Amazing job! Now if only this could be done with iOS and non-jailbroken devices.. :cool:

https://dl.dropboxusercontent.com/u/976 ... .50.17.png

Just to show the test. I only edited the AndroidManifest.xml file and changed the label strings.
User avatar
NickRock
Citizen
Posts: 76
Joined: Thu Dec 25, 2014 9:33 pm
Location: Earth
Contact:

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

Post by NickRock »

That's really cool! But can I put ads on my app as well?
Weeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeooow!!
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 »

Update: Version 6 is out. It runs on Linux, Mac OS X and Windows (not just Win any more) and it auto-generates time-based app id and name
Crossing wrote:Okay great. Ill try it out when i get home.
Success?
davisdude wrote:Looks great! Can we have it on GitHub? Chrome won't let me download it :x
This is a manually created binary bundle (blob?) so I think that would be disrespectful to GitHub and probably violate their ToS so no. There's ways to make Chrome keep untrusted files. Try Ctrl+J and look for link-style buttons below the download info.
TurtleP wrote:Amazing job!
Glad it was useful!
NickRock wrote:That's really cool! But can I put ads on my app as well?
Seems non-trivial: https://bitbucket.org/MartinFelis/love- ... structions
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
SrWoOoW
Prole
Posts: 2
Joined: Mon Sep 14, 2015 1:00 am

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

Post by SrWoOoW »

:awesome: :awesome: :awesome: :awesome: :awesome: its cool but with love 0.9.2 can not be used love.touchpressed :cry: :cry:
Post Reply

Who is online

Users browsing this forum: No registered users and 42 guests