[erlang-questions] Erlang4Android
Erik Reitsma
erlang@REDACTED
Mon Feb 25 22:24:45 CET 2013
Hi David and all,
I had not assumed that people would want to use Erlang on Android in
distributed mode. However, now that there appears a "market" for this, I
will try to get distribution working too. I think that there may be some
issues with ownership of the cookie file, and the user id under which
Erlang runs.
I intend to publish a new version as soon as R16B is out (which should
be in a few days). I would prefer to try to get distribution working in
that version.
I have also worked a bit on a new installer, which makes it possible to
install the small version first, and add libraries later.
Regards,
*Erik.
On 02/25/2013 12:45 PM, Dávid Juhász wrote:
> Hi Erik and all,
>
> The work that has been done is awesome and I am happy to be able to
> run Erlang code on Android devices!
>
> Unfortunately, I ran into a technical problem trying to run
> distributed Erlang programs on Android via SL4A. In root terminal,
> distributed mode works smoothly, but in that case I am unable to
> create GUI for the program. On the other hand, programs started via
> the scripting layer are running without root privileges which causes
> some trouble.
>
> It seems unavoidable that distributed mode must be initialized
> programatically using net_kernel:start/1 as SL4A doesn't start Erlang
> in distributed mode. The first problem I encountered was the
> insufficient privilege to create a cookie file. Having one created
> manually, that part of initialization seems to be successful. The next
> problem seems to be that epmd isn't getting started. I can start epmd
> in daemon mode from the Erlang program using os:cmd/1, so the program
> and epmd run under the same user. But the same issue appears:
>
> {error,{shutdown,{child,undefined,net_sup_dynamic,
> {erl_distribution,start_link,[["node@REDACTED"]]},
> permanent,1000,supervisor,
> [erl_distribution]}}}
>
> Can someone give me any pointer how to overcome this issue of using
> GUI and distributed mode at the same time?
>
> Thanks in advance for any help!
>
> Best wishes,
> David
>
>
> 2013. január 13., vasárnap 21:06:06 UTC+1 időpontban Erik Reitsma a
> következőt írta:
>
> Hi all,
>
> I have put my port of Erlang to Android on Google Code:
> http://code.google.com/p/erlang4android/
> <http://code.google.com/p/erlang4android/>
>
> To install it on your Android device, you should allow
> applications from unknown sources, because the app is not
> delivered through Google Play (yet). The Android device does *not*
> have to be rooted.
>
> It depends on Scripting Layer for Android (SL4A). So in order to
> use it, you should first install SL4A r6 from here:
> http://code.google.com/p/android-scripting/downloads/detail?name=sl4a_r6.apk
> <http://code.google.com/p/android-scripting/downloads/detail?name=sl4a_r6.apk>
> Then install the APK for Erlang, this one:
> http://code.google.com/p/erlang4android/downloads/detail?name=ErlangForAndroid.apk
> <http://code.google.com/p/erlang4android/downloads/detail?name=ErlangForAndroid.apk&can=2&q=#makechanges>
> This app is just the installer. Run it to actually install
> Erlang/OTP. I have included as much of OTP as might be remotely
> useful, so the download is 36.5 MB. Of course you want to use the
> megaco and orber applications on your phone!
>
> You can use the SL4A API through the module android that I have
> added. I have added a very simple example, to show you how you can
> make a small gui and respond to events. Study the SL4A API to do
> other Android things.
>
> You can run some Erlang code by putting your source in the SL4A
> scripts directory on the Android device, which is
> /sdcard/sl4a/scripts/. The .erl file should contain and export a
> function main/0, which will be called when the script is run. The
> .erl file will be compiled to a .beam file automatically, only if
> the .beam file does not exist. A minor inconvenience now is, that
> if the .erl file is modified, it will not be recompiled unless the
> .beam file is removed. The scripts directory will be in the code
> path, so if you put other .beam files there, they will be found,
> and .erl files there will be compiled too, if necessary.
>
> Enjoy!
>
> *Erik.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130225/cfbceafb/attachment.htm>
More information about the erlang-questions
mailing list