Android port: generate initial config when none is present with dynamically
generated values depending on your environment. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29560 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
8196f21a94
commit
fe6faf2e2c
45 changed files with 198 additions and 0 deletions
4
android/res/values-aa/strings.xml
Normal file
4
android/res/values-aa/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">afrikaans.lng</string>
|
||||
</resources>
|
4
android/res/values-ar/strings.xml
Normal file
4
android/res/values-ar/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">arabic.lng</string>
|
||||
</resources>
|
4
android/res/values-bg/strings.xml
Normal file
4
android/res/values-bg/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">bulgarian.lng</string>
|
||||
</resources>
|
4
android/res/values-br/strings.xml
Normal file
4
android/res/values-br/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">portugues-brasileiro.lng</string>
|
||||
</resources>
|
4
android/res/values-ca/strings.xml
Normal file
4
android/res/values-ca/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">catala.lng</string>
|
||||
</resources>
|
4
android/res/values-ch-rVS/strings.xml
Normal file
4
android/res/values-ch-rVS/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">wallisertitsch.lng</string>
|
||||
</resources>
|
4
android/res/values-cs/strings.xml
Normal file
4
android/res/values-cs/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">czech.lng</string>
|
||||
</resources>
|
4
android/res/values-da/strings.xml
Normal file
4
android/res/values-da/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">dansk.lng</string>
|
||||
</resources>
|
4
android/res/values-de/strings.xml
Normal file
4
android/res/values-de/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">deutsch.lng</string>
|
||||
</resources>
|
4
android/res/values-el/strings.xml
Normal file
4
android/res/values-el/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">greek.lng</string>
|
||||
</resources>
|
4
android/res/values-eo/strings.xml
Normal file
4
android/res/values-eo/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">esperanto.lng</string>
|
||||
</resources>
|
4
android/res/values-es/strings.xml
Normal file
4
android/res/values-es/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">espanol.lng</string>
|
||||
</resources>
|
4
android/res/values-et/strings.xml
Normal file
4
android/res/values-et/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">eesti.lng</string>
|
||||
</resources>
|
4
android/res/values-fi/strings.xml
Normal file
4
android/res/values-fi/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">finnish.lng</string>
|
||||
</resources>
|
4
android/res/values-fr/strings.xml
Normal file
4
android/res/values-fr/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">francais.lng</string>
|
||||
</resources>
|
4
android/res/values-gl/strings.xml
Normal file
4
android/res/values-gl/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">galego.lng</string>
|
||||
</resources>
|
4
android/res/values-he/strings.xml
Normal file
4
android/res/values-he/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">hebrew.lng</string>
|
||||
</resources>
|
4
android/res/values-hi/strings.xml
Normal file
4
android/res/values-hi/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">hindi.lng</string>
|
||||
</resources>
|
4
android/res/values-hr/strings.xml
Normal file
4
android/res/values-hr/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">hrvatski.lng</string>
|
||||
</resources>
|
4
android/res/values-hu/strings.xml
Normal file
4
android/res/values-hu/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">magyar.lng</string>
|
||||
</resources>
|
4
android/res/values-is/strings.xml
Normal file
4
android/res/values-is/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">islenska.lng</string>
|
||||
</resources>
|
4
android/res/values-it/strings.xml
Normal file
4
android/res/values-it/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">italiano.lng</string>
|
||||
</resources>
|
4
android/res/values-ja/strings.xml
Normal file
4
android/res/values-ja/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">japanese.lng</string>
|
||||
</resources>
|
4
android/res/values-ko/strings.xml
Normal file
4
android/res/values-ko/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">korean.lng</string>
|
||||
</resources>
|
4
android/res/values-lt/strings.xml
Normal file
4
android/res/values-lt/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">lietuviu.lng</string>
|
||||
</resources>
|
4
android/res/values-nl/strings.xml
Normal file
4
android/res/values-nl/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">nederlands.lng</string>
|
||||
</resources>
|
4
android/res/values-nn/strings.xml
Normal file
4
android/res/values-nn/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">norsk-nynorsk.lng</string>
|
||||
</resources>
|
4
android/res/values-no/strings.xml
Normal file
4
android/res/values-no/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">norsk.lng</string>
|
||||
</resources>
|
4
android/res/values-pl/strings.xml
Normal file
4
android/res/values-pl/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">polski.lng</string>
|
||||
</resources>
|
4
android/res/values-pt/strings.xml
Normal file
4
android/res/values-pt/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">portugues.lng</string>
|
||||
</resources>
|
4
android/res/values-ro/strings.xml
Normal file
4
android/res/values-ro/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">romaneste.lng</string>
|
||||
</resources>
|
4
android/res/values-ru/strings.xml
Normal file
4
android/res/values-ru/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">russian.lng</string>
|
||||
</resources>
|
4
android/res/values-sk/strings.xml
Normal file
4
android/res/values-sk/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">slovak.lng</string>
|
||||
</resources>
|
4
android/res/values-sl/strings.xml
Normal file
4
android/res/values-sl/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">slovenscina.lng</string>
|
||||
</resources>
|
4
android/res/values-sr/strings.xml
Normal file
4
android/res/values-sr/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">srpski.lng</string>
|
||||
</resources>
|
4
android/res/values-sv/strings.xml
Normal file
4
android/res/values-sv/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">svenska.lng</string>
|
||||
</resources>
|
4
android/res/values-th/strings.xml
Normal file
4
android/res/values-th/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">thai.lng</string>
|
||||
</resources>
|
4
android/res/values-tl/strings.xml
Normal file
4
android/res/values-tl/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">tagalog.lng</string>
|
||||
</resources>
|
4
android/res/values-tr/strings.xml
Normal file
4
android/res/values-tr/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">turkce.lng</string>
|
||||
</resources>
|
4
android/res/values-uk/strings.xml
Normal file
4
android/res/values-uk/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">ukrainian.lng</string>
|
||||
</resources>
|
4
android/res/values-wa/strings.xml
Normal file
4
android/res/values-wa/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">walon.lng</string>
|
||||
</resources>
|
4
android/res/values-zh-rCN/strings.xml
Normal file
4
android/res/values-zh-rCN/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">chinese-simp.lng</string>
|
||||
</resources>
|
4
android/res/values-zh-rTW/strings.xml
Normal file
4
android/res/values-zh-rTW/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rockbox_language_file">chinese-trad.lng</string>
|
||||
</resources>
|
|
@ -11,6 +11,9 @@
|
|||
<string name="error_extraction">Error occured during extraction!</string>
|
||||
<string name="rockbox_extracting">Rockbox is loading. Please wait...</string>
|
||||
|
||||
<!-- Rockbox initial configuration values -->
|
||||
<string name="rockbox_language_file">english.lng</string>
|
||||
|
||||
<!-- Widget -->
|
||||
<string name="appwidget_label_4x1">Rockbox (line)</string>
|
||||
<string name="appwidget_label_2x2">Rockbox (square)</string>
|
||||
|
|
|
@ -24,7 +24,9 @@ package org.rockbox;
|
|||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
@ -41,6 +43,7 @@ import android.content.Context;
|
|||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.os.IBinder;
|
||||
import android.os.ResultReceiver;
|
||||
import android.util.Log;
|
||||
|
@ -245,6 +248,26 @@ public class RockboxService extends Service
|
|||
}
|
||||
}
|
||||
|
||||
/* Generate default config if none exists yet */
|
||||
File rockboxConfig = new File(Environment.getExternalStorageDirectory(), "rockbox/config.cfg");
|
||||
if (!rockboxConfig.exists()) {
|
||||
File rbDir = new File(rockboxConfig.getParent());
|
||||
if (!rbDir.exists())
|
||||
rbDir.mkdirs();
|
||||
|
||||
OutputStreamWriter strm;
|
||||
try {
|
||||
strm = new OutputStreamWriter(new FileOutputStream(rockboxConfig));
|
||||
strm.write("# config generated by RockboxService\n");
|
||||
strm.write("start directory: " + Environment.getExternalStorageDirectory().getAbsolutePath() + "/" + "\n");
|
||||
strm.write("lang: /.rockbox/langs/" + getString(R.string.rockbox_language_file) + "\n");
|
||||
strm.close();
|
||||
} catch(Exception e) {
|
||||
LOG("Exception when writing default config", e);
|
||||
}
|
||||
}
|
||||
|
||||
/* Start native code */
|
||||
if (resultReceiver != null)
|
||||
resultReceiver.send(RESULT_INVOKING_MAIN, null);
|
||||
|
||||
|
|
Loading…
Reference in a new issue