Skip to content

Commit

Permalink
添加友盟统计,多渠道发布。
Browse files Browse the repository at this point in the history
  • Loading branch information
pwcong committed Oct 11, 2016
1 parent b84d09b commit 864953c
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 1 deletion.
16 changes: 16 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,22 @@ android {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}

}

productFlavors{

wandoujia {}
baidu {}
c360 {}
uc {}
xiaomi{}

productFlavors.all { flavor ->
flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name]
}

}
}

dependencies {
Expand Down Expand Up @@ -47,4 +61,6 @@ dependencies {
compile 'com.getbase:floatingactionbutton:1.10.1'
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
compile 'me.relex:circleindicator:1.2.1@aar'
compile 'com.umeng.analytics:analytics:latest.integration'
}

3 changes: 3 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>

<application
android:allowBackup="true"
Expand Down Expand Up @@ -35,6 +36,8 @@

<activity android:configChanges="locale" android:name=".component.activity.AboutActivity" android:label="@string/about"/>

<meta-data android:value="57fcdf6ae0f55a310300163d" android:name="UMENG_APPKEY"/>
<meta-data android:value="${UMENG_CHANNEL_VALUE}" android:name="UMENG_CHANNEL"/>


</application>
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/me/pwcong/jpstart/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.support.v7.app.AppCompatDelegate;

import com.blankj.utilcode.utils.NetworkUtils;
import com.umeng.analytics.MobclickAgent;

import me.pwcong.jpstart.conf.Constants;
import me.pwcong.jpstart.manager.SharedPreferenceManager;
Expand Down Expand Up @@ -34,6 +35,8 @@ public void onCreate() {

ISWIFI = NetworkUtils.isWifiConnected(this);

MobclickAgent.setScenarioType(this, MobclickAgent.EScenarioType.E_UM_NORMAL);

}

public synchronized static App getInstance(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.umeng.analytics.MobclickAgent;

import butterknife.ButterKnife;
import me.pwcong.jpstart.manager.ActivityManager;

Expand Down Expand Up @@ -58,8 +60,15 @@ public void showSnackBar(View view,int msg){
@Override
protected void onResume() {
super.onResume();
MobclickAgent.onResume(this);

ActivityManager.setCurrent(this);

}

@Override
protected void onPause() {
super.onPause();
MobclickAgent.onPause(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected int getViewId() {

@Override
protected void initVariable(@Nullable Bundle savedInstanceState) {
//hideState();

}

@Override
Expand Down

0 comments on commit 864953c

Please sign in to comment.