use a method to make it overridable
authorChristian Weiske <cweiske@cweiske.de>
Sat, 12 Sep 2015 20:50:42 +0000 (22:50 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Sat, 12 Sep 2015 20:50:42 +0000 (22:50 +0200)
.gitignore
AndroidManifest.xml
src/de/cweiske/ouya/romlauncher/LaunchSnesActivity.java [moved from src/de/cweiske/ouya/gamelauncher/LaunchGameActivity.java with 69% similarity]

index 082c52d90a8785bc14e086751e68501e423bc8c9..026c201acf3dbc991d2ff144dfa87cfd1ffbaf19 100644 (file)
@@ -4,3 +4,5 @@
 /.classpath
 /.project
 /.settings
+/local.properties
+/src/romlauncher/
index 138cdfd14d85f3209d4f94a5eb5b05acb62a5d1e..c797e5e17faa549428ca4cb325fee2517369f84b 100644 (file)
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-          package="de.cweiske.ouya.gamelauncher"
+          package="FIXME_PACKAGE"
           android:versionCode="1"
           android:versionName="1.0">
     <uses-sdk android:minSdkVersion="16"/>
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
-    <application android:label="FIXME_GAMETITLE">
-        <activity android:name=".LaunchGameActivity"
-                  android:label="FIXME_GAMETITLE"
+    <application android:label="FIXME_TITLE">
+        <activity android:name=".LaunchRomActivity"
+                  android:label="FIXME_TITLE"
                   android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN"/>
similarity index 69%
rename from src/de/cweiske/ouya/gamelauncher/LaunchGameActivity.java
rename to src/de/cweiske/ouya/romlauncher/LaunchSnesActivity.java
index 085b5e9223dc1c0300dfbcf880c1b5450c73cbd8..a9941b88557b79d4ea64e199497cbbea53bf466c 100644 (file)
@@ -1,20 +1,4 @@
-/*
- * Copyright (C) 2012 OUYA, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.cweiske.ouya.gamelauncher;
+package de.cweiske.ouya.romlauncher;
 
 import java.io.File;
 import java.io.FileOutputStream;
@@ -30,10 +14,10 @@ import android.net.Uri;
 import android.os.Bundle;
 import android.os.Environment;
 
-public class LaunchGameActivity extends Activity
+abstract public class LaunchSnesActivity extends Activity
 {
-    String assetFilename = "FIXME_ASSETFILENAME";
-       
+    abstract protected String getAssetFilename();
+
     /**
      * Called when the activity is first created.
      */
@@ -42,9 +26,9 @@ public class LaunchGameActivity extends Activity
     {
         super.onCreate(savedInstanceState);
         
-        File extractedFile = extractFile(this.assetFilename);
+        File extractedFile = extractFile(getAssetFilename());
         if (extractedFile == null) {
-               System.err.println("Failed to extract file " + this.assetFilename);
+               System.err.println("Failed to extract file " + getAssetFilename());
                finish();
                return;
         }