https://github.com/y2k/remote-embeded-repl
List interpreter for android
https://github.com/y2k/remote-embeded-repl
android antlr kotlin lisp lisp-interpreter
Last synced: 2 months ago
JSON representation
List interpreter for android
- Host: GitHub
- URL: https://github.com/y2k/remote-embeded-repl
- Owner: y2k
- License: mit
- Created: 2019-01-17T19:59:35.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-02T11:38:53.000Z (about 7 years ago)
- Last Synced: 2025-05-08T16:54:30.238Z (about 1 year ago)
- Topics: android, antlr, kotlin, lisp, lisp-interpreter
- Language: Kotlin
- Homepage:
- Size: 64.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### Удаленный REPL лиспа для Android
[Antlr граматика](lib/src/main/kotlin/y2k/remoteembederepl/EmbededLisp.g4)
### Пример использования (Kotlin Scratches)
##### Показать тост
```kotlin
io.y2k.remoteconnector.Client.sendObject(
"""
|(.show
| (android.widget.Toast/makeText
| io.y2k.replexample.App/instance
| "Hello world"
| android.widget.Toast/LENGTH_LONG))
""".trimMargin()
)
```
##### Открыть youtube
```kotlin
io.y2k.remoteconnector.Client.sendObject(
"""
|(.startActivity
| io.y2k.replexample.App/instance
| (android.content.Intent.
| android.content.Intent/ACTION_VIEW
| (android.net.Uri/parse "https://youtu.be/dQw4w9WgXcQ")))
""".trimMargin()
)
```
##### Показть нотификацию
```kotlin
io.y2k.remoteconnector.Client.sendObject(
"""
|(.notify
| (androidx.core.app.NotificationManagerCompat/from
| io.y2k.replexample.App/instance)
| 0
| (.build
| (.setContentText
| (.setContentTitle
| (.setSmallIcon
| (androidx.core.app.NotificationCompat${"$"}Builder.
| io.y2k.replexample.App/instance
| "default")
| android.R${"$"}drawable/sym_def_app_icon)
| "Hello")
| "World")))
""".trimMargin()
)
```
### Интеграция на клиенте
```kotlin
class MainActivity : Activity() {
private lateinit var server: Closeable
override fun onStart() {
super.onStart()
server = Server.start(Repl::eval)
}
override fun onStop() {
super.onStop()
server.close()
}
}
```