Skip to content

Commit fdb7245

Browse files
author
Eric Lange
committed
Updated with bignumber example
1 parent 5ee9138 commit fdb7245

File tree

6 files changed

+26
-24
lines changed

6 files changed

+26
-24
lines changed

HelloWorld/Server/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.lib/

HelloWorld/Server/.lib/service.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

HelloWorld/Server/bn.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
var BigNumber = require('bignumber.js')
2+
3+
setInterval(function() {}, 1000)
4+
5+
LiquidCore.on( 'ping', function() {
6+
var x = new BigNumber(1011, 2) // "11"
7+
var y = new BigNumber('zz.9', 36) // "1295.25"
8+
var z = x.plus(y) // "1306.25"
9+
LiquidCore.emit( 'pong', { message: '' + x + ' + ' + y + ' = ' + z } )
10+
process.exit(0)
11+
})
12+
13+
LiquidCore.emit( 'ready', {} ) // Again, the object is a must at the moment

HelloWorld/Server/bn.manifest

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"configs": [
3+
{
4+
"file": "bn.js",
5+
"transforms": [ "uglifyify" ]
6+
}
7+
]
8+
}

HelloWorld/Server/service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ LiquidCore.on( 'ping', function() {
1212
// Note that the payload of the event is an object. At the moment,
1313
// this _must_ be an object. Eventually it may be more relaxed.
1414
LiquidCore.emit( 'pong', { message: 'Hallo, die Weld!' } )
15-
exit(0)
15+
process.exit(0)
1616
})
1717

1818
// Ok, we are all set up. Let the host know we are ready to talk

HelloWorld/app/src/main/java/org/liquidplayer/examples/helloworld/MainActivity.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ public void onStart(MicroService service) {
7777
@Override
7878
public void onClick(View v) {
7979
try {
80-
URI uri = new URI("http://"+serverAddr+":8080/service.js");
80+
URI uri = new URI("http://"+serverAddr+":8080/server.js");
81+
// or this ...
82+
//URI uri = new URI("http://"+serverAddr+":8080/bn.js");
8183
MicroService service = new MicroService(MainActivity.this, uri, startListener);
8284
service.start();
8385
} catch (URISyntaxException e) {

0 commit comments

Comments
 (0)