<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi David and all,<br>
<br>
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. <br>
<br>
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.<br>
<br>
I have also worked a bit on a new installer, which makes it
possible to install the small version first, and add libraries
later.<br>
<br>
Regards,<br>
*Erik.<br>
<br>
On 02/25/2013 12:45 PM, Dávid Juhász wrote:<br>
</div>
<blockquote
cite="mid:a2f5067a-7556-4ca1-b776-5e8e27dd96f8@googlegroups.com"
type="cite">Hi Erik and all,<br>
<br>
The work that has been done is awesome and I am happy to be able
to run Erlang code on Android devices!<br>
<br>
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.<br>
<br>
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:<br>
<br>
{error,{shutdown,{child,undefined,net_sup_dynamic,<br>
{erl_distribution,start_link,[[<a class="moz-txt-link-rfc2396E" href="mailto:node@192.168.24.174">"node@192.168.24.174"</a>]]},<br>
permanent,1000,supervisor,<br>
[erl_distribution]}}}<br>
<br>
Can someone give me any pointer how to overcome this issue of
using GUI and distributed mode at the same time?<br>
<br>
Thanks in advance for any help!<br>
<br>
Best wishes,<br>
David<br>
<br>
<br>
2013. január 13., vasárnap 21:06:06 UTC+1 időpontban Erik Reitsma
a következőt írta:
<blockquote class="gmail_quote" style="margin: 0;margin-left:
0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
<div bgcolor="#FFFFFF" text="#000000"> Hi all,<br>
<br>
I have put my port of Erlang to Android on Google Code: <a
moz-do-not-send="true"
href="http://code.google.com/p/erlang4android/"
target="_blank">http://code.google.com/p/<wbr>erlang4android/</a><br>
<br>
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.<br>
<br>
It depends on Scripting Layer for Android (SL4A). So in order
to use it, you should first install SL4A r6 from here: <a
moz-do-not-send="true"
href="http://code.google.com/p/android-scripting/downloads/detail?name=sl4a_r6.apk"
target="_blank">http://code.google.com/p/<wbr>android-scripting/downloads/<wbr>detail?name=sl4a_r6.apk</a>
Then install the APK for Erlang, this one: <a
moz-do-not-send="true"
href="http://code.google.com/p/erlang4android/downloads/detail?name=ErlangForAndroid.apk&can=2&q=#makechanges"
target="_blank">http://code.google.com/p/<wbr>erlang4android/downloads/<wbr>detail?name=ErlangForAndroid.<wbr>apk</a><br>
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!<br>
<br>
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.<br>
<br>
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.<br>
<br>
Enjoy!<br>
<br>
*Erik.<br>
</div>
</blockquote>
</blockquote>
<br>
</body>
</html>