This file contains hidden or 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
while ((audioTrack.getPlaybackHeadPosition() < duration * sampleRate)) { | |
try { | |
Thread.sleep(50 /*milliseconds*/); | |
} catch (InterruptedException e) { | |
} | |
} |
This file contains hidden or 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
/** | |
* 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 |
This file contains hidden or 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
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 = ... |
This file contains hidden or 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
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"); |
This file contains hidden or 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
Welcome to Scala version 2.9.1.r0-b20120125223512 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_02). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> trait A | |
defined trait A | |
scala> trait C extends A | |
defined trait C |
NewerOlder