Skip to content

Migrated entire library and project's sample code to Kotlin, Gradle plugin updated to 7.4.1, target SDK 33, updated all dependencies, AndroidX #109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
buildscript {
repositories {
mavenCentral()
jcenter()
}

dependencies {
Expand All @@ -15,6 +14,7 @@ buildscript {
apply plugin: 'com.android.application'
apply plugin: 'spoon'
apply plugin: 'com.github.triplet.play'
apply plugin: 'org.jetbrains.kotlin.android'

play {
track = 'beta'
Expand All @@ -34,11 +34,11 @@ android {
targetSdkVersion targetSdkVer

// When updating these, remember to update the vars in the root build.gradle
versionName "0.4.5.3"
versionCode 21
versionName "0.4.6"
versionCode 23

archivesBaseName = "AndroidNetworkTools"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}

//check if the keystore details are defined in gradle.properties (this is so the key is not in github)
Expand Down Expand Up @@ -73,13 +73,13 @@ spoon {
}

dependencies {
implementation "com.android.support:appcompat-v7:$supportLibVer"
implementation "com.android.support:design:$supportLibVer"
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0'
implementation project(':library')

testImplementation 'junit:junit:4.12'
testImplementation 'junit:junit:4.13.2'

androidTestImplementation 'com.squareup.spoon:spoon-client:1.6.4'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation('com.android.support.test.espresso:espresso-intents:2.2')
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation('androidx.test.espresso:espresso-intents:3.5.1')
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* Created by matthew on 20/12/16.
*/

import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.rule.ActivityTestRule;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import android.view.WindowManager;

import com.squareup.spoon.Spoon;
Expand All @@ -15,14 +15,14 @@
import org.junit.Test;
import org.junit.runner.RunWith;

import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.clearText;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard;
import static android.support.test.espresso.action.ViewActions.typeText;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.clearText;
import static androidx.test.espresso.action.ViewActions.click;
import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard;
import static androidx.test.espresso.action.ViewActions.typeText;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;

@RunWith(AndroidJUnit4.class)
public class MainActivityTest {
Expand Down
40 changes: 19 additions & 21 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.stealthcotper.networktools"
android:installLocation="auto"
>
android:installLocation="auto">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.INTERNET" />

<application
android:name=".ANTApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
>
<activity
android:name="com.stealthcotper.networktools.MainActivity"
<application
android:name=".ANTApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar"
>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name="com.stealthcotper.networktools.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
package com.stealthcotper.networktools;
package com.stealthcotper.networktools

import android.app.Application;
import android.app.Application

public class ANTApplication extends Application {

@Override
public void onCreate() {
initStrictMode();
super.onCreate();
class ANTApplication : Application() {
override fun onCreate() {
initStrictMode()
super.onCreate()
}

private void initStrictMode() {
private fun initStrictMode() {
if (BuildConfig.DEBUG) {

// Let's be super strict so that we can discover bugs during testing
Expand All @@ -28,6 +26,4 @@ private void initStrictMode() {
// .build());
}
}


}
}
Loading