summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2011-03-11 15:45:22 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2011-03-11 15:45:22 +0000
commitfe6faf2e2c6e410f8b96ee470cf0ce21f745f56d (patch)
treeb52ac243c593f4f89552890119bd61d0bd627c5b /android
parent8196f21a9486783943f9d2f81dbf4eaa1c82df32 (diff)
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
Diffstat (limited to 'android')
-rw-r--r--android/res/values-aa/strings.xml4
-rw-r--r--android/res/values-ar/strings.xml4
-rw-r--r--android/res/values-bg/strings.xml4
-rw-r--r--android/res/values-br/strings.xml4
-rw-r--r--android/res/values-ca/strings.xml4
-rw-r--r--android/res/values-ch-rVS/strings.xml4
-rw-r--r--android/res/values-cs/strings.xml4
-rw-r--r--android/res/values-da/strings.xml4
-rw-r--r--android/res/values-de/strings.xml4
-rw-r--r--android/res/values-el/strings.xml4
-rw-r--r--android/res/values-eo/strings.xml4
-rw-r--r--android/res/values-es/strings.xml4
-rw-r--r--android/res/values-et/strings.xml4
-rw-r--r--android/res/values-fi/strings.xml4
-rw-r--r--android/res/values-fr/strings.xml4
-rw-r--r--android/res/values-gl/strings.xml4
-rw-r--r--android/res/values-he/strings.xml4
-rw-r--r--android/res/values-hi/strings.xml4
-rw-r--r--android/res/values-hr/strings.xml4
-rw-r--r--android/res/values-hu/strings.xml4
-rw-r--r--android/res/values-is/strings.xml4
-rw-r--r--android/res/values-it/strings.xml4
-rw-r--r--android/res/values-ja/strings.xml4
-rw-r--r--android/res/values-ko/strings.xml4
-rw-r--r--android/res/values-lt/strings.xml4
-rw-r--r--android/res/values-nl/strings.xml4
-rw-r--r--android/res/values-nn/strings.xml4
-rw-r--r--android/res/values-no/strings.xml4
-rw-r--r--android/res/values-pl/strings.xml4
-rw-r--r--android/res/values-pt/strings.xml4
-rw-r--r--android/res/values-ro/strings.xml4
-rw-r--r--android/res/values-ru/strings.xml4
-rw-r--r--android/res/values-sk/strings.xml4
-rw-r--r--android/res/values-sl/strings.xml4
-rw-r--r--android/res/values-sr/strings.xml4
-rw-r--r--android/res/values-sv/strings.xml4
-rw-r--r--android/res/values-th/strings.xml4
-rw-r--r--android/res/values-tl/strings.xml4
-rw-r--r--android/res/values-tr/strings.xml4
-rw-r--r--android/res/values-uk/strings.xml4
-rw-r--r--android/res/values-wa/strings.xml4
-rw-r--r--android/res/values-zh-rCN/strings.xml4
-rw-r--r--android/res/values-zh-rTW/strings.xml4
-rw-r--r--android/res/values/strings.xml3
-rw-r--r--android/src/org/rockbox/RockboxService.java23
45 files changed, 198 insertions, 0 deletions
diff --git a/android/res/values-aa/strings.xml b/android/res/values-aa/strings.xml
new file mode 100644
index 0000000000..314c00f03b
--- /dev/null
+++ b/android/res/values-aa/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">afrikaans.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-ar/strings.xml b/android/res/values-ar/strings.xml
new file mode 100644
index 0000000000..04af168476
--- /dev/null
+++ b/android/res/values-ar/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">arabic.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-bg/strings.xml b/android/res/values-bg/strings.xml
new file mode 100644
index 0000000000..ae515eaa36
--- /dev/null
+++ b/android/res/values-bg/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">bulgarian.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-br/strings.xml b/android/res/values-br/strings.xml
new file mode 100644
index 0000000000..285c510c33
--- /dev/null
+++ b/android/res/values-br/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">portugues-brasileiro.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-ca/strings.xml b/android/res/values-ca/strings.xml
new file mode 100644
index 0000000000..5de38c17b7
--- /dev/null
+++ b/android/res/values-ca/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">catala.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-ch-rVS/strings.xml b/android/res/values-ch-rVS/strings.xml
new file mode 100644
index 0000000000..a520c52071
--- /dev/null
+++ b/android/res/values-ch-rVS/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">wallisertitsch.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-cs/strings.xml b/android/res/values-cs/strings.xml
new file mode 100644
index 0000000000..5a949e597b
--- /dev/null
+++ b/android/res/values-cs/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">czech.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-da/strings.xml b/android/res/values-da/strings.xml
new file mode 100644
index 0000000000..71b29abc69
--- /dev/null
+++ b/android/res/values-da/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">dansk.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-de/strings.xml b/android/res/values-de/strings.xml
new file mode 100644
index 0000000000..9a2a7be4d8
--- /dev/null
+++ b/android/res/values-de/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">deutsch.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-el/strings.xml b/android/res/values-el/strings.xml
new file mode 100644
index 0000000000..6850726fa9
--- /dev/null
+++ b/android/res/values-el/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">greek.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-eo/strings.xml b/android/res/values-eo/strings.xml
new file mode 100644
index 0000000000..464c7f482c
--- /dev/null
+++ b/android/res/values-eo/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">esperanto.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-es/strings.xml b/android/res/values-es/strings.xml
new file mode 100644
index 0000000000..04d6ece261
--- /dev/null
+++ b/android/res/values-es/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">espanol.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-et/strings.xml b/android/res/values-et/strings.xml
new file mode 100644
index 0000000000..fa9092c91b
--- /dev/null
+++ b/android/res/values-et/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">eesti.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-fi/strings.xml b/android/res/values-fi/strings.xml
new file mode 100644
index 0000000000..af426f7ca2
--- /dev/null
+++ b/android/res/values-fi/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">finnish.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-fr/strings.xml b/android/res/values-fr/strings.xml
new file mode 100644
index 0000000000..8b448b23a5
--- /dev/null
+++ b/android/res/values-fr/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">francais.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-gl/strings.xml b/android/res/values-gl/strings.xml
new file mode 100644
index 0000000000..e77adbf271
--- /dev/null
+++ b/android/res/values-gl/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">galego.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-he/strings.xml b/android/res/values-he/strings.xml
new file mode 100644
index 0000000000..675de06090
--- /dev/null
+++ b/android/res/values-he/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">hebrew.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-hi/strings.xml b/android/res/values-hi/strings.xml
new file mode 100644
index 0000000000..6e3abd14ea
--- /dev/null
+++ b/android/res/values-hi/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">hindi.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-hr/strings.xml b/android/res/values-hr/strings.xml
new file mode 100644
index 0000000000..ea93afa2c0
--- /dev/null
+++ b/android/res/values-hr/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">hrvatski.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-hu/strings.xml b/android/res/values-hu/strings.xml
new file mode 100644
index 0000000000..6b9d88c078
--- /dev/null
+++ b/android/res/values-hu/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">magyar.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-is/strings.xml b/android/res/values-is/strings.xml
new file mode 100644
index 0000000000..363c192ad0
--- /dev/null
+++ b/android/res/values-is/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">islenska.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-it/strings.xml b/android/res/values-it/strings.xml
new file mode 100644
index 0000000000..60fef119f0
--- /dev/null
+++ b/android/res/values-it/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">italiano.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-ja/strings.xml b/android/res/values-ja/strings.xml
new file mode 100644
index 0000000000..051ba60275
--- /dev/null
+++ b/android/res/values-ja/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">japanese.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-ko/strings.xml b/android/res/values-ko/strings.xml
new file mode 100644
index 0000000000..7ae1fd1c26
--- /dev/null
+++ b/android/res/values-ko/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">korean.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-lt/strings.xml b/android/res/values-lt/strings.xml
new file mode 100644
index 0000000000..568aaf2360
--- /dev/null
+++ b/android/res/values-lt/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">lietuviu.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-nl/strings.xml b/android/res/values-nl/strings.xml
new file mode 100644
index 0000000000..c5c88d5c83
--- /dev/null
+++ b/android/res/values-nl/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+<string name="rockbox_language_file">nederlands.lng</string>
+</resources>
diff --git a/android/res/values-nn/strings.xml b/android/res/values-nn/strings.xml
new file mode 100644
index 0000000000..38390decf8
--- /dev/null
+++ b/android/res/values-nn/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">norsk-nynorsk.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-no/strings.xml b/android/res/values-no/strings.xml
new file mode 100644
index 0000000000..fa5adabbda
--- /dev/null
+++ b/android/res/values-no/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">norsk.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-pl/strings.xml b/android/res/values-pl/strings.xml
new file mode 100644
index 0000000000..c06a5aaf4d
--- /dev/null
+++ b/android/res/values-pl/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">polski.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-pt/strings.xml b/android/res/values-pt/strings.xml
new file mode 100644
index 0000000000..345e9ae593
--- /dev/null
+++ b/android/res/values-pt/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">portugues.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-ro/strings.xml b/android/res/values-ro/strings.xml
new file mode 100644
index 0000000000..48a6ebe6c2
--- /dev/null
+++ b/android/res/values-ro/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">romaneste.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-ru/strings.xml b/android/res/values-ru/strings.xml
new file mode 100644
index 0000000000..5b8dcd6c05
--- /dev/null
+++ b/android/res/values-ru/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">russian.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-sk/strings.xml b/android/res/values-sk/strings.xml
new file mode 100644
index 0000000000..c0aea1cefe
--- /dev/null
+++ b/android/res/values-sk/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">slovak.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-sl/strings.xml b/android/res/values-sl/strings.xml
new file mode 100644
index 0000000000..471acf31b7
--- /dev/null
+++ b/android/res/values-sl/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">slovenscina.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-sr/strings.xml b/android/res/values-sr/strings.xml
new file mode 100644
index 0000000000..6c000a8703
--- /dev/null
+++ b/android/res/values-sr/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">srpski.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-sv/strings.xml b/android/res/values-sv/strings.xml
new file mode 100644
index 0000000000..fa3687130d
--- /dev/null
+++ b/android/res/values-sv/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">svenska.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-th/strings.xml b/android/res/values-th/strings.xml
new file mode 100644
index 0000000000..f0d2670e4b
--- /dev/null
+++ b/android/res/values-th/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">thai.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-tl/strings.xml b/android/res/values-tl/strings.xml
new file mode 100644
index 0000000000..4c53400336
--- /dev/null
+++ b/android/res/values-tl/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">tagalog.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-tr/strings.xml b/android/res/values-tr/strings.xml
new file mode 100644
index 0000000000..f5a656a1ea
--- /dev/null
+++ b/android/res/values-tr/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">turkce.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-uk/strings.xml b/android/res/values-uk/strings.xml
new file mode 100644
index 0000000000..6ba7324651
--- /dev/null
+++ b/android/res/values-uk/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">ukrainian.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-wa/strings.xml b/android/res/values-wa/strings.xml
new file mode 100644
index 0000000000..24212670e2
--- /dev/null
+++ b/android/res/values-wa/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">walon.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-zh-rCN/strings.xml b/android/res/values-zh-rCN/strings.xml
new file mode 100644
index 0000000000..7bc6d06de5
--- /dev/null
+++ b/android/res/values-zh-rCN/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">chinese-simp.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values-zh-rTW/strings.xml b/android/res/values-zh-rTW/strings.xml
new file mode 100644
index 0000000000..f6981b410e
--- /dev/null
+++ b/android/res/values-zh-rTW/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="rockbox_language_file">chinese-trad.lng</string>
+</resources> \ No newline at end of file
diff --git a/android/res/values/strings.xml b/android/res/values/strings.xml
index c92e955edf..615e3d1ebf 100644
--- a/android/res/values/strings.xml
+++ b/android/res/values/strings.xml
@@ -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>
diff --git a/android/src/org/rockbox/RockboxService.java b/android/src/org/rockbox/RockboxService.java
index fb7c0437fc..c474044c0b 100644
--- a/android/src/org/rockbox/RockboxService.java
+++ b/android/src/org/rockbox/RockboxService.java
@@ -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);