summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/android/terminal/Terminal.java36
-rw-r--r--src/com/android/terminal/TerminalActivity.java33
2 files changed, 69 insertions, 0 deletions
diff --git a/src/com/android/terminal/Terminal.java b/src/com/android/terminal/Terminal.java
new file mode 100644
index 0000000..8b1809c
--- /dev/null
+++ b/src/com/android/terminal/Terminal.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.terminal;
+
+public class Terminal {
+ static {
+ System.loadLibrary("jni_terminal");
+ }
+
+ private final int mNativePtr;
+
+ public Terminal() {
+ mNativePtr = nativeInit(25, 80);
+ }
+
+ public int getRows() {
+ return nativeGetRows(mNativePtr);
+ }
+
+ private static native int nativeInit(int rows, int cols);
+ private static native int nativeGetRows(int ptr);
+}
diff --git a/src/com/android/terminal/TerminalActivity.java b/src/com/android/terminal/TerminalActivity.java
new file mode 100644
index 0000000..0bb73ff
--- /dev/null
+++ b/src/com/android/terminal/TerminalActivity.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.terminal;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.util.Log;
+
+public class TerminalActivity extends Activity {
+ private static final String TAG = "Terminal";
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ Terminal t = new Terminal();
+ Log.d(TAG, "Rows: " + t.getRows());
+ }
+}