my android kotlin WebView app opened successfully and navigate well through the usual URL address like mywebsite.com/register, but was unable to navigate through other links which I have used to power most of my webpages within the website like mywebsite.com/register/?route=dashboard. or ../home/?route=history.
the website programming language in totality is php ajax jquery with css and html.
Below is my MainActivity.kt file
import android.annotation.SuppressLint
import android.os.Build
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.webkit.WebView
import androidx.annotation.RequiresApi
class MainActivity: AppCompatActivity() {
private lateinit
var webView: WebView
@RequiresApi(Build.VERSION_CODES.O)
@SuppressLint("MissingInflatedId", "SetJavaScriptEnabled")
override fun onCreate(savedInstanceState: Bundle ? ) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
webView = findViewById(R.id.FirstApp)
webView.settings.apply {
javaScriptEnabled = true
safeBrowsingEnabled = true
domStorageEnabled = true
databaseEnabled = true
allowFileAccess = true
}
webView.apply {
loadUrl("https://vtuconnects.com.ng/login")
}
}
@Deprecated("Deprecated in Java")
override fun onBackPressed() {
if (webView.canGoBack()) webView.goBack()
else super.onBackPressed()
}
}
The website I wanted to use it for is vtuconects.com.ng/login. if the below demo credentials can bypass the login page to the dashboard, that means the help rendered here either by code modification or replication works fine.
username: DemoLogin
password: Demo12345