diff --git a/xwords4/android/app/build.gradle b/xwords4/android/app/build.gradle index 563cce10e..013bbad2f 100644 --- a/xwords4/android/app/build.gradle +++ b/xwords4/android/app/build.gradle @@ -74,6 +74,19 @@ android { buildConfigField "String", "GCM_SENDER_ID", "\"$GCM_SENDER_ID\"" } + + xw4fdroid { + dimension "variant" + applicationId "org.eehouse.android.xw4" + manifestPlaceholders = [ APP_ID: applicationId ] + resValue "string", "app_name", "CrossWords" + resValue "string", "nbs_port", "3344" + resValue "string", "invite_prefix", "/and/" + buildConfigField "boolean", "WIDIR_ENABLED", "false" + buildConfigField "boolean", "RELAYINVITE_SUPPORTED", "false" + + buildConfigField "String", "GCM_SENDER_ID", "\"\"" + } xw4d { dimension "variant" minSdkVersion 8 @@ -158,6 +171,14 @@ android { jniLibs.srcDir "../libs-xw4dDebug" } } + xw4fdroid { + release { + jniLibs.srcDir "../libs-xw4fdroidRelease" + } + debug { + jniLibs.srcDir "../libs-xw4fdroidDebug" + } + } } lintOptions { diff --git a/xwords4/android/app/src/xw4fdroid/java/org/eehouse/android/xw4/CrashTrack.java b/xwords4/android/app/src/xw4fdroid/java/org/eehouse/android/xw4/CrashTrack.java new file mode 100644 index 000000000..5b1d90b1c --- /dev/null +++ b/xwords4/android/app/src/xw4fdroid/java/org/eehouse/android/xw4/CrashTrack.java @@ -0,0 +1,27 @@ +/* -*- compile-command: "find-and-gradle.sh insXw4Deb"; -*- */ +/* + * Copyright 2009 - 2012 by Eric House (xwords@eehouse.org). All + * rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package org.eehouse.android.xw4; + +import android.content.Context; + +public class CrashTrack { + public static void init( Context context ) {} // does nothing here +} diff --git a/xwords4/android/app/src/xw4fdroid/java/org/eehouse/android/xw4/GCMIntentService.java b/xwords4/android/app/src/xw4fdroid/java/org/eehouse/android/xw4/GCMIntentService.java new file mode 100644 index 000000000..52ed99206 --- /dev/null +++ b/xwords4/android/app/src/xw4fdroid/java/org/eehouse/android/xw4/GCMIntentService.java @@ -0,0 +1,37 @@ +/* -*- compile-command: "find-and-gradle.sh -PuseCrashlytics insXw4dDeb"; -*- */ +/* + * Copyright 2017 by Eric House (xwords@eehouse.org). All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package org.eehouse.android.xw4; + +import android.app.Application; + +/** + * The ancient GCMIntentService I copied from sample code seems to have + * trouble (burns battery using the WAKELOCK, specifically) when used with an + * app that doesn't have a registration ID. So let's not use that code. + */ + +public class GCMIntentService { + private static final String TAG = GCMIntentService.class.getSimpleName(); + + public static void init( Application app ) + { + Log.d( TAG, "doing nothing" ); + } +} diff --git a/xwords4/android/jni/andutils.c b/xwords4/android/jni/andutils.c index c3e26f02e..a05931d71 100644 --- a/xwords4/android/jni/andutils.c +++ b/xwords4/android/jni/andutils.c @@ -754,7 +754,7 @@ android_debugf( const char* format, ... ) } (void)__android_log_write( ANDROID_LOG_DEBUG, -# if defined VARIANT_xw4 +# if defined VARIANT_xw4 || defined VARIANT_xw4fdroid "xw4" # elif defined VARIANT_xw4d "x4bg" diff --git a/xwords4/android/jni/xwjni.c b/xwords4/android/jni/xwjni.c index 6aaf43f31..9d09568a9 100644 --- a/xwords4/android/jni/xwjni.c +++ b/xwords4/android/jni/xwjni.c @@ -648,7 +648,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_comms_1getUUID { jstring jstr = #ifdef XWFEATURE_BLUETOOTH -# if defined VARIANT_xw4 +# if defined VARIANT_xw4 || defined VARIANT_xw4fdroid (*env)->NewStringUTF( env, XW_BT_UUID ) # elif defined VARIANT_xw4d (*env)->NewStringUTF( env, XW_BT_UUID_DBG )