[DEV] Android App Compatibility for Sailfish OS

Search This thread

nh1402

Senior Member
Apr 16, 2012
294
134
(May or may not be the right place to put this)

A place to discuss and attempt to implement Android app compatibility for Sailfish OS.

Now I'm not too knowledgeable about this kind of stuff, I'll need to do more research before I'll be able to help in any meaningful way.

From a community standpoint I'd much prefer an open solution.

The way the Sailfish stack is designed it leads itself more to an open solution than previous attempts. It uses the android driver libs from original /system , runs an init just as in real android. For example surface flinger would run if you enabled it from init.rc. We can run the original dalvik. So all (and I know its a significant task) that is required is some plumbing to allow switching of surface flinger output to hwcomposer instead of lipstick (the sailfish compositor) and switching touch.

I'd invite anyone interested to join us at sailfishos-porters to discuss further

BR

vgrade
UPDATE 1:
I have been working on this lately, and can "boot" into CM11 and get to the setup screen, but the touchscreen, power button and potentially everything else doesn't work as it's still using the sailfish drivers. The only command needed to boot into CM11 is just starting surfaceflinger via "./surfaceflinger" after navigating to /system/bin/ . I did however modify the init.rc file to turn on the android specific services. which I've linked below.

UPDATE 2: using ssh via USB connection breaks when "booting" into CM but using ssh over WiFi does not.

Modified init.rc file

UPDATE 3: Quicksilver is a chromium client for sailfish, and if you build it with NaCl enabled (its currently disabled) then ARChon MAY work. The link to the git repo is below.
quicksilver repo link

UPDATE 4: It's getting close now. Chroot-ing into the android emulator image while also using it's renderer is almost seeing the light of day and we need your help. All info found in this thread.
 
Last edited:

jalyst

Senior Member
Jan 31, 2009
252
36
Some extra posts for context...
The following post is what inspired the vgrade's post (see post 1 of this thread):

and Alien is ported over (I know it wont be official, someones gonna do it anyway) this could easily be a daily driver.

What makes you so sure of that, AlienDalvik's a proprietary solution, it's not an easy undertaking, IcedRobot really struggled to get anywhere.
I followed it & related/similar for years, but none of them got anywhere really...*
Jolla should be offering AD as a paid add-on via the store, not expecting the community to whisk a decent alternative into reality from thin air.

---------- Post added at 02:27 PM ---------- Previous post was at 02:24 PM ----------

An open dalvik would be a huge step forwards and any help people can give please drop into #sailfishos-porters IRC

Surely a much better "step forward" would be to offer AD as a paid for add-on via the store...
Maybe longer-term you/we can aim for an open dalvik, but there's already too much you're/we're juggling over the next ~12mth.

*google IcedRobot & IcedRobot Dalvik, but here's 3 quick/dirty links:
https://wiki.debian.org/Java/DevJam...do=get&target=icedrobot-fosdem-2011-02-05.pdf
https://github.com/icedrobot
https://twitter.com/hashtag/icedrobot
The old project site doesn't even exist any more, just some junk fitness product:
http://www.icedrobot.org/


The next 2 posts below came after vrgrade's response (see post 1 of this thread):

@vgrade

Interesting, I thought what would be required, is something akin to icedrobot i.e. a complete (openJDK compliant) replacement of dalvik.
Are you saying that something much simpler would be possible (& hence much less work), & would still work just as well?
Sorry for the OT post, last one, perhaps a sep. thread needs to be created here...

Yes , something much simpler.

Please feel free to start a new thread , its there a general area on xda as this would be common to all Sailfish ports, N4, N5 , N7 , Galaxy Nexus etc

vgrade
 
Last edited:

taaeem

Senior Member
Feb 22, 2014
1,013
642
Hamburg
Nice thread. I have not much knowledge about such things here but just to say it BlackBerry OS 10 has also support for Android apps and maybe someone could get done kind of inspiration off their implementation of Android. Just a thought of mine maybe it's completely nonsense what I said but maybe not so.
 

jalyst

Senior Member
Jan 31, 2009
252
36
You'd prolly want to get folks like: Mario Torre (IcedRobot), Carstun Munk (libhybris), Thomas Perl (apkenv) involved in one way or another.
Plus some Android guys who are well respected in this community, & who know dalvik/art inside out...
 

jalyst

Senior Member
Jan 31, 2009
252
36
Yeah but, apkenv is far from being a solution, we need some of the relevant parties engaging here, not end-users.
 

nh1402

Senior Member
Apr 16, 2012
294
134
ARC - App Runtime for Chrome OS, is promising, if anyone knows how to port it over . I can't find any source files, other than ARChon. Could it be this.
 

EnErGy[CSDX]

Senior Member
Nov 13, 2012
60
32
Lviv
  • Like
Reactions: jotakinhan

EnErGy[CSDX]

Senior Member
Nov 13, 2012
60
32
Lviv

nh1402

Senior Member
Apr 16, 2012
294
134
I was just stating theoretically speaking. I wasn't suggesting someone should do that, I understand that its not a trivial task. I guess we should wait till they release all the necessary files then, unless they don't plan to then we're back to square one.
 

nh1402

Senior Member
Apr 16, 2012
294
134
I thought I would try and see what happens if I pause lipstick (kill -STOP 950) , and start surfaceflinger (./system/bin/surfaceflinger), and see what happens, turns out it shows that "static-y" image like when you're booting into sailfish.but since sailfish doesn't use surfaceflinger then nothing happens it just stays with that same screen. stop surfaceflinger, and then run (kill -CONT 950), and then start interacting with the screen again, everything goes back to normal.

If I can find out the bare minimum needed to install and run an apk, it could work, but probably won't.

If someone knows what services are needed in order to either boot into android, or to get an app to run, please say so.

EDIT: I can now get to the setup screen of cyanogenmod, but that is it, touchscreen doesn't work and ssh connection breaks. But its recognised as an unauthorised device in adb.
 
Last edited:

nh1402

Senior Member
Apr 16, 2012
294
134
Chrome OS is a GNU/Linux distro, so would need crosscompiling to ARM and integration effort
Checking the source code documentation still reads "A small set of shared objects can be built which are part of ARC currently. A fully running system cannot currently be built." They could provide an update and release the shared objects at Google I/O later this year but I wouldn't hold my breath.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 5
    AND WE HAVE INPUT. No app was necessary, all that's needed is to change the group for /dev/input/eventX from video to input, before you try booting into CM (Cyanogenmod). You will also have to modify the init.rc file to start android serviceshere is my modified init.rc file (from Nexus 5) for reference.

    This was tested on Alpha 14 on the Nexus 5 but it should still work on other versions and other phones.

    1. Modify init.rc to start android services at boot time. (only needed to be done once)
    2. Restart
    3. In terminal navigate to "/dev/input/"
    4. run command "devel-su find . -name 'event*' -exec chown :input {} +" (this resets every time you restart the phone)
    5. In the terminal navigate to "/system/bin/"
    6. run command "devel-su systemctl-user stop lipstick.service; ./surfaceflinger"
    8. It should now boot into CM from within Sailfish

    CAVEATS:

    • Once you boot into CM from Sailfish, it's not always possible to get back into Sailfish.
    • If you do get back into Sailfish then you will NOT be able to boot back into CM, unless you restart the phone.
    • WiFi and Mobile Data will only work in CM if it's been turned in Sailfish before hand.
    • You cannot call or text from within CM.
    This is still a WIP

    logcat dump Please let me know if you know how to fix the errors.
    4
    (May or may not be the right place to put this)

    A place to discuss and attempt to implement Android app compatibility for Sailfish OS.

    Now I'm not too knowledgeable about this kind of stuff, I'll need to do more research before I'll be able to help in any meaningful way.

    From a community standpoint I'd much prefer an open solution.

    The way the Sailfish stack is designed it leads itself more to an open solution than previous attempts. It uses the android driver libs from original /system , runs an init just as in real android. For example surface flinger would run if you enabled it from init.rc. We can run the original dalvik. So all (and I know its a significant task) that is required is some plumbing to allow switching of surface flinger output to hwcomposer instead of lipstick (the sailfish compositor) and switching touch.

    I'd invite anyone interested to join us at sailfishos-porters to discuss further

    BR

    vgrade
    UPDATE 1:
    I have been working on this lately, and can "boot" into CM11 and get to the setup screen, but the touchscreen, power button and potentially everything else doesn't work as it's still using the sailfish drivers. The only command needed to boot into CM11 is just starting surfaceflinger via "./surfaceflinger" after navigating to /system/bin/ . I did however modify the init.rc file to turn on the android specific services. which I've linked below.

    UPDATE 2: using ssh via USB connection breaks when "booting" into CM but using ssh over WiFi does not.

    Modified init.rc file

    UPDATE 3: Quicksilver is a chromium client for sailfish, and if you build it with NaCl enabled (its currently disabled) then ARChon MAY work. The link to the git repo is below.
    quicksilver repo link

    UPDATE 4: It's getting close now. Chroot-ing into the android emulator image while also using it's renderer is almost seeing the light of day and we need your help. All info found in this thread.
    3
    Progress on chroot-ing into the android emulator image with the renderer is coming along slowly but we are really close! In desperate need of someone who knows OpenGL, if you know it then head on over to the IRC channel #sailifishos-porters
    3
    I thought I would try and see what happens if I pause lipstick (kill -STOP 950) , and start surfaceflinger (./system/bin/surfaceflinger), and see what happens, turns out it shows that "static-y" image like when you're booting into sailfish.but since sailfish doesn't use surfaceflinger then nothing happens it just stays with that same screen. stop surfaceflinger, and then run (kill -CONT 950), and then start interacting with the screen again, everything goes back to normal.

    If I can find out the bare minimum needed to install and run an apk, it could work, but probably won't.

    If someone knows what services are needed in order to either boot into android, or to get an app to run, please say so.

    EDIT: I can now get to the setup screen of cyanogenmod, but that is it, touchscreen doesn't work and ssh connection breaks. But its recognised as an unauthorised device in adb.
    2
    Some extra posts for context...
    The following post is what inspired the vgrade's post (see post 1 of this thread):

    and Alien is ported over (I know it wont be official, someones gonna do it anyway) this could easily be a daily driver.

    What makes you so sure of that, AlienDalvik's a proprietary solution, it's not an easy undertaking, IcedRobot really struggled to get anywhere.
    I followed it & related/similar for years, but none of them got anywhere really...*
    Jolla should be offering AD as a paid add-on via the store, not expecting the community to whisk a decent alternative into reality from thin air.

    ---------- Post added at 02:27 PM ---------- Previous post was at 02:24 PM ----------

    An open dalvik would be a huge step forwards and any help people can give please drop into #sailfishos-porters IRC

    Surely a much better "step forward" would be to offer AD as a paid for add-on via the store...
    Maybe longer-term you/we can aim for an open dalvik, but there's already too much you're/we're juggling over the next ~12mth.

    *google IcedRobot & IcedRobot Dalvik, but here's 3 quick/dirty links:
    https://wiki.debian.org/Java/DevJam...do=get&target=icedrobot-fosdem-2011-02-05.pdf
    https://github.com/icedrobot
    https://twitter.com/hashtag/icedrobot
    The old project site doesn't even exist any more, just some junk fitness product:
    http://www.icedrobot.org/


    The next 2 posts below came after vrgrade's response (see post 1 of this thread):

    @vgrade

    Interesting, I thought what would be required, is something akin to icedrobot i.e. a complete (openJDK compliant) replacement of dalvik.
    Are you saying that something much simpler would be possible (& hence much less work), & would still work just as well?
    Sorry for the OT post, last one, perhaps a sep. thread needs to be created here...

    Yes , something much simpler.

    Please feel free to start a new thread , its there a general area on xda as this would be common to all Sailfish ports, N4, N5 , N7 , Galaxy Nexus etc

    vgrade