This repository has been archived by the owner on Jun 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
155 additions
and
28 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// The authors disclaim copyright to this source code | ||
|
||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
|
||
char *cb(const char *id, const char *event, const char *err, const char *data) { | ||
char *ret; | ||
ret = ""; | ||
if (!strcmp(id, "long")) { | ||
ret = "vibrate:50;add:-;"; | ||
} else if (!strcmp(id, "short")) { | ||
ret = "vibrate:30;add:.;"; | ||
} else if (!strcmp(id, "menu")) { | ||
ret = "add: ;"; | ||
} | ||
return ret; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,25 @@ | ||
// The authors disclaim copyright to this source code | ||
|
||
#include <jni.h> | ||
#include <string> | ||
#include <string.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
extern char *cb(const char *id, const char *event, const char *err, const char *data); | ||
|
||
extern "C" JNIEXPORT jstring JNICALL | ||
Java_com_cod5_deafblind_MainActivity_stringFromJNI( | ||
JNIEXPORT jstring JNICALL | ||
Java_com_cod5_deafblind_MainActivity_cbToJNI( | ||
JNIEnv* env, | ||
jobject /* this */) { | ||
std::string hello = "Hello from C++"; | ||
return env->NewStringUTF(hello.c_str()); | ||
} | ||
jobject self, jstring id, jstring event, jstring err, jstring data) { | ||
const char *a, *b, *c, *d; | ||
a = env->GetStringUTFChars(id, 0); | ||
b = env->GetStringUTFChars(event, 0); | ||
c = env->GetStringUTFChars(err, 0); | ||
d = env->GetStringUTFChars(data, 0); | ||
return env->NewStringUTF(cb(a, b, c, d)); | ||
} | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<!-- The authors disclaim copyright to this source code --> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Deaf - Blind</title> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
<body> | ||
<h1>e-mail by Morse</h1> | ||
<div id="txt" style="word-wrap: break-word;white-space: pre-wrap;width:100%; max-width:100%; height:240px; max-height:240px;"></div> | ||
<div style="position:fixed;bottom:0px;width:100%;text-align:center;" | ||
><button style="width:33%; height:200px;" id="short" onclick="cb(this.id, window.event.type, 0, 0)">.</button | ||
><button style="width:33%; height:200px;" id="menu" onclick="cb(this.id, window.event.type, 0, 0)">[ ]</button | ||
><button style="width:33%; height:200px;" id="long" onclick="cb(this.id, window.event.type, 0, 0)">_</button | ||
></div> | ||
<script src="script.js" ></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// The authors disclaim copyright to this source code | ||
|
||
|
||
function cb(id, event, err, data) { | ||
let d = document.getElementById("txt"); | ||
|
||
let r = window.Android.cb(id, event, err, data); | ||
if (r.startsWith("add:")) { | ||
d.innerText = d.innerText + r.substr(4, r.indexOf(';') - 4); | ||
} | ||
console.log(r); | ||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* The authors disclaim copyright to this source code */ | ||
|
||
body {margin: 0px; padding: 0px;} | ||
button {display:inline-block;} |