love-android-sdl2 (native, 0.9.2)

A project to port LÖVE to Android handhelds
Locked
Muris
Party member
Posts: 131
Joined: Fri May 23, 2014 9:18 am

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

Post by Muris »

I was playing around with this, and managed to compile the sources. I've been mostly using the precompiled version for app testing, but today I decided to try and see if what I for the game that I have now works on compiled version.

I was happy to notice that it does work, and I even managed to remove some of the activities from the game (I personally do not want to give a random application license to use internet, but rather just not use the app at all), but I noticed that vibrate thing is the only one that cannot be removed without actually making the game crash when pausing(switching app). So I was wondering if there is an easy way to completely remove the vibration support from the löve?

Also I was happy to notice that it is possible to save and load files without the need to give permission for external storage.
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 »

Muris wrote:So I was wondering if there is an easy way to completely remove the vibration support from the löve?
The easiest would be to adjust the function vibrate() in GameActivity.java to do nothing.
Bird thing: @fysxdotorg Blog thing: fysx.org
Muris
Party member
Posts: 131
Joined: Fri May 23, 2014 9:18 am

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

Post by Muris »

fysx wrote:
Muris wrote:So I was wondering if there is an easy way to completely remove the vibration support from the löve?
The easiest would be to adjust the function vibrate() in GameActivity.java to do nothing.
Oh, umm I mean it crashes on pause because of:

Code: Select all

			 vibrator.cancel();
I was lucky to catch the point of where vibration is set from one of the commit texts. Then I tried modifying the code as following, and it seems that I can then remove the permission without crashing the application:

Code: Select all

in begin of gameactivity.java
    private static Vibrator vibrator = null;


in oncreate:
      context = this.getApplicationContext();
      if( context.checkCallingOrSelfPermission("android.permission.VIBRATE") ==
          context.getPackageManager().PERMISSION_GRANTED )  {
        Log.d("GameActivity", "Permission for vibrator granted.");
        vibrator = (Vibrator) this.context.getSystemService(Context.VIBRATOR_SERVICE);
      }

and on destroy / pause
      if( vibrator != null ) {
			 Log.d("GameActivity", "Cancelling vibration");
			 vibrator.cancel();
      }


and then in vibrate function
      if( vibrator != null ) {
        vibrator.vibrate((long) (seconds * 1000.));
      }



With this it seems that the android application can be run without giving any permission at all. Maybe you cannot use all the features like internet etc. from love-application but from user point of perspective the application should be safer to use.
atos93
Prole
Posts: 1
Joined: Tue Jan 13, 2015 12:51 pm

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

Post by atos93 »

i have this error

Code: Select all

atos@atos-1011PX ~/love-android-sdl2 $ ant debug
Buildfile: /home/atos/love-android-sdl2/build.xml

-set-mode-check:

-set-debug-files:

-check-env:
 [checkenv] Android SDK Tools Revision 24.0.2
 [checkenv] Installed at /home/atos/Android/Sdk

-setup:
     [echo] Project Name: love_android_sdl2
  [gettype] Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup:
[getbuildtools] Using latest Build Tools: 21.1.2
     [echo] Resolving Build Target for love_android_sdl2...

BUILD FAILED
/home/atos/Android/Sdk/tools/ant/build.xml:542: Unable to resolve project target 'android-19'

Total time: 6 seconds
and

Code: Select all

atos@atos-1011PX ~/love-android-sdl2 $ ant debug
Buildfile: /home/atos/love-android-sdl2/build.xml

BUILD FAILED
/home/atos/love-android-sdl2/build.xml:56: sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable.

Total time: 2 seconds
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 »

atos93 wrote:i have this error

Code: Select all

atos@atos-1011PX ~/love-android-sdl2 $ ant debug
[...]
-build-setup:
[getbuildtools] Using latest Build Tools: 21.1.2
     [echo] Resolving Build Target for love_android_sdl2...

BUILD FAILED
/home/atos/Android/Sdk/tools/ant/build.xml:542: Unable to resolve project target 'android-19'
Either set android:targetSdkVersion in AndroidManifest.xml to 21 or install the Android SDK Build-tools Rev. 19.
atos93 wrote:i have this errorand

Code: Select all

atos@atos-1011PX ~/love-android-sdl2 $ ant debug
Buildfile: /home/atos/love-android-sdl2/build.xml

BUILD FAILED
/home/atos/love-android-sdl2/build.xml:56: sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable.

Total time: 2 seconds
Running the suggested 'android update project' fixes this.
Bird thing: @fysxdotorg Blog thing: fysx.org
User avatar
Ranguna259
Party member
Posts: 911
Joined: Tue Jun 18, 2013 10:58 pm
Location: I'm right next to you

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

Post by Ranguna259 »

How do I filter love's prints in logcat ?
I've tried

Code: Select all

adb logcat org.love2d.android:V *:S
But I get no outputs.

EDIT: DOS only

Code: Select all

adb logcat | find "LOVE"
LoveDebug- A library that will help you debug your game with an on-screen fully interactive lua console, you can even do code hotswapping :D

Check out my twitter.
User avatar
Mermersk
Party member
Posts: 108
Joined: Tue Dec 20, 2011 3:27 am

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

Post by Mermersk »

I'm having major problems actually creating a .apk that works. I had managed it 3 months ago, but now I have a new computer so I needed to set everything up again. I'm on Windows 8 64-bit.

I do successfully make a .apk(when I do ant debug/ant release) but when I try to run it on my phone the game crashes immediately.
I first thought it was because of this:

Code: Select all

arm-linux-androideabi-g++: error: CreateProcess: No such file or directory
make.exe: *** [obj/local/armeabi/objs/love/src/love.o] Error 1
And I thought that happens because I had a Icelandic letter in my user folder in windows, í. So I moved everything to another hard-drive but still it's all failing.

This is what comes from "ndk-build" in hard-drive with no Icelandic letters:

Code: Select all

E:\Android-release\love-android-repository\MartinFelis-love-android-sdl2-5048f3f
f8c20>ndk-build
E:/Android-release/NDK/android-ndk-r10d/build/core/add-toolchain.mk:35: E:/Andro
id-release/NDK/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/config.mk:
Invalid argument
E:/Android-release/NDK/android-ndk-r10d/build/core/add-toolchain.mk:35: E:/Andro
id-release/NDK/android-ndk-r10d/toolchains/x86_64-4.9/config.mk: Invalid argumen
t
Android NDK: WARNING: APP_PLATFORM android-19 is larger than android:minSdkVersi
on 10 in ./AndroidManifest.xml
[armeabi] Compile++ thumb: love <= love.cpp
arm-linux-androideabi-g++: error: CreateProcess: No such file or directory
make.exe: *** [obj/local/armeabi/objs/love/src/love.o] Error 1
So does anybody know whats wrong? I absolutely hate this step of game development. Making a working .apk this way is horribly frustrating.
User avatar
miko
Party member
Posts: 410
Joined: Fri Nov 26, 2010 2:25 pm
Location: PL

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

Post by miko »

Mermersk wrote:I'm having major problems actually creating a .apk that works. I had managed it 3 months ago, but now I have a new computer so I needed to set everything up again. I'm on Windows 8 64-bit.

I do successfully make a .apk(when I do ant debug/ant release) but when I try to run it on my phone the game crashes immediately.
I first thought it was because of this:

Code: Select all

arm-linux-androideabi-g++: error: CreateProcess: No such file or directory
make.exe: *** [obj/local/armeabi/objs/love/src/love.o] Error 1
That means that your apk build was not succesfull (compare the resulting *.apk sizes). For some reason compilation of love.o failed (check earlier error messages), and without this file love2d does not work.
My lovely code lives at GitHub: http://github.com/miko/Love2d-samples
User avatar
Mermersk
Party member
Posts: 108
Joined: Tue Dec 20, 2011 3:27 am

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

Post by Mermersk »

miko wrote:
Mermersk wrote:I'm having major problems actually creating a .apk that works. I had managed it 3 months ago, but now I have a new computer so I needed to set everything up again. I'm on Windows 8 64-bit.

I do successfully make a .apk(when I do ant debug/ant release) but when I try to run it on my phone the game crashes immediately.
I first thought it was because of this:

Code: Select all

arm-linux-androideabi-g++: error: CreateProcess: No such file or directory
make.exe: *** [obj/local/armeabi/objs/love/src/love.o] Error 1
That means that your apk build was not succesfull (compare the resulting *.apk sizes). For some reason compilation of love.o failed (check earlier error messages), and without this file love2d does not work.
But what is love.o ? And how can this be fixed? What is armeabi? Remember installing it when I was selecting Android SDK plugins or something.
User avatar
miko
Party member
Posts: 410
Joined: Fri Nov 26, 2010 2:25 pm
Location: PL

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

Post by miko »

Mermersk wrote: But what is love.o ? And how can this be fixed? What is armeabi? Remember installing it when I was selecting Android SDK plugins or something.
love.o is "everything", means a game engine (love2d) as a library ("object file"). armeabi is a binary format form ARM platform. To create a binary files for android (ARM) on your PC (Intel), you need to have working cross-compiler. Android SDK should do that for you. Maybe you need to reinstall it. Try a "hello world" example for android first, and if that works out, retry with love2d.

Also, be sure to theck out this: http://stackoverflow.com/questions/7651 ... tory-error
My lovely code lives at GitHub: http://github.com/miko/Love2d-samples
Locked

Who is online

Users browsing this forum: No registered users and 5 guests