AndroLua


Source link: https://github.com/mkottman/AndroLua

AndroLua

AndroLua is the Lua interpreter ported to the Android platform. Others have ported Lua to Android, but this project is special:

  • it includes LuaJava, so you can access (almost) everything the Android API provides
  • because writing code on the soft keyboard can be hard, you can connect to it using TCP an upload code from your computer

I created it because I wanted to learn how to use the Android NDK and explore the Android API without having to go through the fuss of creating a project, writing boilerplate code, compiling and uploading the APK just to test a few lines of code.

Depending on the interest, it may become something more...

Requirements

Lua and LuaJava sources are included.

Building

Assuming that $SDK points to your SDK and $NDK points to your NDK installation, run the following:

git clone git://github.com/mkottman/AndroLua.git cd AndroLua $NDK/ndk-build  

This will build the native library, consisting of Lua and LuaJava. Then import the project into Eclipse, or run the following

$SDK/tools/android update project -p . ant debug ant install 

Usage

The UI consist of the following:

  • a large "Execute" button (that's what you want to do, after all)
  • a text editor, where you can write Lua code, conveniently preloaded with the classic "Hello World!" example. A long click on the whole editor will clear it.
  • a status/output window, that shows the output of 'print' function, and is scrollable should there be many lines of output

You can also work interactively by connecting to the TCP port 3333 of the device. You can do that either directly by using WiFi, or through the USB cable. For that you need to run the following:

$SDK/platform-tools/adb forward tcp:3333 tcp:3333 

In this version, there is a simple client interp.lua that uses LuaSocket. By default it will initially read stuff from init.lua.

For example:

$ lua interp.lua loading init.lua  > = activity sk.kottman.androlua.Main@405166c0 > for i = 1,4 do print(i) end 1 2 3 4 

Resources

An elegant pull-to-refresh control.

A custom radio button for Android.

The project is intended for comparing different revisions of image with other revisions.

Reactive Event Hub.

Annotation-based library for generating runtime permissions dispatcher. It supports "Xiaomi" phone.

Simple wrapper library for acquiring 2Checkout payment gateway token.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes