diff --git a/README.md b/README.md
index c915826..9e9c3ac 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,3 @@
# android-hypergames
+Games written for fun to practice Android programming and animation.
diff --git a/app/build.gradle b/app/build.gradle
index 13f56a9..ac61e52 100755
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,14 +1,14 @@
apply plugin: 'com.android.application'
android {
- compileSdkVersion 24
- buildToolsVersion "24.0.2"
+ namespace "com.hyperling.apps.games"
+ compileSdkVersion 36
defaultConfig {
applicationId "apps.hyperling.com.platformer"
- minSdkVersion 15
- targetSdkVersion 24
- versionCode 10
- versionName "0.9"
+ minSdkVersion 14
+ targetSdkVersion 36
+ versionCode 11
+ versionName "0.0.10"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
@@ -20,11 +20,19 @@ android {
}
dependencies {
+ /*
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
- compile 'com.google.android.gms:play-services-ads:9.8.0'
testCompile 'junit:junit:4.12'
+ */
+
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
+ exclude group: 'com.android.support', module: 'support-annotations'
+ })
+ // https://mvnrepository.com/artifact/com.android.support/appcompat-v7
+ implementation group: 'com.android.support', name: 'appcompat-v7', version: '28.0.0'
}
diff --git a/app/src/androidTest/java/com/hyperling/apps/games/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/hyperling/apps/games/ExampleInstrumentedTest.java
deleted file mode 100755
index 85a88c5..0000000
--- a/app/src/androidTest/java/com/hyperling/apps/games/ExampleInstrumentedTest.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.hyperling.apps.games;
-
-import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import static org.junit.Assert.*;
-
-/**
- * Instrumentation test, which will execute on an Android device.
- *
- * @see Testing documentation
- */
-@RunWith(AndroidJUnit4.class)
-public class ExampleInstrumentedTest {
- @Test
- public void useAppContext() throws Exception {
- // Context of the app under test.
- Context appContext = InstrumentationRegistry.getTargetContext();
-
- assertEquals("apps.hyperling.com.platformer", appContext.getPackageName());
- }
-}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index f8ea237..bc9c177 100755
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,5 +1,6 @@
@@ -9,21 +10,17 @@
-
-
-
-
+
-
diff --git a/app/src/main/java/com/hyperling/apps/games/AdsHelper.java b/app/src/main/java/com/hyperling/apps/games/AdsHelper.java
deleted file mode 100755
index ed50f9b..0000000
--- a/app/src/main/java/com/hyperling/apps/games/AdsHelper.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package com.hyperling.apps.games;
-
-import android.content.Context;
-import android.content.SharedPreferences;
-import android.view.View;
-
-import com.google.android.gms.ads.AdRequest;
-import com.google.android.gms.ads.AdView;
-import com.google.android.gms.ads.MobileAds;
-
-/**
- * Created by ling on 12/26/16.
- */
-
-public class AdsHelper {
-
- // To be called in onResume in Activities
- public static void toggleAds(SharedPreferences sharedPreferences, String adsKey, Context applicationContext, AdView mAdView){
- // Enable ads?
- boolean adsEnabled = sharedPreferences.getBoolean(adsKey, false);
- if (adsEnabled) {
- mAdView.setVisibility(View.VISIBLE);
- MobileAds.initialize(applicationContext, "ca-app-pub-3940256099942544~3347511713");
- AdRequest adRequest = new AdRequest.Builder()
- .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
- .addTestDevice("C6A494DC6E7C9AC29102694D48487084") // Nexus 7
- .addTestDevice("6545BCC9B60A394005546783687339B7") // Moto G
- .build();
- mAdView.loadAd(adRequest);
- }
- else{
- mAdView.setVisibility(View.GONE);
- }
-
- }
-}
diff --git a/app/src/main/java/com/hyperling/apps/games/HighScoreActivity.java b/app/src/main/java/com/hyperling/apps/games/HighScoreActivity.java
index 801e643..ae90619 100755
--- a/app/src/main/java/com/hyperling/apps/games/HighScoreActivity.java
+++ b/app/src/main/java/com/hyperling/apps/games/HighScoreActivity.java
@@ -7,11 +7,9 @@ import android.util.Log;
import android.widget.LinearLayout;
import android.widget.TextView;
-import com.google.android.gms.ads.AdView;
-
public class HighScoreActivity extends AppCompatActivity {
- private String sharedPreferencesKey, adsKey, TAG, html;
+ private String sharedPreferencesKey, TAG, html;
private String[] allBirdScoreKeys, allChickenScoreKeys;
private SharedPreferences sharedPreferences;
@@ -29,7 +27,6 @@ public class HighScoreActivity extends AppCompatActivity {
sharedPreferencesKey = getString(R.string.sharedPreferencesKey);
allBirdScoreKeys = getResources().getStringArray(R.array.allBirdScoreKeys);
allChickenScoreKeys = getResources().getStringArray(R.array.allChickenScoreKeys);
- adsKey = getString(R.string.adsKey);
// Shared preferences
sharedPreferences = getSharedPreferences(sharedPreferencesKey, MODE_PRIVATE);
@@ -89,7 +86,6 @@ public class HighScoreActivity extends AppCompatActivity {
@Override
protected void onResume() {
leaderboardHelper = new LeaderboardHelper();
- displayAds();
super.onResume();
Runnable getHTML = new Runnable() {
@@ -106,10 +102,6 @@ public class HighScoreActivity extends AppCompatActivity {
Log.d(TAG, "HighScoreActivity.onResume() html=" + html);
}
- private void displayAds(){
- AdsHelper.toggleAds(sharedPreferences, adsKey, getApplicationContext(), (AdView) findViewById(R.id.adViewHighScores));
- }
-
private boolean isNumeric(char c){
try{
String s = "" + c;
diff --git a/app/src/main/java/com/hyperling/apps/games/MainActivity.java b/app/src/main/java/com/hyperling/apps/games/MainActivity.java
index 3d8a97d..7a7cb0e 100755
--- a/app/src/main/java/com/hyperling/apps/games/MainActivity.java
+++ b/app/src/main/java/com/hyperling/apps/games/MainActivity.java
@@ -8,13 +8,11 @@ import android.util.Log;
import android.view.View;
import android.widget.Button;
-import com.google.android.gms.ads.AdView;
-
public class MainActivity extends AppCompatActivity {
private Button btnGameBird, btnGameCow, btnGamePig, btnGameChicken, btnGameCat, btnGameSquirrel, btnOptions, btnHighScores, btnHelp;
- private String TAG, sharedPreferencesKey, adsKey, birdScoreKey, chickenScoreKey;
+ private String TAG, sharedPreferencesKey, birdScoreKey, chickenScoreKey;
private SharedPreferences sharedPreferences;
@@ -28,7 +26,6 @@ public class MainActivity extends AppCompatActivity {
// Keys
sharedPreferencesKey = getString(R.string.sharedPreferencesKey);
- adsKey = getString(R.string.adsKey);
birdScoreKey = getString(R.string.birdScoreKey);
chickenScoreKey = getString(R.string.chickenScoreKey);
@@ -101,8 +98,6 @@ public class MainActivity extends AppCompatActivity {
@Override
protected void onResume() {
- displayAds();
-
// Append high scores to button text
int score;
String newText;
@@ -160,10 +155,6 @@ public class MainActivity extends AppCompatActivity {
startActivity(options);
}
- private void displayAds(){
- AdsHelper.toggleAds(sharedPreferences, adsKey, getApplicationContext(), (AdView) findViewById(R.id.adViewMain));
- }
-
private void doHighScoresButton(){
Intent highScores = new Intent(MainActivity.this, HighScoreActivity.class);
startActivity(highScores);
diff --git a/app/src/main/java/com/hyperling/apps/games/OptionsActivity.java b/app/src/main/java/com/hyperling/apps/games/OptionsActivity.java
index 0268411..9679043 100755
--- a/app/src/main/java/com/hyperling/apps/games/OptionsActivity.java
+++ b/app/src/main/java/com/hyperling/apps/games/OptionsActivity.java
@@ -10,23 +10,19 @@ import android.widget.Button;
import android.widget.CheckBox;
import android.widget.RelativeLayout;
-import com.google.android.gms.ads.AdRequest;
-import com.google.android.gms.ads.AdView;
-import com.google.android.gms.ads.MobileAds;
-
/**
* Created by ling on 12/22/16.
*/
public class OptionsActivity extends AppCompatActivity {
- private String sharedPreferencesKey, adsKey, higherQualityKey, fpsKey;
+ private String sharedPreferencesKey, higherQualityKey, fpsKey;
private SharedPreferences sharedPreferences;
- private RelativeLayout layoutAds, layoutHigherQuality, layoutFPS;
- private CheckBox cbAds, cbHigherQuality, cbFPS;
- private boolean adsEnabled, higherQualityEnabled, fpsEnabled;
+ private RelativeLayout layoutHigherQuality, layoutFPS;
+ private CheckBox cbHigherQuality, cbFPS;
+ private boolean higherQualityEnabled, fpsEnabled;
private Button btnDeletePreferences, btnConfirmDeletePreferences;
@@ -42,24 +38,6 @@ public class OptionsActivity extends AppCompatActivity {
sharedPreferencesKey = getString(R.string.sharedPreferencesKey);
sharedPreferences = getSharedPreferences(sharedPreferencesKey, MODE_PRIVATE);
- // Set up Ads
- adsKey = getString(R.string.adsKey);
- layoutAds = (RelativeLayout) findViewById(R.id.optionAdsLayout);
- cbAds = (CheckBox) findViewById(R.id.optionAdsCheckBox);
- layoutAds.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- flipOption(adsKey);
- }
- });
- cbAds.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- flipOption(adsKey);
- }
- });
- setAds();
-
// Higher Quality Content
higherQualityKey = getString(R.string.higherQualityKey);
layoutHigherQuality = (RelativeLayout) findViewById(R.id.optionHigherQualityLayout);
@@ -123,10 +101,7 @@ public class OptionsActivity extends AppCompatActivity {
editor.apply();
// Change the box
- if (key.equals(adsKey)){
- setAds();
- }
- else if (key.equals(higherQualityKey)){
+ if (key.equals(higherQualityKey)){
setHigherQuality();
}
else if (key.equals(fpsKey)){
@@ -134,31 +109,6 @@ public class OptionsActivity extends AppCompatActivity {
}
}
- private void setAds(){
- adsEnabled = sharedPreferences.getBoolean(adsKey, false);
- cbAds.setChecked(adsEnabled);
- toggleAds();
- }
-
- private void toggleAds(){
- // Enable ads?
- adsEnabled = sharedPreferences.getBoolean(adsKey, false);
- AdView mAdView = (AdView) findViewById(R.id.adViewOptions);
- if (adsEnabled) {
- mAdView.setVisibility(View.VISIBLE);
- MobileAds.initialize(getApplicationContext(), "ca-app-pub-3940256099942544~3347511713");
- AdRequest adRequest = new AdRequest.Builder()
- .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
- .addTestDevice("C6A494DC6E7C9AC29102694D48487084") // Nexus 7
- .addTestDevice("6545BCC9B60A394005546783687339B7") // Moto G
- .build();
- mAdView.loadAd(adRequest);
- }
- else{
- mAdView.setVisibility(View.GONE);
- }
- }
-
public void setHigherQuality() {
higherQualityEnabled = sharedPreferences.getBoolean(higherQualityKey, false);
cbHigherQuality.setChecked(higherQualityEnabled);
diff --git a/app/src/main/res/layout/activity_high_score.xml b/app/src/main/res/layout/activity_high_score.xml
index 49c3c95..3b9ad16 100755
--- a/app/src/main/res/layout/activity_high_score.xml
+++ b/app/src/main/res/layout/activity_high_score.xml
@@ -9,25 +9,16 @@
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
+ android:layout_marginTop="?android:actionBarSize"
tools:context="com.hyperling.apps.games.HighScoreActivity">
-
-
+ android:layout_alignParentBottom="true">
-
-
+ android:layout_alignParentBottom="true">
-
-
@@ -35,6 +26,7 @@
android:layout_height="wrap_content"
android:orientation="vertical">
+
Online
Other
- Allow Ads on Menu Screens?
Play Practice Round when Starting New Games?
Allow Higher Quality Images and Animations?
Display FPS?
@@ -52,7 +51,6 @@
HyperGames
- Ads
Practice
HigherQuality
FPS
@@ -82,11 +80,4 @@
- ChickenScore008(Alpha)
-
- ca-app-pub-9712416021907617/7877767281
- ca-app-pub-9712416021907617/3307966880
- ca-app-pub-9712416021907617/4784700088
diff --git a/app/src/test/java/com/hyperling/apps/games/ExampleUnitTest.java b/app/src/test/java/com/hyperling/apps/games/ExampleUnitTest.java
deleted file mode 100755
index e998d9d..0000000
--- a/app/src/test/java/com/hyperling/apps/games/ExampleUnitTest.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.hyperling.apps.games;
-
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-/**
- * Example local unit test, which will execute on the development machine (host).
- *
- * @see Testing documentation
- */
-public class ExampleUnitTest {
- @Test
- public void addition_isCorrect() throws Exception {
- assertEquals(4, 2 + 2);
- }
-}
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index 2cb309c..bfc1796 100755
--- a/build.gradle
+++ b/build.gradle
@@ -2,11 +2,18 @@
buildscript {
repositories {
- jcenter()
+ mavenCentral()
+ maven {
+ url 'https://jitpack.io'
+ }
google()
+ maven {
+ url 'https://maven.google.com/'
+ name 'Google'
+ }
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.2.1'
+ classpath 'com.android.tools.build:gradle:8.11.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -15,7 +22,8 @@ buildscript {
allprojects {
repositories {
- jcenter()
+ mavenCentral()
+ google()
}
}
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index c3de4ad..275e5b5 100755
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Thu Jan 10 06:49:36 CST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip