21 package com.arm.malideveloper.openglessdk.boids;
24 import java.io.InputStream;
25 import java.io.RandomAccessFile;
26 import android.os.Bundle;
27 import android.app.Activity;
28 import android.content.res.AssetManager;
29 import android.util.Log;
31 public class Boids extends Activity
35 private static String
LOGTAG =
"EtcTexture";
38 @Override
protected void onCreate(Bundle savedInstanceState)
40 super.onCreate(savedInstanceState);
54 setContentView(tutorialView);
59 tutorialView.onPause();
64 tutorialView.onResume();
76 Log.d(
LOGTAG, assetName +
" already exists. No extraction needed.\n");
78 Log.d(
LOGTAG, assetName +
" doesn't exist. Extraction needed. \n");
81 RandomAccessFile randomAccessFile =
new RandomAccessFile(
assetsDirectory + assetName,
"rw");
82 AssetManager assetManager = applicationContext.getResources().getAssets();
83 InputStream inputStream = assetManager.open(assetName);
85 byte
buffer[] =
new byte[1024];
91 count = inputStream.read(
buffer, 0, 1024);
94 randomAccessFile.close();
96 }
catch(Exception e) {
101 Log.d(
LOGTAG,
"File extracted successfully");
static android.content.Context applicationContext
static String assetsDirectory
TutorialView tutorialView
GLenum GLenum GLsizei count
void extractAsset(String assetName)
void onCreate(Bundle savedInstanceState)