project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadAssets.java
changeset 6724 03cd33624284
parent 6485 7586c266b52e
child 7318 a446eafcddeb
equal deleted inserted replaced
6723:b77e2d4d664b 6724:03cd33624284
     7 import java.io.IOException;
     7 import java.io.IOException;
     8 import java.io.InputStream;
     8 import java.io.InputStream;
     9 import java.io.OutputStream;
     9 import java.io.OutputStream;
    10 
    10 
    11 import org.hedgewars.hedgeroid.MainActivity;
    11 import org.hedgewars.hedgeroid.MainActivity;
       
    12 import org.hedgewars.hedgeroid.R;
    12 import org.hedgewars.hedgeroid.Utils;
    13 import org.hedgewars.hedgeroid.Utils;
       
    14 import org.hedgewars.hedgeroid.Datastructures.Scheme;
       
    15 import org.hedgewars.hedgeroid.Datastructures.Team;
       
    16 import org.hedgewars.hedgeroid.Datastructures.Weapon;
    13 
    17 
    14 import android.content.Context;
    18 import android.content.Context;
    15 import android.content.res.AssetManager;
    19 import android.content.res.AssetManager;
    16 import android.os.AsyncTask;
    20 import android.os.AsyncTask;
    17 import android.util.Log;
    21 import android.util.Log;
    80 	    return 0l;
    84 	    return 0l;
    81 
    85 
    82 	}
    86 	}
    83 
    87 
    84 	protected Long doInBackground(Object... params) {
    88 	protected Long doInBackground(Object... params) {
       
    89 		Utils.resRawToFilesDir(act,R.array.schemes, Scheme.DIRECTORY_SCHEME);
       
    90 		Utils.resRawToFilesDir(act, R.array.weapons, Weapon.DIRECTORY_WEAPON);
       
    91 		Utils.resRawToFilesDir(act, R.array.teams, Team.DIRECTORY_TEAMS);
    85 		buffer = new byte[8192];//allocate the buffer
    92 		buffer = new byte[8192];//allocate the buffer
    86 		return DownloadAssets.copyFileOrDir(act, "Data");
    93 		return DownloadAssets.copyFileOrDir(act, "Data");
    87 	}
    94 	}
    88 	
    95 	
    89 	protected void onPostExecute(Long result){
    96 	protected void onPostExecute(Long result){