Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mignon-p/frege-on-android

An example of how to use Frege on Android.
https://github.com/mignon-p/frege-on-android

Last synced: 19 days ago
JSON representation

An example of how to use Frege on Android.

Awesome Lists containing this project

README

        

This repository is an example of how to call code written in
[Frege][1] from an Android program. It's assumed that you will write
your user interface in Java, and just write application logic in
Frege. Calling Android APIs from Frege is trickier and is not
discussed here.

## Screenshot

![FregeActivity][3]

## Using in your own project

You can get started using this repo as the basis for your own project
by running the `change-package-name.pl` script in this directory.
Give it the package name you want to use, and the activity name you
want to use, and it will rename the code. For example:

./change-package-name.pl com.example.whatever WhateverActivity

## License

The code in this repo that I (Patrick Pelletier) have written is in
the public domain / [cc0][0]. However, some of the files come from
the scaffolding generated by `android project create`, and part of the
`build.gradle` file comes from [a post on the Frege mailing list][2].

## Caveats

This project uses Frege 3.23, so for that you would use the
[old way of calling Frege from Java][5]. I haven't tried using Frege
3.24, but if you want to try that, you'd use [the new way][6].

Also, note that this project requires [API Level 21][10] or
higher, because Frege needs [ForkJoinPool][11], which Android only has
in level 21 and up.

I was not able to get Proguard to work successfully, so everything in
the Frege jar file (including the compiler) gets uploaded to the
phone. This required using [multidex][9], although it works fine.

Pull requests are welcome!

[0]: https://creativecommons.org/publicdomain/zero/1.0/legalcode.txt
[1]: http://frege-lang.org/
[2]: https://groups.google.com/forum/#!msg/frege-programming-language/iIJeAwlf8UM/sqOcu7f6AwAJ
[3]: screenshot.png
[5]: https://github.com/Frege/frege/wiki/Calling-Frege-Code-from-Java
[6]: https://github.com/Frege/frege/wiki/Calling-Frege-from-Java-(from-release-3.24-on)
[9]: https://developer.android.com/studio/build/multidex.html#mdex-gradle
[10]: https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels
[11]: https://developer.android.com/reference/java/util/concurrent/ForkJoinPool.html