21 package com.arm.malideveloper.openglessdk.astctextureslowprecision;
24 import java.io.InputStream;
25 import java.io.RandomAccessFile;
27 import android.os.Bundle;
28 import android.app.Activity;
29 import android.content.res.AssetManager;
30 import android.util.Log;
35 private static String
LOGTAG =
"AstcTextures";
42 protected void onCreate(Bundle savedInstanceState)
44 super.onCreate(savedInstanceState);
101 setContentView(graphicsView);
106 graphicsView.onPause();
111 graphicsView.onResume();
122 if(fileTest.exists())
124 Log.d(
LOGTAG,assetName +
" already exists. No extraction needed.\n");
128 Log.d(
LOGTAG, assetName +
" doesn't exist. Extraction needed. \n");
133 RandomAccessFile out =
new RandomAccessFile(
assetDirectory + assetName,
"rw");
134 AssetManager am = applicationContext.getResources().getAssets();
137 InputStream inputStream = am.open(assetName);
138 byte
buffer[] =
new byte[1024];
144 count = inputStream.read(
buffer, 0, 1024);
153 if(fileTest.exists())
155 Log.d(
LOGTAG,
"File extracted successfully");
TutorialView graphicsView
void onCreate(Bundle savedInstanceState)
GLenum GLenum GLsizei count
static String assetDirectory
static android.content.Context applicationContext
void extractAsset(String assetName)