diff --git a/sample-game/.project b/sample-game/.project new file mode 100644 index 0000000..3ba6a91 --- /dev/null +++ b/sample-game/.project @@ -0,0 +1,33 @@ + + + MainActivity + + + + + + com.android.ide.eclipse.adt.ResourceManagerBuilder + + + + + com.android.ide.eclipse.adt.PreCompilerBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.android.ide.eclipse.adt.ApkBuilder + + + + + + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.jdt.core.javanature + + diff --git a/sample-game/.settings/org.eclipse.jdt.core.prefs b/sample-game/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..b080d2d --- /dev/null +++ b/sample-game/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/sample/AndroidManifest.xml b/sample-game/AndroidManifest.xml old mode 100644 new mode 100755 similarity index 100% rename from sample/AndroidManifest.xml rename to sample-game/AndroidManifest.xml diff --git a/sample/libs/android-support-v4.jar b/sample-game/libs/android-support-v4.jar similarity index 100% rename from sample/libs/android-support-v4.jar rename to sample-game/libs/android-support-v4.jar diff --git a/sample/libs/google-play-services.jar b/sample-game/libs/google-play-services.jar similarity index 100% rename from sample/libs/google-play-services.jar rename to sample-game/libs/google-play-services.jar diff --git a/sample/libs/growthpush.jar b/sample-game/libs/growthpush.jar similarity index 100% rename from sample/libs/growthpush.jar rename to sample-game/libs/growthpush.jar diff --git a/sample/proguard-project.txt b/sample-game/proguard-project.txt old mode 100644 new mode 100755 similarity index 100% rename from sample/proguard-project.txt rename to sample-game/proguard-project.txt diff --git a/sample/project.properties b/sample-game/project.properties old mode 100644 new mode 100755 similarity index 100% rename from sample/project.properties rename to sample-game/project.properties diff --git a/sample/res/drawable-hdpi/ic_launcher.png b/sample-game/res/drawable-hdpi/ic_launcher.png old mode 100644 new mode 100755 similarity index 100% rename from sample/res/drawable-hdpi/ic_launcher.png rename to sample-game/res/drawable-hdpi/ic_launcher.png diff --git a/sample-game/res/drawable-hdpi/paper.png b/sample-game/res/drawable-hdpi/paper.png new file mode 100644 index 0000000..08f32c3 Binary files /dev/null and b/sample-game/res/drawable-hdpi/paper.png differ diff --git a/sample-game/res/drawable-hdpi/rock.png b/sample-game/res/drawable-hdpi/rock.png new file mode 100644 index 0000000..ccdbebf Binary files /dev/null and b/sample-game/res/drawable-hdpi/rock.png differ diff --git a/sample-game/res/drawable-hdpi/scissors.png b/sample-game/res/drawable-hdpi/scissors.png new file mode 100644 index 0000000..d225174 Binary files /dev/null and b/sample-game/res/drawable-hdpi/scissors.png differ diff --git a/sample-game/res/drawable-ldpi/paper.png b/sample-game/res/drawable-ldpi/paper.png new file mode 100644 index 0000000..784eee4 Binary files /dev/null and b/sample-game/res/drawable-ldpi/paper.png differ diff --git a/sample-game/res/drawable-ldpi/rock.png b/sample-game/res/drawable-ldpi/rock.png new file mode 100644 index 0000000..3fc1bbe Binary files /dev/null and b/sample-game/res/drawable-ldpi/rock.png differ diff --git a/sample-game/res/drawable-ldpi/scissors.png b/sample-game/res/drawable-ldpi/scissors.png new file mode 100644 index 0000000..3c904fe Binary files /dev/null and b/sample-game/res/drawable-ldpi/scissors.png differ diff --git a/sample/res/drawable-mdpi/ic_launcher.png b/sample-game/res/drawable-mdpi/ic_launcher.png old mode 100644 new mode 100755 similarity index 100% rename from sample/res/drawable-mdpi/ic_launcher.png rename to sample-game/res/drawable-mdpi/ic_launcher.png diff --git a/sample-game/res/drawable-mdpi/paper.png b/sample-game/res/drawable-mdpi/paper.png new file mode 100644 index 0000000..4f3a138 Binary files /dev/null and b/sample-game/res/drawable-mdpi/paper.png differ diff --git a/sample-game/res/drawable-mdpi/rock.png b/sample-game/res/drawable-mdpi/rock.png new file mode 100644 index 0000000..cbafe96 Binary files /dev/null and b/sample-game/res/drawable-mdpi/rock.png differ diff --git a/sample-game/res/drawable-mdpi/scissors.png b/sample-game/res/drawable-mdpi/scissors.png new file mode 100644 index 0000000..cf8d47b Binary files /dev/null and b/sample-game/res/drawable-mdpi/scissors.png differ diff --git a/sample/res/drawable-xhdpi/ic_launcher.png b/sample-game/res/drawable-xhdpi/ic_launcher.png old mode 100644 new mode 100755 similarity index 100% rename from sample/res/drawable-xhdpi/ic_launcher.png rename to sample-game/res/drawable-xhdpi/ic_launcher.png diff --git a/sample-game/res/drawable-xhdpi/paper.png b/sample-game/res/drawable-xhdpi/paper.png new file mode 100644 index 0000000..ee343c2 Binary files /dev/null and b/sample-game/res/drawable-xhdpi/paper.png differ diff --git a/sample-game/res/drawable-xhdpi/rock.png b/sample-game/res/drawable-xhdpi/rock.png new file mode 100644 index 0000000..74683a8 Binary files /dev/null and b/sample-game/res/drawable-xhdpi/rock.png differ diff --git a/sample-game/res/drawable-xhdpi/scissors.png b/sample-game/res/drawable-xhdpi/scissors.png new file mode 100644 index 0000000..6e47bb1 Binary files /dev/null and b/sample-game/res/drawable-xhdpi/scissors.png differ diff --git a/sample-game/res/layout/activity_main.xml b/sample-game/res/layout/activity_main.xml new file mode 100755 index 0000000..1537fcc --- /dev/null +++ b/sample-game/res/layout/activity_main.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sample/res/menu/main.xml b/sample-game/res/menu/main.xml old mode 100644 new mode 100755 similarity index 100% rename from sample/res/menu/main.xml rename to sample-game/res/menu/main.xml diff --git a/sample/res/values-sw600dp/dimens.xml b/sample-game/res/values-sw600dp/dimens.xml old mode 100644 new mode 100755 similarity index 100% rename from sample/res/values-sw600dp/dimens.xml rename to sample-game/res/values-sw600dp/dimens.xml diff --git a/sample/res/values-sw720dp-land/dimens.xml b/sample-game/res/values-sw720dp-land/dimens.xml old mode 100644 new mode 100755 similarity index 100% rename from sample/res/values-sw720dp-land/dimens.xml rename to sample-game/res/values-sw720dp-land/dimens.xml diff --git a/sample/res/values-v11/styles.xml b/sample-game/res/values-v11/styles.xml old mode 100644 new mode 100755 similarity index 100% rename from sample/res/values-v11/styles.xml rename to sample-game/res/values-v11/styles.xml diff --git a/sample/res/values-v14/styles.xml b/sample-game/res/values-v14/styles.xml old mode 100644 new mode 100755 similarity index 100% rename from sample/res/values-v14/styles.xml rename to sample-game/res/values-v14/styles.xml diff --git a/sample/res/values/dimens.xml b/sample-game/res/values/dimens.xml old mode 100644 new mode 100755 similarity index 100% rename from sample/res/values/dimens.xml rename to sample-game/res/values/dimens.xml diff --git a/sample-game/res/values/strings.xml b/sample-game/res/values/strings.xml new file mode 100755 index 0000000..4753ebd --- /dev/null +++ b/sample-game/res/values/strings.xml @@ -0,0 +1,10 @@ + + + + GrowthPushSample + Settings + グー + チョキ + パー + + diff --git a/sample/res/values/styles.xml b/sample-game/res/values/styles.xml old mode 100644 new mode 100755 similarity index 100% rename from sample/res/values/styles.xml rename to sample-game/res/values/styles.xml diff --git a/sample-game/src/com/growthpush/growthpushsample/MainActivity.java b/sample-game/src/com/growthpush/growthpushsample/MainActivity.java new file mode 100755 index 0000000..a944c53 --- /dev/null +++ b/sample-game/src/com/growthpush/growthpushsample/MainActivity.java @@ -0,0 +1,68 @@ +package com.growthpush.growthpushsample; + +import java.util.Random; + +import android.app.Activity; +import android.os.Bundle; +import android.view.Menu; +import android.view.View; +import android.view.View.OnClickListener; +import android.widget.ImageView; +import android.widget.TextView; + +import com.growthpush.GrowthPush; +import com.growthpush.model.Environment; + +public class MainActivity extends Activity implements OnClickListener{ + + private int[] myImageList = new int[]{R.drawable.rock, R.drawable.paper, R.drawable.scissors}; + private String results[][] = {{"tie","loss","win"},{"win","tie","loss"},{"loss","win","tie"}}; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + GrowthPush + .getInstance() + .initialize(getApplicationContext(), 1071, "Ou3DgCwmMS2tBocWXGKSnRUUTyVA078n", + BuildConfig.DEBUG ? Environment.development : Environment.production, true).register("955057365401"); + GrowthPush.getInstance().trackEvent("Launch"); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + // Inflate the menu; this adds items to the action bar if it is present. + getMenuInflater().inflate(R.menu.main, menu); + return true; + } + + @Override + public void onClick(View v) { + switch (v.getId()) { + case R.id.selectRock: + playLocal(0); + break; + case R.id.selectPaper: + playLocal(1); + break; + case R.id.selectScissors: + playLocal(2); + break; + } + } + + private void playLocal(int playerSelect) { + ImageView playerImage = (ImageView) findViewById(R.id.imageView1); + playerImage.setImageResource(this.myImageList[playerSelect]); + + ImageView enemyImage = (ImageView) findViewById(R.id.imageView2); + int enemySelect = new Random(System.currentTimeMillis()).nextInt(this.myImageList.length); + enemyImage.setImageResource(this.myImageList[enemySelect]); + ((TextView) findViewById(R.id.textView1)).setText(results[playerSelect][enemySelect]); + + //Event,Tag Post + GrowthPush.getInstance().trackEvent("GameResult", results[playerSelect][enemySelect]); + GrowthPush.getInstance().setDeviceTags(); + } +} \ No newline at end of file diff --git a/sample/.project b/sample-simple/.project similarity index 100% rename from sample/.project rename to sample-simple/.project diff --git a/sample-simple/.settings/org.eclipse.jdt.core.prefs b/sample-simple/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..b080d2d --- /dev/null +++ b/sample-simple/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/sample-simple/AndroidManifest.xml b/sample-simple/AndroidManifest.xml new file mode 100644 index 0000000..01627a8 --- /dev/null +++ b/sample-simple/AndroidManifest.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sample-simple/libs/android-support-v4.jar b/sample-simple/libs/android-support-v4.jar new file mode 120000 index 0000000..6dbec89 --- /dev/null +++ b/sample-simple/libs/android-support-v4.jar @@ -0,0 +1 @@ +../../android-support-v4.jar \ No newline at end of file diff --git a/sample-simple/libs/google-play-services.jar b/sample-simple/libs/google-play-services.jar new file mode 120000 index 0000000..b4217af --- /dev/null +++ b/sample-simple/libs/google-play-services.jar @@ -0,0 +1 @@ +../../google-play-services.jar \ No newline at end of file diff --git a/sample-simple/libs/growthpush.jar b/sample-simple/libs/growthpush.jar new file mode 120000 index 0000000..d272047 --- /dev/null +++ b/sample-simple/libs/growthpush.jar @@ -0,0 +1 @@ +../../growthpush.jar \ No newline at end of file diff --git a/sample-simple/proguard-project.txt b/sample-simple/proguard-project.txt new file mode 100644 index 0000000..f2fe155 --- /dev/null +++ b/sample-simple/proguard-project.txt @@ -0,0 +1,20 @@ +# To enable ProGuard in your project, edit project.properties +# to define the proguard.config property as described in that file. +# +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in ${sdk.dir}/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the ProGuard +# include property in project.properties. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/sample-simple/project.properties b/sample-simple/project.properties new file mode 100644 index 0000000..a3ee5ab --- /dev/null +++ b/sample-simple/project.properties @@ -0,0 +1,14 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system edit +# "ant.properties", and override values to adapt the script to your +# project structure. +# +# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): +#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt + +# Project target. +target=android-17 diff --git a/sample-simple/res/drawable-hdpi/ic_launcher.png b/sample-simple/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 0000000..96a442e Binary files /dev/null and b/sample-simple/res/drawable-hdpi/ic_launcher.png differ diff --git a/sample-simple/res/drawable-mdpi/ic_launcher.png b/sample-simple/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 0000000..359047d Binary files /dev/null and b/sample-simple/res/drawable-mdpi/ic_launcher.png differ diff --git a/sample-simple/res/drawable-xhdpi/ic_launcher.png b/sample-simple/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 0000000..71c6d76 Binary files /dev/null and b/sample-simple/res/drawable-xhdpi/ic_launcher.png differ diff --git a/sample-simple/res/layout/activity_main.xml b/sample-simple/res/layout/activity_main.xml new file mode 100644 index 0000000..b7ce8c1 --- /dev/null +++ b/sample-simple/res/layout/activity_main.xml @@ -0,0 +1,104 @@ + + + + + + + + +