newLisp on Android

Notices and updates

newLisp on Android

Postby kanen » Fri Dec 21, 2012 7:23 am

We have it working. It's stable.

It is missing (semaphore), which requires libraries that do not exist on Android. I'm attaching the full source, hoping Lutz will add everything necessary to make this work as part of the main newlisp download.

Steps to compile:

1. Download the android-ndk - http://developer.android.com/tools/sdk/ndk/index.html
2. Make sure your environment works (see above documentation) on your platform
3. Unpack and put newlisp-ndk in the android-ndk directory
4. Compile newlisp

Code: Select all
kanen (~/Code/android-ndk)$ ./ndk-build -C newlisp-ndk/
make: Entering directory `/Users/kanen/Code/android-ndk/newlisp-ndk'
Compile thumb  : newlisp <= newlisp.c
Compile thumb  : newlisp <= nl-symbol.c
Compile thumb  : newlisp <= nl-math.c
Compile thumb  : newlisp <= nl-list.c
Compile thumb  : newlisp <= nl-liststr.c
Compile thumb  : newlisp <= nl-string.c
Compile thumb  : newlisp <= nl-sock.c
Compile thumb  : newlisp <= nl-import.c
Compile thumb  : newlisp <= nl-xml.c
Compile thumb  : newlisp <= nl-web.c
Compile thumb  : newlisp <= nl-matrix.c
Compile thumb  : newlisp <= nl-debug.c
Compile thumb  : newlisp <= pcre.c
Compile thumb  : newlisp <= nl-filesys.c
Executable     : newlisp
Install        : newlisp => libs/armeabi/newlisp
make: Leaving directory `/Users/kanen/Code/android-ndk/newlisp-ndk'


The binary gets put into libs/armeabi/newlisp. From there, you just have to build an Android emulator and you can copy newLisp over to it.

For that, you need the android-sdk - http://developer.android.com/sdk/index.html

First, list the targets and find the armeabi version you want to use. I use Target 4, which isn't the most recent, but is the most widely deployed, at API level 15.

Code: Select all
kanen (~/Code/android-sdk/tools)$ ./android list targets
Available Android targets:
id: 4 or "Google Inc.:Google APIs:15"
     Name: Google APIs
     Type: Add-On
     Vendor: Google Inc.
     Revision: 2
     Description: Android + Google APIs
     Based on Android 4.0.3 (API level 15)
     ABIs : armeabi-v7a


Now, generate an emulator from that target platform:
Code: Select all
kanen (~/Code/android-sdk/tools)$ ./android create avd -n MyEmulator -t 4


Then, run the emulator:
Code: Select all
kanen (~/Code/android-sdk/tools)$ ./emulator -avd MyEmulator


Attach a shell to the emulator:
Code: Select all
kanen (~/Code/android-sdk/platform-tools)$ ./adb shell


Make sure everything's ok and create a directory for newLisp:
Code: Select all
# mkdir /data/nl
# chmod 777 /data/nl
# exit


Copy newLisp to the emulator:
Code: Select all
./adb push ~/Code/android-ndk/newlisp-ndk/libs/armeabi/newlisp /data/nl


Go back into the shell and run newLisp:
Code: Select all
kanen (~/Code/android-sdk/platform-tools)$ ./adb shell
# cd /data
# cd nl
# ls
newlisp
# ./newlisp
newLISP v.10.4.5 on Linux IPv4/6, execute 'newlisp -h' for more info.

>


Enjoy newLisp on Android. You now have a world of mobile possibilities for our favorite scripting language.

newlisp-ndk.tgz
newLisp Android Sources
(239.44 KiB) Downloaded 306 times


I've also included a link to the newLisp on arm binary, if you don't want to compile all this and just want to push newLisp to your shiny Android device: https://dl.dropbox.com/u/602830/newlisp
. Kanen Flowers http://kanen.me .
kanen
 
Posts: 144
Joined: Thu Mar 25, 2010 6:24 pm

Re: newLisp on Android

Postby cormullion » Fri Dec 21, 2012 8:58 am

Good job - well done. Next, how about the iPhone? :)
cormullion
 
Posts: 2037
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W

Re: newLisp on Android

Postby Lutz » Fri Dec 21, 2012 7:35 pm

Instructions and download are now online at newlisp.org too:

http://www.newlisp.org/code/ANDROID.html
Lutz
 
Posts: 5258
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Re: newLisp on Android

Postby kanen » Sat Dec 22, 2012 5:42 am

Lutz wrote:Instructions and download are now online at newlisp.org too:

http://www.newlisp.org/code/ANDROID.html


Small mistake:
Code: Select all
kanen (~/Code/android-sdk/tools)$ ./emulator -avd TrustMe

Should be
Code: Select all
kanen (~/Code/android-sdk/tools)$ ./emulator -avd MyEmulator
. Kanen Flowers http://kanen.me .
kanen
 
Posts: 144
Joined: Thu Mar 25, 2010 6:24 pm

Re: newLisp on Android

Postby Lutz » Sat Dec 22, 2012 4:00 pm

added two more corrections:

start the emulator in the background:
Code: Select all
kanen (~/Code/android-sdk/tools)$ ./emulator -avd MyEmulator &

the directory is nl:
Code: Select all
# cd /data
# cd nl
# ls
newlisp
# ./newlisp


the online page now has all the corrections: http://www.newlisp.org/code/ANDROID.html

works fine for me on Mac OSX 10.8.2, but as a target I got: id: 1 for API level 17. So I just changed the number accordingly when creating the emulator.
Lutz
 
Posts: 5258
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Re: newLisp on Android

Postby jazper » Wed Jan 16, 2013 7:33 pm

This is very exciting. I recently bought my first smartphone, a bottom range model, and invested some money in Basic4Android. I have played with that a bit, but then life intervened ... and then the festive season, and then ....

Does this newLISP implementation permit making buttons, views etc in the emulator? Or does it write to console (or whatever Android's equivalent of a console may be) only?
jazper
 
Posts: 91
Joined: Thu Dec 10, 2009 8:26 am
Location: South Africa

Re: newLisp on Android

Postby HPW » Sun Sep 15, 2013 5:48 am

Hello,

Is there a equivalent of newlisp.dll on the android target of newlisp ?

What I have in mind to call newlisp from a regular Java-build app.

When this would even support callbacks into the Java app, this would allow really potential Java/newlisp driven android apps.

A workflow with sample app would be fantastic.

Regards
Hans-Peter
HPW
 
Posts: 1352
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany


Return to newLISP newS

Who is online

Users browsing this forum: No registered users and 1 guest

cron