Skip to content

Commit

Permalink
增加了统计
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelSun committed Jan 31, 2012
1 parent 0909e71 commit 3277f86
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 5 deletions.
10 changes: 10 additions & 0 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,20 @@
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<!-- add permissions for umeng -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<application
android:icon="@drawable/icon"
android:label="@string/app_name" >

<meta-data android:value="4f26afbe52701526bc0000be" android:name="UMENG_APPKEY" />
<meta-data android:value="mumayi" android:name="UMENG_CHANNEL"/>

<activity
android:configChanges="keyboard|keyboardHidden|orientation"
android:name="net.youmi.android.appoffers.AppOffersActivity" >
Expand Down
Binary file added libs/AndroidAnalyticSDK3.1.1.jar
Binary file not shown.
Binary file added res/drawable-hdpi/egg_p.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions res/drawable/button_egg.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true"
android:drawable="@drawable/egg" />
android:drawable="@drawable/egg_p" />
<item android:state_selected="true"
android:drawable="@drawable/egg" />
android:drawable="@drawable/egg_p" />
<item android:state_pressed="true"
android:drawable="@drawable/egg" />
android:drawable="@drawable/egg_p" />
<item android:drawable="@drawable/egg" />
</selector>
40 changes: 38 additions & 2 deletions src/com/tinygame/lianliankan/LinkLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import android.view.animation.AnimationUtils;
import android.widget.TextView;

import com.mobclick.android.MobclickAgent;
import com.tinygame.lianliankan.config.Config;
import com.tinygame.lianliankan.config.Env;
import com.tinygame.lianliankan.engine.Chart;
Expand Down Expand Up @@ -62,6 +63,8 @@ public class LinkLink extends Activity implements LLViewActionListener

private boolean mStopDialogShow;

private Context mContext;

private static final int PLAY_READY_SOUND = 0;
private static final int PLAY_BACKGROUND_SOUND = 1;
private static final int START_PROGRESS_TIME_VIEW = 2;
Expand Down Expand Up @@ -114,7 +117,9 @@ public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN ,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
WindowManager.LayoutParams.FLAG_FULLSCREEN);

mContext = this;
SettingManager.getInstance().init(getApplicationContext());
SoundEffectUtils.getInstance().init(this);
ImageSplitUtils.getInstance().init(this);
Expand All @@ -126,6 +131,10 @@ public void onCreate(Bundle savedInstanceState) {
resetContent();

AppOffersManager.init(this, Config.APP_ID, Config.APP_SECRET_KEY, false);

//test umeng config
MobclickAgent.setSessionContinueMillis(2 * 60 * 1000);
MobclickAgent.setUpdateOnlyWifi(false);
}

@Override
Expand All @@ -144,6 +153,18 @@ public void onStart() {
mStopDialogShow = false;
}
}

@Override
public void onResume() {
super.onResume();
MobclickAgent.onResume(this);
}

@Override
public void onPause() {
super.onPause();
MobclickAgent.onPause(this);
}

private void checkAppPoint() {
if (!Config.DEBUG_CLOSE_APP_DOWNLOAD) {
Expand Down Expand Up @@ -207,6 +228,7 @@ private void resetContent() {
@Override
public void onClick(View v) {
showStopDialog();
MobclickAgent.onEvent(mContext, Config.ACTION_CLICK_LABEL, "paused_game");
}
});
}
Expand All @@ -216,6 +238,7 @@ public void onClick(View v) {
public void onClick(View v) {
Env.ICON_REGION_INIT = false;
reloadCurrentLevel();
MobclickAgent.onEvent(mContext, Config.ACTION_CLICK_LABEL, "new_game");
}
});
arrangeButton.setOnClickListener(new View.OnClickListener() {
Expand All @@ -238,6 +261,8 @@ public void onClick(View v) {
mCurDiffArrangeCount--;
}
updateToolsCountView();

MobclickAgent.onEvent(mContext, Config.ACTION_CLICK_LABEL, "arrange");
}
});
hintButton.setOnClickListener(new View.OnClickListener() {
Expand All @@ -254,6 +279,8 @@ public void onClick(View v) {
mCurDiffHintCount--;
}
updateToolsCountView();

MobclickAgent.onEvent(mContext, Config.ACTION_CLICK_LABEL, "hint");
}
});
mNext.setOnClickListener(new View.OnClickListener() {
Expand Down Expand Up @@ -346,11 +373,15 @@ public void onClick(DialogInterface dialog, int which) {
}
mAppDownloadShow = false;
AppOffersManager.showAppOffers(LinkLink.this);

MobclickAgent.onEvent(mContext, Config.ACTION_OFFER_LABEL);
}
}).setNegativeButton(R.string.btn_cancel
, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
MobclickAgent.onEvent(mContext, Config.ACTION_OFFER_CANCEL_LABEL);

finish();
}
}).create();
Expand Down Expand Up @@ -516,7 +547,8 @@ private void reloadCurrentLevel() {
, ThemeManager.getInstance().getCurrentImageCount() - 1));
mLLView.setChart(c);
mCurrentTimeProgress = Categary_diff_selector.getInstance().getCurrentTime();
mLevelView.setLevel(Categary_diff_selector.getInstance().getCurrentLevel());
int curLevel = Categary_diff_selector.getInstance().getCurrentLevel();
mLevelView.setLevel(curLevel);

mHandler.sendEmptyMessage(RESET_PROGRESS_TIME_VIEW);
if (!mAppDownloadShow) {
Expand All @@ -528,6 +560,8 @@ private void reloadCurrentLevel() {

updateToolsCount();
updateToolsCountView();

MobclickAgent.onEvent(this, Config.ACTION_START, String.valueOf(curLevel));
} else {
showResetGameDialog();
}
Expand Down Expand Up @@ -608,6 +642,8 @@ private void tryUpdateDiffAndCategory() {
SettingManager.getInstance().setOpenLevel(curLevel);
}
// checkAppPoint();

MobclickAgent.onEvent(mContext, Config.ACTION_LEVEL, String.valueOf(curLevel));
} else {
showResetGameDialog();
}
Expand Down
6 changes: 6 additions & 0 deletions src/com/tinygame/lianliankan/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ public class Config {

public static final boolean SOUND_DEBUG = false;

public static final String ACTION_CLICK_LABEL = "action_click";
public static final String ACTION_OFFER_LABEL = "offer_click";
public static final String ACTION_OFFER_CANCEL_LABEL = "offer_cancel";
public static final String ACTION_LEVEL = "level";
public static final String ACTION_START = "start";

public static final String APP_ID = "53e13f6906527b33";

public static final String APP_SECRET_KEY = "e1703eadcc64253b";
Expand Down

0 comments on commit 3277f86

Please sign in to comment.