21 package com.arm.malideveloper.openglessdk.instancing;
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;
35 private static String
LOGTAG =
"Instancing";
38 @Override
protected void onCreate(Bundle savedInstanceState)
40 super.onCreate(savedInstanceState);
52 setContentView(tutorialView);
57 tutorialView.onPause();
62 tutorialView.onResume();
74 Log.d(
LOGTAG, assetName +
" already exists. No extraction needed.\n");
76 Log.d(
LOGTAG, assetName +
" doesn't exist. Extraction needed. \n");
79 RandomAccessFile randomAccessFile =
new RandomAccessFile(
assetsDirectory + assetName,
"rw");
80 AssetManager assetManager = applicationContext.getResources().getAssets();
81 InputStream inputStream = assetManager.open(assetName);
83 byte
buffer[] =
new byte[1024];
89 count = inputStream.read(
buffer, 0, 1024);
92 randomAccessFile.close();
94 }
catch(Exception e) {
99 Log.d(
LOGTAG,
"File extracted successfully");
TutorialView tutorialView
static android.content.Context applicationContext
GLenum GLenum GLsizei count
static String assetsDirectory
void onCreate(Bundle savedInstanceState)
void extractAsset(String assetName)