OSDN Git Service

add mk files and source code
[splhack/AndroidRuby.git] / appirb / src / org / splhack / android / irbapp / LibRuby.java
1 package org.splhack.android.irbapp;
2
3 import android.widget.TextView;
4 import android.widget.ScrollView;
5 import android.text.Layout;
6 import android.util.Log;
7
8 public final class LibRuby {
9         TextView mTextView;
10
11         static {
12                 System.loadLibrary("ruby_jni");
13         }
14
15         LibRuby(TextView textView) {
16                 mTextView = textView;
17                 init();
18         }
19         synchronized void out(String str) {
20                 mTextView.append(str.subSequence(0, str.length()));
21                 ScrollView scrollView = (ScrollView)mTextView.getParent();
22                 scrollView.scrollTo(0, mTextView.getHeight());
23         }
24
25         native void init();
26         native void eval(String str);
27 }