Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: samples/openglui/android-canvas-tests/src/com/google/dartndk/DummyActivity.java

Issue 24698003: Removed the openglui sample app. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 package com.google.dartndk;
2
3 import java.io.File;
4 import java.io.FileOutputStream;
5 import java.io.InputStream;
6 import java.io.IOException;
7 import java.io.OutputStream;
8
9 import android.app.NativeActivity;
10 import android.content.res.AssetManager;
11 import android.os.Bundle;
12 import android.util.Log;
13
14 public class DummyActivity extends NativeActivity {
15 @Override
16 public void onCreate(Bundle savedInstanceState) {
17 super.onCreate(savedInstanceState);
18 try {
19 File localDir = getApplicationContext().getDir("dart", 0);
20 String fileSystemPath = localDir.toString();
21 String assetPath = "dart";
22 AssetManager assetManager = getAssets();
23 String[] files = assetManager.list(assetPath);
24 byte[] buffer = new byte[1024];
25 int read;
26 for (String filename : files) {
27 String dest = fileSystemPath + "/" + filename;
28 Log.w("Dart", "Copying " + dest);
29 InputStream in = assetManager.open(assetPath + "/" + filename);
30 OutputStream out = new FileOutputStream(dest);
31 while((read = in.read(buffer)) != -1){
32 out.write(buffer, 0, read);
33 }
34 in.close();
35 out.flush();
36 ((FileOutputStream)out).getFD().sync();
37 out.close();
38 }
39 } catch (IOException ex) {
40 }
41 }
42 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698