This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.webscrapingtest.viewmodel | |
import android.util.Log | |
import androidx.lifecycle.ViewModel | |
import org.jsoup.Jsoup | |
import org.jsoup.nodes.Document | |
import org.jsoup.select.Elements | |
import com.github.kittinunf.fuel.Fuel | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.webscrapingtest.viewmodel | |
import android.util.Log | |
import androidx.lifecycle.ViewModel | |
import org.jsoup.Jsoup | |
import org.jsoup.nodes.Document | |
import org.jsoup.select.Elements | |
class MainViewModel : ViewModel() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.webscrapingtest.view | |
import androidx.lifecycle.ViewModelProvider | |
import android.os.Bundle | |
import android.util.Log | |
import androidx.fragment.app.Fragment | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import android.webkit.JavascriptInterface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.webscrapingtest.view | |
import androidx.lifecycle.ViewModelProvider | |
import android.os.Bundle | |
import android.util.Log | |
import androidx.fragment.app.Fragment | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import android.webkit.JavascriptInterface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.webscrapingtest.view | |
import androidx.lifecycle.ViewModelProvider | |
import android.os.Bundle | |
import androidx.fragment.app.Fragment | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import android.webkit.WebViewClient | |
import androidx.databinding.DataBindingUtil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.example.webscrapingtest"> | |
<!-- add --> | |
<uses-permission android:name="android.permission.INTERNET" /> | |
<application | |
android:allowBackup="true" | |
android:icon="@mipmap/ic_launcher" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
id 'com.android.application' | |
id 'kotlin-android' | |
// add | |
id 'kotlin-android-extensions' // kotlinx | |
id 'kotlin-kapt' // databinding | |
} | |
android { | |
compileSdk 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<layout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools"> | |
<!-- add --> | |
<data> | |
<variable | |
name="webviewmodel" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 指定文字列の出現数をカウント | |
fun main(args: Array<String>) { | |
var hashmap = mutableMapOf<String, String>() | |
hashmap["aaa"] = "WWDDDWWDDDDLWDDDD" | |
hashmap["bbb"] = "WWDDDWWDDDDLWDDDD" | |
var dcount = mutableMapOf<String, Int>() | |
for((key, value) in hashmap) { | |
println(key) | |
println(value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 指定文字列の出現数をカウント | |
fun main(args: Array<String>) { | |
var str:String = "WWWDDLLLDDDWWWDDDDDLLLDLWDWLDDDD" | |
var len = { str: String -> str.length } | |
println("$str, %d".format(len(str))) | |
var findstrlist = listOf("DDDDD", "DDDD", "DDD") | |
for(findstr: String in findstrlist) { | |
var len1 = str.length | |
str = str.replace(findstr, "") | |
var len2 = str.length |
NewerOlder