-
Notifications
You must be signed in to change notification settings - Fork 243
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
1 parent
2a78825
commit d6a3c12
Showing
3 changed files
with
69 additions
and
68 deletions.
There are no files selected for viewing
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
66 changes: 0 additions & 66 deletions
66
app/src/main/java/com/aykuttasil/callrecorder/MainActivity.java
This file was deleted.
Oops, something went wrong.
66 changes: 66 additions & 0 deletions
66
app/src/main/java/com/aykuttasil/callrecorder/MainActivity.kt
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,66 @@ | ||
package com.aykuttasil.callrecorder | ||
|
||
import android.media.MediaRecorder | ||
import android.os.Bundle | ||
import android.view.View | ||
|
||
import com.aykuttasil.callrecord.CallRecord | ||
import com.aykuttasil.callrecord.helper.LogUtils | ||
|
||
import androidx.appcompat.app.AppCompatActivity | ||
|
||
class MainActivity : AppCompatActivity() { | ||
|
||
companion object { | ||
private val TAG = MainActivity::class.java.simpleName | ||
} | ||
|
||
private lateinit var callRecord: CallRecord | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_main) | ||
//callRecord = CallRecord.init(this); | ||
callRecord = CallRecord.Builder(this) | ||
.setLogEnable(true) | ||
.setRecordFileName("CallRecorderTestFile") | ||
.setRecordDirName("CallRecorderTest") | ||
.setAudioSource(MediaRecorder.AudioSource.VOICE_COMMUNICATION) | ||
.setShowSeed(true) | ||
.build() | ||
|
||
//callRecord.changeReceiver(new MyCallRecordReceiver(callRecord)); | ||
|
||
//callRecord.enableSaveFile(); | ||
|
||
/* | ||
callRecord = new CallRecord.Builder(this) | ||
.setRecordFileName("Record_" + new SimpleDateFormat("ddMMyyyyHHmmss", Locale.US).format(new Date())) | ||
.setRecordDirName("CallRecord") | ||
.setRecordDirPath(Environment.getExternalStorageDirectory().getPath()) | ||
.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB) | ||
.setOutputFormat(MediaRecorder.OutputFormat.AMR_NB) | ||
.setAudioSource(MediaRecorder.AudioSource.VOICE_COMMUNICATION) | ||
.setShowSeed(true) | ||
.buildService(); | ||
callRecord.startCallRecordService(); | ||
*/ | ||
} | ||
|
||
fun StartCallRecordClick(view: View) { | ||
LogUtils.i(TAG, "StartCallRecordClick") | ||
callRecord.startCallReceiver() | ||
|
||
//callRecord.enableSaveFile(); | ||
//callRecord.changeRecordDirName("NewDirName"); | ||
} | ||
|
||
fun StopCallRecordClick(view: View) { | ||
LogUtils.i(TAG, "StopCallRecordClick") | ||
callRecord.stopCallReceiver() | ||
|
||
//callRecord.disableSaveFile(); | ||
//callRecord.changeRecordFileName("NewFileName"); | ||
} | ||
} |