21 package com.arm.malideveloper.openglessdk.skybox;
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 =
"Skybox";
42 protected void onCreate(Bundle savedInstanceState)
44 super.onCreate(savedInstanceState);
65 setContentView(graphicsView);
70 graphicsView.onPause();
75 graphicsView.onResume();
88 Log.d(
LOGTAG,assetName +
" already exists. No extraction needed.\n");
92 Log.d(
LOGTAG, assetName +
" doesn't exist. Extraction needed. \n");
97 RandomAccessFile out =
new RandomAccessFile(
assetDirectory + assetName,
"rw");
98 AssetManager am = applicationContext.getResources().getAssets();
101 InputStream inputStream = am.open(assetName);
102 byte
buffer[] =
new byte[1024];
108 count = inputStream.read(
buffer, 0, 1024);
117 if(fileTest.exists())
119 Log.d(
LOGTAG,
"File extracted successfully");
static android.content.Context applicationContext
static String assetDirectory
TutorialView graphicsView
void extractAsset(String assetName)
GLenum GLenum GLsizei count
void onCreate(Bundle savedInstanceState)