removed the extra DataPackage apk, the main app will download it itself hedgeroid
authorXeli
Tue, 05 Jul 2011 18:22:07 +0200
branchhedgeroid
changeset 5393 2a8bdfc5b036
parent 5391 eb9b25dea4af
child 5395 5caae9d7e12e
removed the extra DataPackage apk, the main app will download it itself
project_files/Android-build/DataPackage/AndroidManifest.xml
project_files/Android-build/DataPackage/TODO
project_files/Android-build/DataPackage/build.properties
project_files/Android-build/DataPackage/build.xml
project_files/Android-build/DataPackage/res/drawable-hdpi/icon.png
project_files/Android-build/DataPackage/res/drawable-ldpi/icon.png
project_files/Android-build/DataPackage/res/drawable-mdpi/icon.png
project_files/Android-build/DataPackage/res/layout/main.xml
project_files/Android-build/DataPackage/res/values/strings.xml
project_files/Android-build/DataPackage/src/org/xeli/dataapk/AssetsToSDCard.java
project_files/Android-build/DataPackage/src/org/xeli/dataapk/MainActivity.java
--- 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 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-      package="org.xeli.dataapk"
-      android:versionCode="1"
-      android:versionName="1.0">
-    <uses-sdk android:minSdkVersion="4" />
-    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
-
-    <application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true">
-        <activity android:name="MainActivity"
-                  android:label="@string/app_name">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-    </application>
-</manifest>
\ No newline at end of file
--- 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
--- 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
--- 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 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="MainActivity" default="help">
-
-<!-- The local.properties file is created and updated by the 'android'
-     tool.
-     It contains the path to the SDK. It should *NOT* be checked into
-     Version Control Systems. -->
-    <property file="local.properties" />
-
-    <!-- The build.properties file can be created by you and is never touched
-         by the 'android' tool. This is the place to change some of the
-         default property values used by the Ant rules.
-         Here are some properties you may want to change/update:
-
-         source.dir
-             The name of the source directory. Default is 'src'.
-         out.dir
-             The name of the output directory. Default is 'bin'.
-
-         Properties related to the SDK location or the project target should
-         be updated using the 'android' tool with the 'update' action.
-
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems.
-
-         -->
-    <property file="build.properties" />
-
-    <!-- The default.properties file is created and updated by the 'android'
-         tool, as well as ADT.
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems. -->
-    <property file="default.properties" />
-
-
-    <!-- Required pre-setup import -->
-    <import file="${sdk.dir}/tools/ant/pre_setup.xml" />
-
-
-<!-- extension targets. Uncomment the ones where you want to do custom work
-     in between standard targets -->
-<!--
-    <target name="-pre-build">
-    </target>
-    <target name="-pre-compile">
-    </target>
-
-    [This is typically used for code obfuscation.
-     Compiled code location: ${out.classes.absolute.dir}
-     If this is not done in place, override ${out.dex.input.absolute.dir}]
-    <target name="-post-compile">
-    </target>
--->
-
-    <!-- Execute the Android Setup task that will setup some properties
-         specific to the target, and import the build rules files.
-
-         The rules file is imported from
-            <SDK>/tools/ant/
-         Depending on the project type it can be either:
-         - main_rules.xml
-         - lib_rules.xml
-         - test_rules.xml
-
-         To customize existing targets, there are two options:
-         - Customize only one target:
-             - copy/paste the target into this file, *before* the
-               <setup> task.
-             - customize it to your needs.
-         - Customize the whole script.
-             - copy/paste the content of the rules files (minus the top node)
-               into this file, *after* the <setup> task
-             - disable the import of the rules by changing the setup task
-               below to <setup import="false" />.
-             - customize to your needs.
-    -->
-
-    <target name="-package-resources">
-    <echo>Packaging resource=================================================s</echo>
-        <aapt executable="${aapt}"
-                command="package"
-                versioncode="${version.code}"
-                debug="${build.packaging.debug}"
-                manifest="AndroidManifest.xml"
-                assets="${asset.absolute.dir}"
-                androidjar="${android.jar}"
-                apkfolder="${out.absolute.dir}"
-                resourcefilename="${resource.package.file.name}"
-                resourcefilter="${aapt.resource.filter}">
-            <res path="${resource.absolute.dir}" />
-            <!-- Xeli: This is needed because if the assets are compressed they will be uncompressed by android who has some random limit set on the max file size. That limit is about 1mb -->
-            <nocompress /> <!--forces no compression on any files in assets or res/raw -->
-            <!-- <nocompress extension="xml" /> forces no compression on specific file extensions in assets and res/raw -->
-        </aapt>
-    </target>
-
-
-   <setup />
-
-</project>
Binary file project_files/Android-build/DataPackage/res/drawable-hdpi/icon.png has changed
Binary file project_files/Android-build/DataPackage/res/drawable-ldpi/icon.png has changed
Binary file project_files/Android-build/DataPackage/res/drawable-mdpi/icon.png has changed
--- 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 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    >
-<TextView  
-    android:layout_width="fill_parent" 
-    android:layout_height="wrap_content" 
-    android:text="@string/hello"
-    />
-<Button
-	android:id="@+id/startCopy"
-	android:layout_width="wrap_content"
-	android:layout_height="wrap_content"
-	android:text="@string/hello"
-	/>
-</LinearLayout>
--- 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 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <string name="hello">Hello World, MainActivity!vasasv</string>
-    <string name="app_name">DataPackage</string>
-</resources>
--- 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();
-		}
-	}
-
-}
--- 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