Building PM on Android

Old discussions related to the Android/mobile version of Pale Moon.
access2godzilla

Building PM on Android

Unread post by access2godzilla » 2014-04-29, 08:26

Before I even start trying to do anything, I'd like to ask whether the Pale Moon source tree have the necessary code for building on Android? Or was this code never incorporated into the source tree?

(I'm aware of the fact that both /android and /b2g are present, but perhaps some parts may have been left out?)

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35650
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Building PM on Android

Unread post by Moonchild » 2014-04-29, 08:49

I kept full Firefox 24 ESR parity, so everything should be there for building on Android. I don't know how the rebranding will take for Android though, it's kind of its own separate sub-tree.
I tried poking at it myself, briefly, but realized I simply don't have the know-how, nor the equipment, to properly build and test Android Apps.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

dark_moon

Re: Building PM on Android

Unread post by dark_moon » 2014-04-29, 09:05

With AndoVM it exist a Android VM for VirtualBox.
Tried it and it works.
http://androvm.org/blog/

access2godzilla

Re: Building PM on Android

Unread post by access2godzilla » 2014-04-30, 05:35

Seems like the build was successful: only one thing: it doesn't render anything. :wtf: Where should I look at now?
http://i.imgur.com/tWeYIoO.png
Moonchild wrote: I don't know how the rebranding will take for Android though, it's kind of its own separate sub-tree.
Yes, seems so. I did put in some Pale Moon icons from the /browser/branding folder and got something that can neither be called Firefox nor Pale Moon.
http://i.imgur.com/5WnTUUx.png
Moonchild wrote:I simply don't have the know-how, nor the equipment, to properly build and test Android Apps.
Building was pretty easy, equipment, well, there's Android-x86 as well as Google's own emulator that's distributed within the SDK.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35650
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Building PM on Android

Unread post by Moonchild » 2014-04-30, 09:46

access2godzilla wrote:Seems like the build was successful: only one thing: it doesn't render anything. :wtf: Where should I look at now?
Like I said I don't have the know-how for this. I have no clue, since I know absolutely nothing about the way Android works, let alone the graphics subsystem. I can't help you.
access2godzilla wrote:got something that can neither be called Firefox nor Pale Moon.
You'll have to look through the branding files and change the application name.
Configure.sh:

Code: Select all

MOZ_APP_DISPLAYNAME=Palemoon
and copy the brand.dtd and brand.properties from the official Pale Moon branding folder (in locales/en-US). That should get you somewhere :)
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

access2godzilla

Re: Building PM on Android

Unread post by access2godzilla » 2014-04-30, 17:14

It seems that I got the browser to work to that extent is a feat in itself, since Fennec-x86 was experimental. Building for ARM now, let us see how that goes.

BTW, in this "title only browser" that I've managed to build, it seems like about:palemoon won't work, but apparently about:mozilla does (with that memoriam stuff.)

(In any case, these will always be just part of an experiment, I'm not planning on a project or on releases as I've done on Linux.)

New Tobin Paradigm

Re: Building PM on Android

Unread post by New Tobin Paradigm » 2014-04-30, 17:25

access2godzilla wrote: BTW, in this "title only browser" that I've managed to build, it seems like about:palemoon won't work, but apparently about:mozilla does (with that memoriam stuff.)
about:mozilla is implemented in the backend and toolkit code while about:palemoon is implemented solely for /browser/

access2godzilla

Re: Building PM on Android

Unread post by access2godzilla » 2014-05-01, 09:40

I've got a working build on ARM :D
http://i.imgur.com/gvBEykg.png

And it benefits from all the fixes made in these releases, so seems like we can call it Fennec ESR ;)

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35650
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Building PM on Android

Unread post by Moonchild » 2014-05-01, 14:26

access2godzilla wrote:I've got a working build on ARM :D
http://i.imgur.com/gvBEykg.png

And it benefits from all the fixes made in these releases, so seems like we can call it Fennec ESR ;)
Awesome!

I am very interested in someone building and releasing Pale Moon for Android since I very regularly get that question (especially after the whole CEO debacle). I can probably do it myself if I get myself a tablet to test natively (and if you can help me with the setup, a2g, of how you built it), since you indicated it was mostly an experiment for you and you're not seriously considering a release publish yourself?

Or, if someone else wants to make it a contributed build, that would work too.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

dark_moon

Re: Building PM on Android

Unread post by dark_moon » 2014-05-01, 15:39

Can we test your buíld?

New Tobin Paradigm

Re: Building PM on Android

Unread post by New Tobin Paradigm » 2014-05-01, 15:41

dark_moon wrote:Can we test your buíld?
Yeah I am also willing to trash my phone in the name of SCIENCE!

access2godzilla

Re: Building PM on Android

Unread post by access2godzilla » 2014-05-01, 16:54

dark_moon wrote:Can we test your buíld?
https://www.mediafire.com/folder/trm1zgrf3dj2x/palemoon
Only works on ARMv7 and above, and unfortunately, also has Firefox branding.
mattatobin wrote:Yeah I am also willing to trash my phone in the name of SCIENCE!
A basic Fennec build will "trash your phone"? Then I suppose you never root phones or flash custom ROMs on them?

New Tobin Paradigm

Re: Building PM on Android

Unread post by New Tobin Paradigm » 2014-05-01, 17:00

access2godzilla wrote: A basic Fennec build will "trash your phone"? Then I suppose you never root phones or flash custom ROMs on them?
You are correct it won't trash the phone.. but I am still gonna do it.. FOR SCIENCE!

dark_moon

Re: Building PM on Android

Unread post by dark_moon » 2014-05-01, 17:07

Thanks. Will test it when i'm back home tomorrow.

mattatobin's comment was ironic.

access2godzilla

Re: Building PM on Android

Unread post by access2godzilla » 2014-05-01, 17:39

Moonchild wrote:if you can help me with the setup, a2g, of how you built it
Sure :) Start from https://wiki.mozilla.org/Mobile/Fennec/Android

A few notes:
  • Unless you're using Ubuntu, go to the "explained" section directly: https://wiki.mozilla.org/Mobile/Fennec/ ... #Explained
  • Get the JDK from Oracle (registration required) or from here or here. Download the file jdk-6u45-linux-<arch>.bin and install it by executing it.
  • Append the following in your ~/.bashrc or ~/.bash_profile:

    Code: Select all

    PATH=$PATH:/usr/java/jdk1.6.0_45/bin:/usr/java/jdk1.6.0_45/jre/bin
    export PATH
    
  • I didn't require installing ant or ccache. Fennec builds fine without them, but you'd probably want ccache since it speeds up successive compilations.
  • "Usual stuff" is better explained here. Leave out gcc, g++, mercurial, and libcurl4-openssl-dev we won't be needing them.
  • The recent version of the ADT bundle is available here: https://developer.android.com/sdk/index.html ("Downloads for other platforms").
  • The build process searches for aapt and dx in the wrong places, so we need to establish symlinks:

    Code: Select all

    cd ~/adt-bundle-linux/sdk/platform-tools
    ln -s ~/adt-bundle-linux/sdk/build-tools/android-4.4.2/aapt aapt
    ln -s ~/adt-bundle-linux/sdk/build-tools/android-4.4.2/dx dx
    
  • I used the following mozconfig, but then you need to do some research:

    Code: Select all

    ac_add_options --enable-application=mobile/android
    ac_add_options --target=arm-linux-androideabi
    
    mk_add_options MOZ_OBJDIR="$HOME/pmbuild"
    
    ac_add_options --with-android-gnu-compiler-version=4.7
    ac_add_options --with-android-version=9
    ac_add_options --with-system-zlib
    
    ac_add_options --with-branding=mobile/android/branding/beta
    
    ac_add_options --disable-webrtc
    ac_add_options --disable-updater
    
    ac_add_options --disable-tests
    ac_add_options --disable-debug
    ac_add_options --disable-debug-symbols
    ac_add_options --disable-mochitests
    
    ac_add_options --enable-strip
    
    ac_add_options --with-android-ndk="$HOME/android-ndk-r8e"
    ac_add_options --with-android-sdk="$HOME/adt-bundle-linux/sdk/platforms/android-19"
    
  • The ADB stuff and "./mach install" can be forgotten for now. Simple copying and installing through the file manager works as well.
Edit: correct typoes + remove installation info not pertaining to NDK emulators.
Last edited by access2godzilla on 2014-05-01, 18:44, edited 1 time in total.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35650
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Building PM on Android

Unread post by Moonchild » 2014-05-01, 17:49

Thanks for the run-down! I see I would have brickwalled a few times without it, so thanks for that ;)
I'll have a FossaMail build to do first, but I'll give it a whirl after, and see if I can get things built and running.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

New Tobin Paradigm

Re: Building PM on Android

Unread post by New Tobin Paradigm » 2014-05-01, 17:53

Moonchild wrote:Thanks for the run-down! I see I would have brickwalled a few times without it, so thanks for that ;)
I'll have a FossaMail build to do first, but I'll give it a whirl after, and see if I can get things built and running.
I would like to see what Pale Moonisms get added if this does take off. UI changes, features, optimization... Should be fun!

access2godzilla

Re: Building PM on Android

Unread post by access2godzilla » 2014-05-02, 06:11

mattatobin wrote:optimization...
Don't really see any scope for optimisations, since it's already built with -march=armv7-a, and taking it higher than that will cause compatibility problems.

New Tobin Paradigm

Re: Building PM on Android

Unread post by New Tobin Paradigm » 2014-05-02, 07:33

access2godzilla wrote:
mattatobin wrote:optimization...
Don't really see any scope for optimisations, since it's already built with -march=armv7-a, and taking it higher than that will cause compatibility problems.
Well optimizing code does not always mean compiler flags.. Could be some chunk of spaghetti code that can be made more efficient in and of its self but I do see your point.

access2godzilla

Re: Building PM on Android

Unread post by access2godzilla » 2014-05-08, 05:39

@Moonchild
I know that you're looking for some ARM devices for testing (from the donations page), but in the meantime, is a "work in progress" kind of build possible? Mail&News and PM for Atom had been such "works in progress" for a long time.

As an aside, while it is preferable to have some kind of device to actually test things on, it is not an absolute requirement. Devs use the emulators, because they let you test different configurations. Buying so many devices is not a practical possibility, even if the budget allows it.