Skip to content
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
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,5 @@ dependencies {
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation("com.github.BetsonWick:NetworkMonitor:1.1.1")
}
13 changes: 13 additions & 0 deletions app/src/main/java/ru/ok/android/itmohack2023/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
package ru.ok.android.itmohack2023

import android.app.ActivityManager
import android.app.usage.NetworkStatsManager
import android.content.Context
import android.content.Intent
import android.os.Build
import android.os.Bundle
import android.view.View
import androidx.annotation.RequiresApi
import androidx.appcompat.app.AppCompatActivity
import ru.itmo.networkmonitor.NetworkMonitorTask

class MainActivity : AppCompatActivity() {
@RequiresApi(Build.VERSION_CODES.M)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
NetworkMonitorTask(
getSystemService(NETWORK_STATS_SERVICE) as NetworkStatsManager, getSystemService(
Context.ACTIVITY_SERVICE
) as ActivityManager,
listOf("ru.ok")
).start()
findViewById<View>(R.id.url_connection).setOnClickListener {
startActivity(Intent(this, UrlConnectionActivity::class.java))
}
Expand Down
8 changes: 3 additions & 5 deletions local.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
## This file is automatically generated by Android Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file should *NOT* be checked into Version Control Systems,
## This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=/Users/kirill.popov/Library/Android/sdk
#Sun Apr 16 15:10:41 MSK 2023
sdk.dir=/Users/mk17ru/Library/Android/sdk
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
rootProject.name = "ItmoHack2023"
Expand Down