Skip to content

Commit

Permalink
Name recordings with timestamp
Browse files Browse the repository at this point in the history
This has more meaning than a serial number and matches the pattern for
photos and videos.
  • Loading branch information
gaul committed Jun 30, 2016
1 parent 69efeaa commit 019c746
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.Timer;
import java.util.TimerTask;
Expand All @@ -41,6 +42,7 @@ public class RecordingService extends Service {
private int mElapsedSeconds = 0;
private OnTimerChangedListener onTimerChangedListener = null;
private static final SimpleDateFormat mTimerFormat = new SimpleDateFormat("mm:ss", Locale.getDefault());
private static final SimpleDateFormat mFileFormat = new SimpleDateFormat("yyyy-MM-dd kk.mm.ss", Locale.getDefault());

private Timer mTimer = null;
private TimerTask mIncrementTimerTask = null;
Expand Down Expand Up @@ -99,14 +101,10 @@ public void startRecording() {
}

public void setFileNameAndPath(){
int count = 0;
File f;

do{
count++;

mFileName = getString(R.string.default_file_name)
+ " #" + (mDatabase.getCount() + count) + ".mp4";
mFileName = mFileFormat.format(new Date()) + ".mp4";
mFilePath = Environment.getExternalStorageDirectory().getAbsolutePath();
mFilePath += "/SoundRecorder/" + mFileName;

Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-cs/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
<string name="no_saved_recordings_message">Žádné uložené nahrávky</string>
<string name="pause_recording_button">Pauza</string>
<string name="resume_recording_button">Pokračovat</string>
<string name="default_file_name">Můj záznam</string>
<string name="record_prompt">Klepněte na tlačítko pro spuštění nahrávání</string>
<string name="record_in_progress">Záznam</string>

Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
<string name="no_saved_recordings_message">Keine gespeicherten Aufnahmen</string>
<string name="pause_recording_button">Pause</string>
<string name="resume_recording_button">Fortfahren</string>
<string name="default_file_name">Meine Aufzeichnung</string>
<string name="record_prompt">Berühre den Button, um die Aufzeichnung zu starten</string>
<string name="record_in_progress">Nehme auf</string>

Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-eo/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
<string name="no_saved_recordings_message">Neniu konservataj registraĵoj</string>
<string name="pause_recording_button">Paŭzigi</string>
<string name="resume_recording_button">Daŭrigi</string>
<string name="default_file_name">Miaj registraĵoj</string>
<string name="record_prompt">Premi la butonon por ekregistri</string>
<string name="record_in_progress">Registrado</string>

Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
<string name="no_saved_recordings_message">Sin grabaciones guardadas</string>
<string name="pause_recording_button">Pausar</string>
<string name="resume_recording_button">Continuar</string>
<string name="default_file_name">Mi grabación</string>
<string name="record_prompt">Pulse el botón para iniciar la grabación</string>
<string name="record_in_progress">Grabando</string>

Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-fi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
<string name="no_saved_recordings_message">Ei tallennettuja äänityksiä</string>
<string name="pause_recording_button">Tauko</string>
<string name="resume_recording_button">Jatka</string>
<string name="default_file_name">Äänitykseni</string>
<string name="record_prompt">Napauta painiketta aloittaaksesi äänittämisen</string>
<string name="record_in_progress">Äänitetään</string>

Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
<string name="no_saved_recordings_message">Aucun enregistrement</string>
<string name="pause_recording_button">Pause</string>
<string name="resume_recording_button">Reprendre</string>
<string name="default_file_name">Enregistrement</string>
<string name="record_prompt">Appuyez sur le bouton pour démarrer l\'enregistrement</string>
<string name="record_in_progress">Enregistrement en cours</string>

Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-he/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
<string name="no_saved_recordings_message">אין הקלטות שמורות</string>
<string name="pause_recording_button">השהה</string>
<string name="resume_recording_button">חזור</string>
<string name="default_file_name">הקלטה</string>
<string name="record_prompt">הקש על הכפתור כדי להקליט</string>
<string name="record_in_progress">כעת מקליט</string>

Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
<string name="no_saved_recordings_message">Nessuna registrazione salvata</string>
<string name="pause_recording_button">Pausa</string>
<string name="resume_recording_button">Riprendi</string>
<string name="default_file_name">Le mie registrazioni</string>
<string name="record_prompt">Premi il bottone per iniziare a registrare</string>
<string name="record_in_progress">Registrazione in corso</string>

Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<string name="no_saved_recordings_message">Нет сохраненных записей</string>
<string name="pause_recording_button">Пауза</string>
<string name="resume_recording_button">Продолжить</string>
<string name="default_file_name">Запись</string>
<string name="record_prompt">Нажмите на кнопку, чтобы начать запись</string>
<string name="record_in_progress">Запись</string>
<string name="action_settings">Настройки</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
<string name="no_saved_recordings_message">No saved recordings</string>
<string name="pause_recording_button">Pause</string>
<string name="resume_recording_button">Resume</string>
<string name="default_file_name">My Recording</string>
<string name="record_prompt">Tap the button to start recording</string>
<string name="record_in_progress">Recording</string>

Expand Down

0 comments on commit 019c746

Please sign in to comment.