# HG changeset patch
# User Xeli
# Date 1309882927 -7200
# Node ID 2a8bdfc5b0363804d1ada57f61656c8a572dfb69
# Parent eb9b25dea4af8491fe8fdc2c5308b53582e58741
removed the extra DataPackage apk, the main app will download it itself
diff -r eb9b25dea4af -r 2a8bdfc5b036 project_files/Android-build/DataPackage/AndroidManifest.xml
--- a/project_files/Android-build/DataPackage/AndroidManifest.xml Tue Jul 05 18:21:19 2011 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff -r eb9b25dea4af -r 2a8bdfc5b036 project_files/Android-build/DataPackage/TODO
--- a/project_files/Android-build/DataPackage/TODO Tue Jul 05 18:21:19 2011 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-Start Thread from service
-Communicate storage path with Hedgewars app
-use better package name
-check available space
-allow user to choose external or internal sdcard (is this even possible?)
-Suggest uninstall once Hedgewars has moved the files
diff -r eb9b25dea4af -r 2a8bdfc5b036 project_files/Android-build/DataPackage/build.properties
--- a/project_files/Android-build/DataPackage/build.properties Tue Jul 05 18:21:19 2011 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-asset.dir=assets
diff -r eb9b25dea4af -r 2a8bdfc5b036 project_files/Android-build/DataPackage/build.xml
--- a/project_files/Android-build/DataPackage/build.xml Tue Jul 05 18:21:19 2011 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Packaging resource=================================================s
-
-
-
-
-
-
-
-
-
-
-
-
diff -r eb9b25dea4af -r 2a8bdfc5b036 project_files/Android-build/DataPackage/res/drawable-hdpi/icon.png
Binary file project_files/Android-build/DataPackage/res/drawable-hdpi/icon.png has changed
diff -r eb9b25dea4af -r 2a8bdfc5b036 project_files/Android-build/DataPackage/res/drawable-ldpi/icon.png
Binary file project_files/Android-build/DataPackage/res/drawable-ldpi/icon.png has changed
diff -r eb9b25dea4af -r 2a8bdfc5b036 project_files/Android-build/DataPackage/res/drawable-mdpi/icon.png
Binary file project_files/Android-build/DataPackage/res/drawable-mdpi/icon.png has changed
diff -r eb9b25dea4af -r 2a8bdfc5b036 project_files/Android-build/DataPackage/res/layout/main.xml
--- a/project_files/Android-build/DataPackage/res/layout/main.xml Tue Jul 05 18:21:19 2011 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-
-
-
-
-
diff -r eb9b25dea4af -r 2a8bdfc5b036 project_files/Android-build/DataPackage/res/values/strings.xml
--- a/project_files/Android-build/DataPackage/res/values/strings.xml Tue Jul 05 18:21:19 2011 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-
-
- Hello World, MainActivity!vasasv
- DataPackage
-
diff -r eb9b25dea4af -r 2a8bdfc5b036 project_files/Android-build/DataPackage/src/org/xeli/dataapk/AssetsToSDCard.java
--- a/project_files/Android-build/DataPackage/src/org/xeli/dataapk/AssetsToSDCard.java Tue Jul 05 18:21:19 2011 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-package org.xeli.dataapk;
-
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import android.content.Context;
-import android.content.res.AssetManager;
-import android.util.Log;
-
-public class AssetsToSDCard implements Runnable {
-
- public int INTERNAL_SDCARD = 0;
- public int EXTERNAL_SDCARD = 1;
-
- private Context context;
- private File outputDir;
- public AssetsToSDCard(Context c, boolean verifiedFreeSpace, String _outputDir){
- context = c;
- outputDir = c.getExternalFilesDir("Data").getParentFile();
- }
-
- private void copyFile(InputStream in, OutputStream out) throws IOException {
- byte[] buffer = new byte[1024];
- int read;
- while((read = in.read(buffer)) != -1){
- out.write(buffer, 0, read);
- }
- }
-
- private void visitAllFiles(AssetManager assManager, String[] childs, String file){
- try {
- InputStream in;
- OutputStream out;
- if(childs.length == 0){ //file = a non directory file
- in = assManager.open(file);
- File f = new File(outputDir, file);
- out = new FileOutputStream(f);
- copyFile(in, out);
- }else{ //file = a directory
- for(String s : childs){
- File f = new File(outputDir, file);
- f.mkdir();
- String tmp = file + '/' + s;
- visitAllFiles(assManager, assManager.list(tmp), tmp);
- }
- }
-
- } catch (IOException e) {
- //TODO handle correctly
- Log.e("fail", file);
- e.printStackTrace();
- }
- }
-
- public void run() {//Runs in it's own thread
- AssetManager assManager = context.getAssets();
-
- try {
- Log.e("DataDownloader", "Starting to copy files");
- visitAllFiles(assManager, assManager.list("Data"), "Data");
- Log.e("DataDownloader", "Done copying files");
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
-}
diff -r eb9b25dea4af -r 2a8bdfc5b036 project_files/Android-build/DataPackage/src/org/xeli/dataapk/MainActivity.java
--- a/project_files/Android-build/DataPackage/src/org/xeli/dataapk/MainActivity.java Tue Jul 05 18:21:19 2011 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-package org.xeli.dataapk;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.widget.Button;
-
-public class MainActivity extends Activity {
-
- private MainActivity thisActivity = this;
-
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- Button b = (Button)findViewById(R.id.startCopy);
- b.setOnClickListener(startCopyClicker);
- }
-
- private OnClickListener startCopyClicker = new OnClickListener(){
- public void onClick(View arg0) {
- AssetsToSDCard runnable = new AssetsToSDCard(thisActivity, false, "/sdcard");
- Thread t = new Thread(runnable, "Assets2SDCard - Thread");
- t.start();
- }
-
- };
-
-}
\ No newline at end of file