Commit c25bb19fce157dfe6c4b61fc93afd614a1ec8c84
1 parent
7f095a9298
Exists in
master
and in
1 other branch
SonLT fix bug multiDexEnabled
Showing 4 changed files with 8 additions and 4 deletions Inline Diff
.idea/.name
1 | lifelogpedometer | File was deleted |
.idea/modules.xml
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <project version="4"> | 2 | <project version="4"> |
3 | <component name="ProjectModuleManager"> | 3 | <component name="ProjectModuleManager"> |
4 | <modules> | 4 | <modules> |
5 | <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" /> | 5 | <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" /> |
6 | <module fileurl="file://$PROJECT_DIR$/lifelog_android.iml" filepath="$PROJECT_DIR$/lifelog_android.iml" /> | ||
6 | <module fileurl="file://$PROJECT_DIR$/lifelogpedometer.iml" filepath="$PROJECT_DIR$/lifelogpedometer.iml" /> | 7 | <module fileurl="file://$PROJECT_DIR$/lifelogpedometer.iml" filepath="$PROJECT_DIR$/lifelogpedometer.iml" /> |
7 | </modules> | 8 | </modules> |
8 | </component> | 9 | </component> |
9 | </project> | 10 | </project> |
app/build.gradle
1 | apply plugin: 'com.android.application' | 1 | apply plugin: 'com.android.application' |
2 | 2 | ||
3 | android { | 3 | android { |
4 | compileSdkVersion 25 | 4 | compileSdkVersion 25 |
5 | buildToolsVersion "25.0.3" | 5 | buildToolsVersion "25.0.3" |
6 | defaultConfig { | 6 | defaultConfig { |
7 | applicationId "com.dinhcv.lifelogpedometer" | 7 | applicationId "com.dinhcv.lifelogpedometer" |
8 | minSdkVersion 19 | 8 | minSdkVersion 19 |
9 | targetSdkVersion 25 | 9 | targetSdkVersion 25 |
10 | versionCode 1 | 10 | versionCode 1 |
11 | versionName "1.0" | 11 | versionName "1.0" |
12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
13 | // Enabling multidex support. | 13 | // Enabling multidex support. |
14 | multiDexEnabled true | 14 | multiDexEnabled true |
15 | } | 15 | } |
16 | buildTypes { | 16 | buildTypes { |
17 | release { | 17 | release { |
18 | minifyEnabled false | 18 | minifyEnabled false |
19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | 19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
20 | } | 20 | } |
21 | } | 21 | } |
22 | 22 | ||
23 | signingConfigs { | 23 | signingConfigs { |
24 | dev { | 24 | dev { |
25 | storeFile file("../keystores/...") | 25 | storeFile file("../keystores/...") |
26 | storePassword 'android' | 26 | storePassword 'android' |
27 | keyAlias 'androiddebugkey' | 27 | keyAlias 'androiddebugkey' |
28 | keyPassword 'android' | 28 | keyPassword 'android' |
29 | } | 29 | } |
30 | 30 | ||
31 | product { | 31 | product { |
32 | storeFile file("..keystores/...") | 32 | storeFile file("..keystores/...") |
33 | storePassword 'android' | 33 | storePassword 'android' |
34 | keyAlias 'androiddebugkey' | 34 | keyAlias 'androiddebugkey' |
35 | keyPassword 'android' | 35 | keyPassword 'android' |
36 | } | 36 | } |
37 | } | 37 | } |
38 | 38 | ||
39 | productFlavors { | 39 | productFlavors { |
40 | 40 | ||
41 | dev { | 41 | dev { |
42 | applicationId "com.dinhcv.lifelogpedometer" | 42 | applicationId "com.dinhcv.lifelogpedometer" |
43 | applicationIdSuffix "dev" | 43 | applicationIdSuffix "dev" |
44 | minSdkVersion 19 | 44 | minSdkVersion 19 |
45 | buildConfigField 'String', 'BASE_URL', '"http://clover.timesfun.jp:9001/"' | 45 | buildConfigField 'String', 'BASE_URL', '"http://clover.timesfun.jp:9001/"' |
46 | } | 46 | } |
47 | 47 | ||
48 | product { | 48 | product { |
49 | applicationId "com.dinhcv.lifelogpedometer" | 49 | applicationId "com.dinhcv.lifelogpedometer" |
50 | minSdkVersion 19 | 50 | minSdkVersion 19 |
51 | buildConfigField 'String', 'BASE_URL', '"http://clover.timesfun.jp:9001/"' | 51 | buildConfigField 'String', 'BASE_URL', '"http://clover.timesfun.jp:9001/"' |
52 | } | 52 | } |
53 | } | 53 | } |
54 | } | 54 | } |
55 | 55 | ||
56 | dependencies { | 56 | dependencies { |
57 | compile fileTree(include: ['*.jar'], dir: 'libs') | 57 | compile fileTree(include: ['*.jar'], dir: 'libs') |
58 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { | 58 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { |
59 | exclude group: 'com.android.support', module: 'support-annotations' | 59 | exclude group: 'com.android.support', module: 'support-annotations' |
60 | }) | 60 | }) |
61 | 61 | ||
62 | // Retrofit | 62 | // Retrofit |
63 | // JSON Parsing | 63 | // JSON Parsing |
64 | compile 'com.android.support.constraint:constraint-layout:1.0.2' | ||
65 | compile 'com.squareup.retrofit2:converter-gson:2.1.0' | ||
66 | compile 'com.android.support.constraint:constraint-layout:1.0.2' | ||
67 | compile 'com.squareup.retrofit2:converter-gson:2.1.0' | 64 | compile 'com.squareup.retrofit2:converter-gson:2.1.0' |
68 | compile 'com.android.support:appcompat-v7:25.3.1' | 65 | compile 'com.android.support:appcompat-v7:25.3.1' |
69 | compile 'com.github.j4velin.colorpicker:colorpicker:1.2.3' | 66 | compile 'com.github.j4velin.colorpicker:colorpicker:1.2.3' |
70 | compile 'com.github.j4velin.EazeGraph:EazeGraph:1.0.2' | 67 | compile 'com.github.j4velin.EazeGraph:EazeGraph:1.0.2' |
71 | compile 'com.google.android.apps.dashclock:dashclock-api:2.0.0' | 68 | compile 'com.google.android.apps.dashclock:dashclock-api:2.0.0' |
72 | compile 'com.android.support:design:25.3.1' | 69 | compile 'com.android.support:design:25.3.1' |
73 | compile 'com.github.PhilJay:MPAndroidChart:v3.0.2' | 70 | compile 'com.github.PhilJay:MPAndroidChart:v3.0.2' |
74 | compile 'com.google.android.gms:play-services:11.0.4' | 71 | compile 'com.google.android.gms:play-services:11.0.4' |
75 | compile 'com.google.code.gson:gson:2.7' | 72 | compile 'com.google.code.gson:gson:2.7' |
76 | compile 'com.squareup.retrofit2:converter-gson:2.1.0' | 73 | compile 'com.squareup.retrofit2:converter-gson:2.1.0' |
77 | compile 'de.hdodenhof:circleimageview:2.1.0' | 74 | compile 'de.hdodenhof:circleimageview:2.1.0' |
78 | compile 'com.jakewharton:butterknife:8.6.0' | 75 | compile 'com.jakewharton:butterknife:8.6.0' |
79 | testCompile 'junit:junit:4.12' | 76 | testCompile 'junit:junit:4.12' |
80 | // Retrofit | 77 | // Retrofit |
81 | compile 'com.squareup.retrofit2:retrofit:2.1.0' | 78 | compile 'com.squareup.retrofit2:retrofit:2.1.0' |
82 | compile 'com.squareup.picasso:picasso:2.5.2' | 79 | compile 'com.squareup.picasso:picasso:2.5.2' |
83 | compile 'de.hdodenhof:circleimageview:2.1.0' | 80 | compile 'de.hdodenhof:circleimageview:2.1.0' |
84 | compile 'com.jakewharton:butterknife:8.6.0' | 81 | compile 'com.jakewharton:butterknife:8.6.0' |
85 | compile 'com.squareup.retrofit2:retrofit:2.1.0' | 82 | compile 'com.squareup.retrofit2:retrofit:2.1.0' |
86 | compile 'com.squareup.picasso:picasso:2.5.2' | 83 | compile 'com.squareup.picasso:picasso:2.5.2' |
87 | compile 'com.android.support:support-v4:25.3.1' | 84 | compile 'com.android.support:support-v4:25.3.1' |
88 | testCompile 'junit:junit:4.12' | 85 | testCompile 'junit:junit:4.12' |
89 | 86 | ||
90 | compile 'com.android.support:multidex:1.0.1' | 87 | compile 'com.android.support:multidex:1.0.1' |
91 | 88 | ||
92 | annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0' | 89 | annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0' |
93 | } | 90 | } |
94 | 91 |
app/src/main/java/com/dinhcv/lifelogpedometer/LifeLogApplication.java
1 | package com.dinhcv.lifelogpedometer; | 1 | package com.dinhcv.lifelogpedometer; |
2 | 2 | ||
3 | import android.app.Application; | 3 | import android.app.Application; |
4 | import android.content.Context; | 4 | import android.content.Context; |
5 | import android.support.multidex.MultiDex; | ||
5 | import android.webkit.WebView; | 6 | import android.webkit.WebView; |
6 | 7 | ||
7 | import com.dinhcv.lifelogpedometer.model.DummyData; | 8 | import com.dinhcv.lifelogpedometer.model.DummyData; |
8 | import com.dinhcv.lifelogpedometer.model.database.orm.OrmDatabaseHelper; | 9 | import com.dinhcv.lifelogpedometer.model.database.orm.OrmDatabaseHelper; |
9 | import com.dinhcv.lifelogpedometer.model.structure.SelectItemInfo; | 10 | import com.dinhcv.lifelogpedometer.model.structure.SelectItemInfo; |
10 | import com.dinhcv.lifelogpedometer.utils.Utils; | 11 | import com.dinhcv.lifelogpedometer.utils.Utils; |
11 | 12 | ||
12 | import java.util.Date; | 13 | import java.util.Date; |
13 | import java.util.List; | 14 | import java.util.List; |
14 | 15 | ||
15 | 16 | ||
16 | public class LifeLogApplication extends Application { | 17 | public class LifeLogApplication extends Application { |
17 | 18 | ||
18 | public List<SelectItemInfo> mSexList; | 19 | public List<SelectItemInfo> mSexList; |
19 | public List<SelectItemInfo> mProvinceList; | 20 | public List<SelectItemInfo> mProvinceList; |
20 | public static Context context; | 21 | public static Context context; |
22 | |||
23 | @Override | ||
24 | protected void attachBaseContext(Context base) { | ||
25 | super.attachBaseContext(base); | ||
26 | MultiDex.install(this); | ||
27 | } | ||
21 | 28 | ||
22 | @Override | 29 | @Override |
23 | public void onCreate() { | 30 | public void onCreate() { |
24 | super.onCreate(); | 31 | super.onCreate(); |
25 | 32 | ||
26 | context = LifeLogApplication.this; | 33 | context = LifeLogApplication.this; |
27 | // Add DB local | 34 | // Add DB local |
28 | OrmDatabaseHelper.addOrmRecordClasses(new Class[]{ | 35 | OrmDatabaseHelper.addOrmRecordClasses(new Class[]{ |
29 | 36 | ||
30 | }); | 37 | }); |
31 | 38 | ||
32 | OrmDatabaseHelper.init(this); | 39 | OrmDatabaseHelper.init(this); |
33 | 40 | ||
34 | String ua = new WebView(this).getSettings().getUserAgentString(); | 41 | String ua = new WebView(this).getSettings().getUserAgentString(); |
35 | Utils.setCustomUA(ua); | 42 | Utils.setCustomUA(ua); |
36 | } | 43 | } |
37 | 44 | ||
38 | public List<SelectItemInfo> getSexList(){ | 45 | public List<SelectItemInfo> getSexList(){ |
39 | if (mSexList == null) { | 46 | if (mSexList == null) { |
40 | mSexList = DummyData.getSexList(context); | 47 | mSexList = DummyData.getSexList(context); |
41 | } | 48 | } |
42 | return mSexList; | 49 | return mSexList; |
43 | } | 50 | } |
44 | 51 | ||
45 | public List<SelectItemInfo> getProvinceList(){ | 52 | public List<SelectItemInfo> getProvinceList(){ |
46 | if (mProvinceList == null) { | 53 | if (mProvinceList == null) { |
47 | mProvinceList = DummyData.getProvinceList(context); | 54 | mProvinceList = DummyData.getProvinceList(context); |
48 | } | 55 | } |
49 | return mProvinceList; | 56 | return mProvinceList; |
50 | } | 57 | } |
51 | 58 | ||
52 | } | 59 | } |
53 | 60 |