Skip to content

Commit 261aa4c

Browse files
authored
Merge pull request #2 from arvalon/master
Thanks. I've been updating my other Android projects, but haven't changed this one yet.
2 parents 1d9612f + 403a52f commit 261aa4c

File tree

59 files changed

+218
-197
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+218
-197
lines changed

ch01/MyAndroidApp/app/build.gradle

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 27
5-
buildToolsVersion "26.0.2"
4+
compileSdkVersion 29
65

76
defaultConfig {
87
applicationId "com.kousenit.myandroidapp"
98
minSdkVersion 19
10-
targetSdkVersion 27
11-
versionCode 1
12-
versionName "1.0"
9+
targetSdkVersion 29
10+
versionCode 2
11+
versionName "1.1"
1312
}
1413
buildTypes {
1514
release {
@@ -18,15 +17,15 @@ android {
1817
}
1918
}
2019
compileOptions {
21-
sourceCompatibility JavaVersion.VERSION_1_7
22-
targetCompatibility JavaVersion.VERSION_1_7
20+
sourceCompatibility JavaVersion.VERSION_1_8
21+
targetCompatibility JavaVersion.VERSION_1_8
2322
}
2423
}
2524

2625
dependencies {
2726
implementation fileTree(include: ['*.jar'], dir: 'libs')
28-
implementation 'com.android.support:appcompat-v7:27.0.2'
27+
implementation 'androidx.appcompat:appcompat:1.1.0'
2928
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
3029

31-
testImplementation 'junit:junit:4.12'
30+
testImplementation 'junit:junit:4.13'
3231
}

ch01/MyAndroidApp/app/src/main/java/com/kousenit/myandroidapp/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.kousenit.myandroidapp;
22

3-
import android.support.v7.app.AppCompatActivity;
3+
import androidx.appcompat.app.AppCompatActivity;
44
import android.os.Bundle;
55

66
public class MainActivity extends AppCompatActivity {

ch01/MyAndroidApp/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
maven { url 'https://maven.google.com' }
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.0.1'
10+
classpath 'com.android.tools.build:gradle:3.6.3'
1111

1212
// NOTE: Do not place your application dependencies here; they belong
1313
// in the individual module build.gradle files

ch01/MyAndroidApp/gradle.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@
1515
# When configured, Gradle will run in incubating parallel mode.
1616
# This option should only be used with decoupled projects. More details, visit
1717
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18-
# org.gradle.parallel=true
18+
# org.gradle.parallel=true
19+
android.enableJetifier=true
20+
android.useAndroidX=true
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Tue Dec 05 06:52:42 EST 2017
1+
#Fri May 15 20:10:03 MSK 2020
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

ch02/MyApplication/.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ captures/
3636

3737
# Intellij
3838
*.iml
39-
.idea/workspace.xml
39+
.idea/
4040

4141
# Keystore files
4242
*.jks
43-
43+
*.keystore
44+
/app/release/

ch02/MyApplication/app/build.gradle

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@ android {
1010
}
1111
}
1212

13-
compileSdkVersion 25
14-
buildToolsVersion "25.0.2"
13+
compileSdkVersion 29
1514

1615
defaultConfig {
1716
applicationId "com.kousenit.myapplication"
1817
minSdkVersion 16
19-
targetSdkVersion 25
20-
versionCode 1
21-
versionName "1.0"
18+
targetSdkVersion 29
19+
versionCode 2
20+
versionName "1.1"
2221
}
2322

2423
buildTypes {
@@ -52,6 +51,6 @@ task wrapper(type: Wrapper) {
5251

5352
dependencies {
5453
implementation fileTree(include: ['*.jar'], dir: 'libs')
55-
implementation 'com.android.support:appcompat-v7:25.4.0'
56-
testImplementation 'junit:junit:4.12'
54+
implementation 'androidx.appcompat:appcompat:1.1.0'
55+
testImplementation 'junit:junit:4.13'
5756
}

ch02/MyApplication/app/src/main/java/com/kousenit/myapplication/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.kousenit.myapplication;
22

3-
import android.support.v7.app.AppCompatActivity;
3+
import androidx.appcompat.app.AppCompatActivity;
44
import android.os.Bundle;
55

66
public class MainActivity extends AppCompatActivity {

ch02/MyApplication/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
jcenter()
77
}
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.0.0-alpha4'
9+
classpath 'com.android.tools.build:gradle:3.6.3'
1010

1111
// NOTE: Do not place your application dependencies here; they belong
1212
// in the individual module build.gradle files

ch02/MyApplication/gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,6 @@ login=user
2222

2323
user=user_from_gradle_properties
2424
pass=pass_from_gradle_properties
25+
android.useAndroidX=true
26+
android.enableJetifier=true
2527

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Thu Jun 22 16:16:28 PDT 2017
1+
#Fri May 15 22:06:33 MSK 2020
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

ch03/HelloWorld/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ captures/
3636

3737
# Intellij
3838
*.iml
39-
.idea/workspace.xml
39+
.idea/
4040

4141
# Keystore files
4242
*.jks

ch03/HelloWorld/app/build.gradle

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 25
5-
buildToolsVersion "25.0.2"
4+
compileSdkVersion 29
65

76
defaultConfig {
87
applicationId "com.kousenit.helloworld"
98
minSdkVersion 16
10-
targetSdkVersion 25
11-
versionCode 1
12-
versionName "1.0"
9+
targetSdkVersion 29
10+
versionCode 2
11+
versionName "1.1"
1312
}
1413

1514
buildTypes {
@@ -53,7 +52,7 @@ task printVariantNames {
5352

5453
dependencies {
5554
implementation fileTree(include: ['*.jar'], dir: 'libs')
56-
implementation 'com.google.code.gson:gson:2.8.0'
57-
implementation 'com.android.support:appcompat-v7:25.4.0'
58-
testImplementation 'junit:junit:4.12'
55+
implementation 'com.google.code.gson:gson:2.8.6'
56+
implementation 'androidx.appcompat:appcompat:1.1.0'
57+
testImplementation 'junit:junit:4.13'
5958
}

ch03/HelloWorld/app/src/main/java/com/kousenit/helloworld/MainActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import android.content.Intent;
44
import android.os.Bundle;
5-
import android.support.v7.app.AppCompatActivity;
5+
import androidx.appcompat.app.AppCompatActivity;
66
import android.view.Menu;
77
import android.view.MenuItem;
88
import android.view.View;
@@ -16,7 +16,7 @@ protected void onCreate(Bundle savedInstanceState) {
1616
super.onCreate(savedInstanceState);
1717
setContentView(R.layout.activity_main);
1818

19-
editText = (EditText) findViewById(R.id.name_edit_text);
19+
editText = findViewById(R.id.name_edit_text);
2020
}
2121

2222
public void sayHello(View view) {

ch03/HelloWorld/app/src/main/java/com/kousenit/helloworld/WelcomeActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.kousenit.helloworld;
22

33
import android.os.Bundle;
4-
import android.support.v7.app.AppCompatActivity;
4+
import androidx.appcompat.app.AppCompatActivity;
55
import android.view.Menu;
66
import android.view.MenuItem;
77
import android.widget.TextView;
@@ -18,7 +18,7 @@ protected void onCreate(Bundle savedInstanceState) {
1818
}
1919

2020
String name = getIntent().getStringExtra("user");
21-
TextView greetingText = (TextView) findViewById(R.id.greeting_text);
21+
TextView greetingText = findViewById(R.id.greeting_text);
2222
String format = getString(R.string.greeting);
2323
greetingText.setText(String.format(format, name));
2424
}

ch03/HelloWorld/app/src/stark/java/com/kousenit/helloworld/CallForHelpActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.kousenit.helloworld;
22

33
import android.os.Bundle;
4-
import android.support.v7.app.AppCompatActivity;
4+
import androidx.appcompat.app.AppCompatActivity;
55
import android.view.Menu;
66
import android.view.MenuItem;
77

ch03/HelloWorld/app/src/wayne/java/com/kousenit/helloworld/CallForHelpActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.kousenit.helloworld;
22

33
import android.os.Bundle;
4-
import android.support.v7.app.AppCompatActivity;
4+
import androidx.appcompat.app.AppCompatActivity;
55
import android.view.Menu;
66
import android.view.MenuItem;
77

ch03/HelloWorld/app/src/wayne/java/com/kousenit/helloworld/CallForHelpActivityFragment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.kousenit.helloworld;
22

33
import android.os.Bundle;
4-
import android.support.v4.app.Fragment;
4+
import androidx.fragment.app.Fragment;
55
import android.view.LayoutInflater;
66
import android.view.View;
77
import android.view.ViewGroup;

ch03/HelloWorld/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
jcenter()
77
}
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.0.0-alpha4'
9+
classpath 'com.android.tools.build:gradle:3.6.3'
1010

1111
// NOTE: Do not place your application dependencies here; they belong
1212
// in the individual module build.gradle files

ch03/HelloWorld/gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@
1616
# This option should only be used with decoupled projects. More details, visit
1717
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1818
# org.gradle.parallel=true
19+
android.enableJetifier=true
20+
android.useAndroidX=true
1921
org.gradle.jvmargs=-Xmx2048M
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Thu Jun 22 17:03:31 PDT 2017
1+
#Sat May 16 16:05:02 MSK 2020
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

ch03/MyAndroidApp/.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ captures/
3636

3737
# Intellij
3838
*.iml
39-
.idea/workspace.xml
39+
.idea/
4040

4141
# Keystore files
4242
*.jks
4343

44+
# Release folder
45+
/app/release/

ch03/MyAndroidApp/app/build.gradle

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 25
5-
buildToolsVersion "25.0.2"
4+
compileSdkVersion 29
5+
//buildToolsVersion "29.0.3"
66

77
defaultConfig {
88
applicationId "com.kousenit.myandroidapp"
99
minSdkVersion 16
10-
targetSdkVersion 25
11-
versionCode 1
12-
versionName "1.0"
10+
targetSdkVersion 29
11+
versionCode 2
12+
versionName "1.1"
1313
}
1414

1515
buildTypes {
@@ -23,10 +23,14 @@ android {
2323
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2424
}
2525
}
26+
compileOptions {
27+
sourceCompatibility = 1.8
28+
targetCompatibility = 1.8
29+
}
2630
}
2731

2832
dependencies {
2933
implementation fileTree(dir: 'libs', include: ['*.jar'])
30-
implementation 'com.android.support:appcompat-v7:25.4.0'
31-
testImplementation 'junit:junit:4.12'
34+
implementation 'androidx.appcompat:appcompat:1.1.0'
35+
testImplementation 'junit:junit:4.13'
3236
}

ch03/MyAndroidApp/app/src/main/java/com/kousenit/myandroidapp/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.kousenit.myandroidapp;
22

3-
import android.support.v7.app.AppCompatActivity;
3+
import androidx.appcompat.app.AppCompatActivity;
44
import android.os.Bundle;
55

66
public class MainActivity extends AppCompatActivity {

ch03/MyAndroidApp/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
jcenter()
77
}
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.0.0-alpha4'
9+
classpath 'com.android.tools.build:gradle:3.6.3'
1010

1111
// NOTE: Do not place your application dependencies here; they belong
1212
// in the individual module build.gradle files

ch03/MyAndroidApp/gradle.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@
1515
# When configured, Gradle will run in incubating parallel mode.
1616
# This option should only be used with decoupled projects. More details, visit
1717
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18-
# org.gradle.parallel=true
18+
# org.gradle.parallel=true
19+
android.enableJetifier=true
20+
android.useAndroidX=true
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Thu Jun 22 16:22:11 PDT 2017
1+
#Sat May 16 13:49:53 MSK 2020
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

ch04/HelloWorld/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ captures/
3636

3737
# Intellij
3838
*.iml
39-
.idea/workspace.xml
39+
.idea/
40+
.apks/
4041

4142
# Keystore files
4243
*.jks

0 commit comments

Comments
 (0)