maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   ApkEnv support module development (https://talk.maemo.org/showthread.php?t=88250)

quailstorm 2012-12-28 22:29

Re: ApkEnv support module development
 
Quote:

Originally Posted by xes (Post 1308018)
I have just built the latest apkenv snapshot with all the new modules for fremantle... (here attached)

All is working except WOG that does not starts at all giving segfault..

Thanks to all and... Happy Christmas!!! :)

Nokia N900.

Fruit ninja works, background music too.

AB Rio 1.4.4 segmentation fault
AB Space 1.3 black screen, kernel crash, only taking out the battery helped.
What's wrong? (or please PM me with the right APKs)

Bundyo 2012-12-31 16:01

Re: ApkEnv support module development
 
Just a quick overview of what I have been doing.

I noticed that apkenv doesn't take into account the fact that some games may have multiple libraries in the lib folder and just loads the first of them and tries to bind the modules to it. Unfortunately there is no easy fix for this, as the main library is not listed anywhere and can't be detected too (JNI_OnLoad for instance can be sometimes found in more than one of the libs in the folder).

So taking this into account, I've added a possibility for a module to specify which library it wants to use (partial match so you can skip .so). Also changed the folder match to partial, as there are variations.

There is another road block - when the libraries in the lib folder are several, they are referencing each other, next I'll work on mechanism to extract them all somewhere (though it can be slow as I don't have much time), currently you can just extract them in the bionic folder.

Third issue I've noticed - some libraries only export JNI_OnLoad and Unload and bind the native functionality by hand in JNI_OnLoad. This prevents the module to bind directly to them in try_init. I'm open to suggestions how this can be detected and made automatic.

My fork is here:
https://github.com/bundyo/apkenv

hadjistyllis 2013-01-06 10:41

Re: ApkEnv support module development
 
Quote:

Originally Posted by xes (Post 1308018)
I have just built the latest apkenv snapshot with all the new modules for fremantle... (here attached)

All is working except WOG that does not starts at all giving segfault..

Thanks to all and... Happy Christmas!!! :)


Feedback for your work:
Angry Birds, Angry Birds seasons,Amazing Alex works GREAT
Fruit ninja Works with music but ingame is little bit slow
Angry Birds Rio, Angry Birds space not working (stucks the phone)
Cut the rope segmentation fault after loading ends

Also using apkenv --install /.....
creates .desktop to wrong location (/home/user/.local/share/applications but must be /home/user/.local/share/applications/hildon). Btw move it to the correct location still not working.

I upload an example of Amazing Alex for a working .desktop (using script method)
Just edit the files as you want. The examples works if
1)apk location and name: /home/user/MyDocs/ANDROID/"Amazing Alex.apk"
2) copy Alex.sh to /opt/apkenv
3) copy Amazing_Alex.png to home/user/.local/share/icons/hicolor/64x64/apps
4) copy Amazing Alex.desktop to home/user/.local/share/applications/hildon

jamar 2013-01-07 00:51

Re: ApkEnv support module development
 
Quote:

Originally Posted by hadjistyllis (Post 1311443)
...
Angry Birds Rio, Angry Birds space not working (stucks the phone)
...

Same here on my N900, with several APK versions. It has some memory leak, because after launching, it just fills up all available memory and swap space and after while the phone reboots.

Quote:

Originally Posted by hadjistyllis (Post 1311443)
...
Also using apkenv --install /.....
creates .desktop to wrong location (/home/user/.local/share/applications but must be /home/user/.local/share/applications/hildon). Btw move it to the correct location still not working.
...

This function seems to be for Harmattan, so it assumes its file locations and executable commands. To make .desktop file working for N900, just move it to ./hildon subdirectory and on the Exec= line remove "invoker --single-instance --type=e " part of command, so ApkEnv will be called directly.

hadjistyllis 2013-01-07 13:58

Re: ApkEnv support module development
 
Quote:

Originally Posted by jamar (Post 1311707)
Same here on my N900, with several APK versions. It has some memory leak, because after launching, it just fills up all available memory and swap space and after while the phone reboots.


This function seems to be for Harmattan, so it assumes its file locations and executable commands. To make .desktop file working for N900, just move it to ./hildon subdirectory and on the Exec= line remove "invoker --single-instance --type=e " part of command, so ApkEnv will be called directly.

already tested and not working. Only script method works for me

jamar 2013-01-07 18:17

Re: ApkEnv support module development
 
Quote:

Originally Posted by hadjistyllis (Post 1311907)
already tested and not working. Only script method works for me

But should be, at least it works for me. Here's content of my .desktop file for Angry Birds:
Code:

[Desktop Entry]
Name=Angry Birds 2.3.0
Exec=/opt/apkenv/bin/apkenv /home/user/MyDocs/APKs/Angry-Birds-2.3.0.apk
Icon=/home/user/.apkenv/Angry-Birds-2.3.0.apk.png
Terminal=false
Type=Application
Categories=Game;
X-Osso-Type=application/x-executable
X-HildonDesk-ShowInToolbar=true


xes 2013-01-07 23:04

Re: ApkEnv support module development
 
1 Attachment(s)
My N900 was feeling the need of a new apkenv build...
For anyone who wants try, here it is! ;)
It includes the new modules present in the bundyo's repo:

angrybirds.apkenv.so
badpiggies.apkenv.so
cuttherope.apkenv.so
fruitninja.apkenv.so
generic.apkenv.so
perry.apkenv.so
swords.apkenv.so
trg2.apkenv.so
worldofgoo.apkenv.so
worms.apkenv.so

For me, worldofgoo still segfaults.. :(
@bundyo: Do you have any suggestion?

Bundyo 2013-01-08 05:49

Re: ApkEnv support module development
 
Nope :) Didn't touch it. Also please note that none of my modules actually works.

B-RUNO 2013-01-08 08:32

Re: ApkEnv support module development
 
Quote:

Originally Posted by xes (Post 1312146)
My N900 was feeling the need of a new apkenv build...
For anyone who wants try, here it is! ;)
It includes the new modules present in the bundyo's repo:

angrybirds.apkenv.so
badpiggies.apkenv.so
cuttherope.apkenv.so
fruitninja.apkenv.so
generic.apkenv.so
perry.apkenv.so
swords.apkenv.so
trg2.apkenv.so
worldofgoo.apkenv.so
worms.apkenv.so

For me, worldofgoo still segfaults.. :(
@bundyo: Do you have any suggestion?

Hey xes are you able to build with OpenGL ES 2.0 support under fremantle scratchbox?
I've been trying to build but no success, I was just wondering if there is an issue for fremantle or if it's me missing something :confused:

coderus 2013-01-08 09:11

Re: ApkEnv support module development
 
@B-RUNO even in N9 GLES2 Angry Birds not working. Need other modules for it.

B-RUNO 2013-01-08 09:17

Re: ApkEnv support module development
 
Quote:

Originally Posted by coderus (Post 1312255)
@B-RUNO even in N9 GLES2 Angry Birds not working. Need other modules for it.

Thanks for your response coderus!
But really I just want to know if there is an issue or not to build apkenv with GLES2 for fremantle.
Regards

thp 2013-01-08 13:45

Re: ApkEnv support module development
 
As far as building apkenv "with GLES2" and "without GLES2" is concerned:

OpenGL ES 1.x is NOT a subset of OpenGL ES 2.0, and therefore OpenGL ES 2.0 is NOT a superset of OpenGL ES 1.x. There is a nice diagram on the Maemo Wiki that shows the relationships between the different versions (note that OpenGL 2.0 on the Desktop is a superset of OpenGL 1.0 on the Desktop).

All of the games supported by apkenv that I know of are using the OpenGL ES 1.x APIs, and therefore only work if you build apkenv with OpenGL ES 1. Some newer games might be using Open GL ES 2.x (one indication for this is the symbol glUseProgram for example, or just look if it compiles against libGLESv2.so). For these games (once somebody writes a support module for them), you will need to build apkenv with GLES2 support, which does the necessary set-up, and binds the OpenGL ES 2 library functions.

Right now, the choice GLESv1 or GLESv2 is a compile-time choice, we could theoretically make it a run-time switch, but it would unnecessarily complicate the codebase at this stage, especially since we don't have any GLESv2 support modules yet :)

So a good advice: Don't spend your time trying to make GLESv2 work (except if you are specifically working on a module). We can always fix that later once a support module is available. The time is better spent (as Bundyo said) making new modules and figuring out the library loading order for .apks with multiple shared libraries.

xes 2013-01-08 14:29

Re: ApkEnv support module development
 
Building with gles2 is not a problem but until now all the working apk can be run only with the gles1 binary.
So i decided to remove that binary from the zip...

@thp
..looking at the diagram.... it's very difficult to imagine a more complicated way of extending functions.. :)

lorenzo 2013-01-12 13:23

Re: ApkEnv support module development
 
will be possible run ruzzle? apkenv says missing libraries

Kozzi 2013-01-27 18:10

Bump, any updates?

hadjistyllis 2013-01-30 17:57

Re: ApkEnv support module development
 
There is already update for harmatan on the other threat (apkenv_42.3.15_armel.deb).
Could someone port it for N900?

thp 2013-03-08 14:27

Re: ApkEnv support module development
 
Some support module development information from crow_riot in the Pandora forums:

http://boards.openpandora.org/index....nvui/?p=218482

nokiabot 2013-03-08 16:02

Re: ApkEnv support module development
 
Buddy will there be something on apknev for n900 for gps apps lyk viewranger .....just asking as used to that thingy on symbian ::rolleyes: woud be diversly useful to all if sygic is able to work you guys know why :) anyway hats of to modrana it keeps the n900 alive:)

liar 2013-04-05 09:29

Re: ApkEnv support module development
 
Hi!

I've been working on Plants vs Zombies.

Plants vs Zombies uses the Marmalade SDK so i've actually been working on the Marmalade runtime.

After dozens of segfaults, i am now able to >start< the game, i even had to modify a part of the linker to get it going.
But it will still require a bit (probably a lot) work to get a fully playable game, the thing is, Marmalade does not work the same way as other Applications already supported (nativeInit, nativeRender, nativeUpdate and so on), but it actually it wants to take full control over the input and rendering stuff. I might even need to hook fopen in the module to get touch-input working.
EDIT: ignore the fopen sentence ;), i misinterpreted that

By the way when it's working adding support for other games written with Marmalade isn't going to be a big challenge. I've also been able to start Draw Something :) without modifications to my code.

start really just means start - i've been prompted with the start screen of the respective game and the apps main loop is running.

I'd really apprectiate any help, i'll push my work to github as soon as possible.

kind regards,
liar
(this time it really feels wrong to write my username below my message :D, it's relly no joke but i'll probably post a video or something :))

quailstorm 2013-04-05 13:10

Re: ApkEnv support module development
 
I'm really noob in the tech world, but I think, SuperHexagon would be an easy one to port. It's standard GL ES 2.0 And it's a native app, starts, and gives segmentation fault.
If you have time, please look at this game. Thanks!

liar 2013-04-09 23:53

Re: ApkEnv support module development
 
http://www.youtube.com/watch?v=Mc_09JYd9hM
works :)
(sound was cheated by using mplayer ;), this still needs a bit of work)

v0id 2013-04-10 06:39

Re: ApkEnv support module development
 
awesome!!!!!

b-rockSA 2013-04-14 18:59

Excited!

-via Maemo Talk app

Raim 2013-04-14 21:01

Re: ApkEnv support module development
 
Quote:

Originally Posted by thp (Post 1307010)
You mean that the +/- buttons are used for volume control? Should be possible by setting a resource application class. Patches welcome.

I gave it a shot and this was actually very easy to implement following to the Resource Policy docs. You only need to place a single file at /usr/share/policy/etc/syspart.conf.d/apkenv.conf with the following contents:

Code:

[classify gaming]
/usr/bin/apkenv

Afterwards, everything started with apkenv is handled as a game and the +/- keys handle the volume when it is in the foreground.

I sent a pull request to Thomas' repository on github.

nice_2000 2013-04-17 06:44

Re: ApkEnv support module development
 
Sky Force Reloaded:
Code:

Not supported yet, but found JNI methods:
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeLoadPanel
Java_pl_idreams_skyforcereloaded_game_nativeTouch
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeInit
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeInitPathForSave
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeSave
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativePause
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeDone
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeGetAchievement
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeGetLeaderboard
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeGetScore
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeCheckURL
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeClearURL
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeCheckVibraDuration
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeSetAccelerometer
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeScreenLightState
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeMenuMode
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeProcess
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeSoundInit
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeSoundUpdate

Which functions must be ported to run the game?
there are no nativeRender and nativeResize functions.

Java_pl_idreams_skyforcereloaded_MySurfaceView_nat iveInit:
Code:

private static native void nativeInit(ByteBuffer paramByteBuffer, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5);
What is this? :confused:
Sorry for my bad english :|

liar 2013-04-17 19:25

Re: ApkEnv support module development
 
Quote:

Originally Posted by nice_2000 (Post 1336634)
Sky Force Reloaded:
Code:

Not supported yet, but found JNI methods:
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeLoadPanel
Java_pl_idreams_skyforcereloaded_game_nativeTouch
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeInit
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeInitPathForSave
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeSave
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativePause
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeDone
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeGetAchievement
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeGetLeaderboard
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeGetScore
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeCheckURL
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeClearURL
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeCheckVibraDuration
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeSetAccelerometer
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeScreenLightState
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeMenuMode
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeProcess
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeSoundInit
Java_pl_idreams_skyforcereloaded_MySurfaceView_nativeSoundUpdate

Which functions must be ported to run the game?
there are no nativeRender and nativeResize functions.

Java_pl_idreams_skyforcereloaded_MySurfaceView_nat iveInit:
Code:

private static native void nativeInit(ByteBuffer paramByteBuffer, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5);
What is this? :confused:
Sorry for my bad english :|

search the code where nativeInit is called and look how the bytebuffer is filled (maybe look up ByteBuffer if you don't know what it is, i found: http://docs.oracle.com/javase/6/docs...yteBuffer.html)
you should also find there what paramInt2-5 should be, probably screen size and stuff...
if there is no update function look up in the code how the game's main loop works (i'd first look at nativeProcess, that seems suspicious)

nice_2000 2013-04-18 06:15

Re: ApkEnv support module development
 
@liar
Where is the code?
in Java Decompiler there is only one line:
Code:

private static native void nativeInit(ByteBuffer paramByteBuffer, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5);

Mric 2013-04-18 12:34

Re: ApkEnv support module development
 
Hey everyone,
I'm writing this little message to encourage the developers working on apkenv. I truly find it incredible how some Android applications can run (very smoothly) on our beloved N9 and N900. It's like having the best of two worlds ...
I have to do some exams in the next few weeks, but when I have free time I will definitely try to help this project.
Lets keep up the incredible work :)

Ta76eem 2013-04-20 15:56

Re: ApkEnv support module development
 
can Subway Surfers added ??

notaz 2013-04-21 12:35

Re: ApkEnv support module development
 
There is a pull request for SuperHexagon waiting for several days now. I've also fixed World of Goo, but waiting for thp to handle pending pull requests first, hopefully he can handle them soon.

Hariainm 2013-04-22 00:22

Re: ApkEnv support module development
 
Quote:

Originally Posted by notaz (Post 1337729)
There is a pull request for SuperHexagon waiting for several days now. I've also fixed World of Goo, but waiting for thp to handle pending pull requests first, hopefully he can handle them soon.

Who are you? Are you the real Notaz, from the GP32X & Pandora scene?

notaz 2013-04-22 10:53

Re: ApkEnv support module development
 
I am I guess?
Mostly came here to poke thp for the merges.

thp 2013-04-22 13:22

Re: ApkEnv support module development
 
Merge finally done, thanks for your contribution! :)

notaz 2013-04-22 23:25

Re: ApkEnv support module development
 
Thanks, just sent you another one for WOG.

Hariainm 2013-04-23 00:02

Re: ApkEnv support module development
 
Quote:

Originally Posted by notaz (Post 1337896)
I am I guess?
Mostly came here to poke thp for the merges.

Man, I enjoyed a lot with all your work on those devices! I remember playing PicoDrive in my F100-MK2, your works on gpSP, your amazing port of Noiz2sa, with that amazing OST (even a port exists for the N900!). I really enjoyed that years, playing around in the forums, learning from the first time... a new post from Notaz always meant fun for me. I think it was my first initiation with all of this geekety-playing-linux-based-devices. A million thanks for all your work!!!

akuen 2013-04-23 10:57

Re: ApkEnv support module development
 
So, would this work for things like the Pandora app also?

nice_2000 2013-05-02 11:30

Re: ApkEnv support module development
 
How can i see the codes in classes.dex?
I read the first post. I used dex2jar and Java decompiler to open the jar file but there is only some headers.
Sorry for my bad english x(

liar 2013-05-14 23:52

Re: ApkEnv support module development
 
I've been trying to get DrawSomethingFree to run, until now i got it to download the wordlist (very damn hacky), i might need some help :)


EDIT: nevermind i've found a way how i can log bionic calls and calls between libraries, makes things much easier, i've already found some reasons why Draw Something was failing to connect, and it is now connecting :)

liar 2013-05-16 00:47

Re: ApkEnv support module development
 
DrawSomethingFree works now for me, i've already played one game, but there are still a few things missing (for now i hardcoded my email address and username)

liar 2013-05-18 16:49

Re: ApkEnv support module development
 
The Sims 3 works now too (apart from a few graphical glitches)


All times are GMT. The time now is 04:57.

vBulletin® Version 3.8.8