Skip to content

Commit

Permalink
Install Skillz framework
Browse files Browse the repository at this point in the history
Make changes necessary to import Skillz framework and compile with framework added. At this point, the app launches directly into the game and is not yet displaying the Skillz interface.
  • Loading branch information
millibeckers committed Jan 7, 2019
1 parent 9dc7662 commit f4aa9f7
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 6 deletions.
4 changes: 2 additions & 2 deletions 2048/2048.iml
Expand Up @@ -8,12 +8,12 @@
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="true">

This comment has been minimized.

Copy link
@millibeckers

millibeckers Jan 9, 2019

Author

This change was done automatically for me by Android Studio when I changed the language in the build.gradle file

<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
</module>
19 changes: 18 additions & 1 deletion 2048/2048/build.gradle
Expand Up @@ -5,19 +5,36 @@ android {
buildToolsVersion '27.0.3'

defaultConfig {
minSdkVersion 14
minSdkVersion 19

This comment has been minimized.

Copy link
@millibeckers

millibeckers Jan 9, 2019

Author

It was necessary to update the minSdkVersion of the game in order to meet the requirements of the Skillz SDK.

targetSdkVersion 27
versionCode 27
versionName "1.1.11"

ndk {
abiFilters "armeabi-v7a", "x86"
}
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

repositories {
maven {
url "http://nexus.skillz.com/content/groups/public/"
}
}
}

dependencies {
compile 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.skillz.sdk:skillz-sdk-android:21.0.14'
}
11 changes: 10 additions & 1 deletion 2048/2048/proguard-rules.txt
Expand Up @@ -14,4 +14,13 @@
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
#}

-keep public class com.dylanvann.fastimage.* { *; }
-keep public class com.dylanvann.fastimage.** { *; }
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}

-keep class com.scottyab.rootbeer.** { *; }
8 changes: 8 additions & 0 deletions 2048/2048/src/main/AndroidManifest.xml
@@ -1,15 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tpcstld.twozerogame">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="27" />

<application
android:allowBackup="true"
android:icon="@drawable/logo_2048"
android:label="@string/app_name"
android:theme="@style/AppTheme">

<meta-data android:name="skillz_game_id" android:value="2112" />
<meta-data android:name="skillz_production" android:value="false" />
<meta-data android:name="skillz_game_activity" android:value="com.tpcstld.twozerogame.MainActivity" />
<meta-data android:name="skillz_allow_exit" android:value="false" />

This comment has been minimized.

Copy link
@millibeckers

millibeckers Jan 9, 2019

Author

This meta-data is used by the Skillz SDK to correctly run your app. They must be direct children of the application tag in order to work properly.

For a detailed breakdown of what each tag means, see the section on the Skillz meta-data in this page of our documentation.


<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:launchMode="singleTask"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Expand Up @@ -3,10 +3,11 @@
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.view.KeyEvent;

public class MainActivity extends AppCompatActivity {
import com.skillz.SkillzActivity;

public class MainActivity extends SkillzActivity {

private static final String WIDTH = "width";
private static final String HEIGHT = "height";
Expand Down

1 comment on commit f4aa9f7

@millibeckers
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the build.gradle file modified to integrate with the Skillz SDK was not the top level project one, but the one associated with the module.

Please sign in to comment.