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
import android.os.Build | |
import android.security.keystore.KeyGenParameterSpec | |
import android.security.keystore.KeyProperties | |
import androidx.annotation.RequiresApi | |
import com.paylican.invoice.models.CipherTextWrapper | |
import java.lang.Exception | |
import java.security.KeyStore | |
import javax.crypto.Cipher | |
import javax.crypto.KeyGenerator |
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
fun demonstrate() { | |
val commonResource = CommonResource() | |
val locker = ReentrantLock() | |
for (i in 1..5) { | |
val t = Thread(CountThread(commonResource, locker)) | |
t.name = "Thread $i" | |
t.start() | |
} | |
} |
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
timer = Timer() | |
timer?.schedule(object : TimerTask() { | |
override fun run() { | |
val currentMaxAmplitude = recorder?.maxAmplitude | |
audioRecordView.update(currentMaxAmplitude); //redraw view | |
} | |
}, 0, 100) |
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
<com.visualizer.amplitude.AudioRecordView | |
android:id="@+id/audioRecordView" | |
android:layout_width="256dp" | |
android:layout_height="64dp" | |
app:chunkAlignTo="bottom" | |
app:chunkRoundedCorners="true" | |
app:chunkSoftTransition="true" | |
app:chunkColor="#2196F3" | |
app:chunkSpace="1dp" | |
app:chunkWidth="2dp" |
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
private lateinit var audioRecordView: AudioRecordView | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
audioRecordView = findViewById(R.id.audioRecordView) | |
} |