summaryrefslogtreecommitdiffstats
path: root/picolanginstaller
diff options
context:
space:
mode:
Diffstat (limited to 'picolanginstaller')
-rwxr-xr-xpicolanginstaller/res/raw/svoxlangpack.zipbin4348562 -> 4348442 bytes
-rwxr-xr-xpicolanginstaller/src/com/svox/langpack/installer/InstallerActivity.java22
2 files changed, 18 insertions, 4 deletions
diff --git a/picolanginstaller/res/raw/svoxlangpack.zip b/picolanginstaller/res/raw/svoxlangpack.zip
index 46f00e2..18b042f 100755
--- a/picolanginstaller/res/raw/svoxlangpack.zip
+++ b/picolanginstaller/res/raw/svoxlangpack.zip
Binary files differ
diff --git a/picolanginstaller/src/com/svox/langpack/installer/InstallerActivity.java b/picolanginstaller/src/com/svox/langpack/installer/InstallerActivity.java
index a2f0739..5c85afe 100755
--- a/picolanginstaller/src/com/svox/langpack/installer/InstallerActivity.java
+++ b/picolanginstaller/src/com/svox/langpack/installer/InstallerActivity.java
@@ -13,20 +13,34 @@ import android.content.res.AssetFileDescriptor;
import android.content.res.Resources;
import android.net.Uri;
import android.os.Bundle;
+import android.speech.tts.TextToSpeech;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class InstallerActivity extends Activity {
+ private static final int DATA_ROOT_DIRECTORY_REQUEST_CODE = 42;
+ private String rootDirectory = "";
+
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ Intent getRootDirectoryIntent = new Intent();
+ getRootDirectoryIntent.setClassName("com.svox.pico", "com.svox.pico.CheckVoiceData");
+ startActivityForResult(getRootDirectoryIntent, DATA_ROOT_DIRECTORY_REQUEST_CODE);
+ }
- runInstaller();
+ @Override
+ public void onActivityResult(int requestCode, int resultCode, Intent data){
+ super.onActivityResult(requestCode, resultCode, data);
+ if (requestCode == DATA_ROOT_DIRECTORY_REQUEST_CODE) {
+ rootDirectory = data.getStringExtra(TextToSpeech.Engine.VOICE_DATA_ROOT_DIRECTORY);
+ runInstaller();
+ }
}
-
+
private void runInstaller(){
try {
Resources res = getResources();
@@ -58,11 +72,11 @@ public class InstallerActivity extends Activity {
ZipEntry entry = zis.getNextEntry();
while (entry != null) {
if (entry.isDirectory()) {
- File newDir = new File("/sdcard/" + entry.getName());
+ File newDir = new File(rootDirectory + entry.getName());
newDir.mkdir();
} else {
String name = entry.getName();
- File outputFile = new File("/sdcard/" + name);
+ File outputFile = new File(rootDirectory + name);
String outputPath = outputFile.getCanonicalPath();
name = outputPath
.substring(outputPath.lastIndexOf("/") + 1);