21 package com.arm.malideveloper.openglessdk.shadowMapping;
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 =
"ShadowMapping";
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");
void extractAsset(String assetName)
TutorialView tutorialView
static String assetsDirectory
GLenum GLenum GLsizei count
static android.content.Context applicationContext
void onCreate(Bundle savedInstanceState)