Skip to content

Instantly share code, notes, and snippets.

View misto's full-sized avatar

Mirko Stocker misto

  • OST – Ostschweizer Fachhochschule
  • Switzerland
View GitHub Profile
/**
* Für die Erzeugung der Töne brauchen wir zwei Parameter: die Länge eines
* Tons sowie die Sampling Rate, also die Abtastrate, mit der wir die Töne
* erstellen: http://en.wikipedia.org/wiki/Sampling_rate
*/
private final int duration = 1; // seconds
private final int sampleRate = 8000;
/**
* Erstellt einen Byte-Array mit den Soundinformationen die wir für das
while ((audioTrack.getPlaybackHeadPosition() < duration * sampleRate)) {
try {
Thread.sleep(50 /*milliseconds*/);
} catch (InterruptedException e) {
}
}
private void log(String qrCode) {
Intent intent = new Intent("ch.appquest.intent.LOG");
if (getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY).isEmpty()) {
Toast.makeText(this, "Logbook App not Installed", Toast.LENGTH_LONG).show();
return;
}
// Achtung, je nach App wird etwas anderes eingetragen
String logmessage = ...
private static final int SCAN_QR_CODE_REQUEST_CODE = 0;
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuItem menuItem = menu.add("Log");
menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
Intent intent = new Intent("com.google.zxing.client.android.SCAN");

Keybase proof

I hereby claim:

  • I am misto on github.
  • I am misto (https://keybase.io/misto) on keybase.
  • I have a public key whose fingerprint is 5D1F E697 A21D F974 76B7 B8A2 8201 C199 A362 981A

To claim this, I am signing this object: