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

Unified Diff: platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/ViewerApplication.java

Issue 1952323004: Initial commit of our new Android app to demo Skia. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Merge Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/ViewerApplication.java
diff --git a/platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/ViewerApplication.java b/platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/ViewerApplication.java
new file mode 100644
index 0000000000000000000000000000000000000000..9389f7220810b458d0075d155087e0d1c37578dd
--- /dev/null
+++ b/platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/ViewerApplication.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+package org.skia.viewer;
+
+import android.app.Application;
+
+public class ViewerApplication extends Application {
+ private long mNativeHandle = 0;
+
+ static {
+ System.loadLibrary("skia_android");
+ System.loadLibrary("viewer");
+ }
+
+ private native long createNativeApp();
+ private native void destroyNativeApp(long handle);
+
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ mNativeHandle = createNativeApp();
+ }
+
+ @Override
+ public void onTerminate() {
+ if (mNativeHandle != 0) {
+ destroyNativeApp(mNativeHandle);
+ mNativeHandle = 0;
+ }
+ super.onTerminate();
+ }
+
+ public long getNativeHandle() {
+ return mNativeHandle;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698