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
17 changes: 17 additions & 0 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 32
defaultConfig {
applicationId "com.sabithpkcmnr.webviewmaster"
minSdkVersion 14
applicationId "com.sawalasln.slnepay"
minSdkVersion 16
targetSdkVersion 32
versionCode 1
versionName "1.0"
versionCode 4
versionName "4.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
Expand All @@ -19,6 +19,7 @@ android {
}

dependencies {
implementation 'com.google.android.gms:play-services-ads:19.6.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.android.material:material:1.5.0'

Expand Down
Binary file added app/release/app-release.apk
Binary file not shown.
18 changes: 18 additions & 0 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": 2,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.sabithpkcmnr.webviewmaster",
"variantName": "processReleaseResources",
"elements": [
{
"type": "SINGLE",
"filters": [],
"versionCode": 1,
"versionName": "1.0",
"outputFile": "app-release.apk"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sabithpkcmnr.webviewmaster;
package com.sawalasln.slnepay;

import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
Expand Down
18 changes: 13 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sabithpkcmnr.webviewmaster">
xmlns:tools="http://schemas.android.com/tools"
package="com.sawalasln.slnepay">

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

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:icon="@drawable/logo"
android:hardwareAccelerated="true"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:requestLegacyExternalStorage="true"
android:roundIcon="@mipmap/ic_launcher_round"
android:roundIcon="@drawable/logo"
android:supportsRtl="true"
android:theme="@style/ThemeApp">
android:theme="@style/ThemeApp"
tools:targetApi="n">
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-6731891492361040~3798406912"/>

<activity android:name=".ActivityHome"
<activity android:name="com.sawalasln.slnepay.ActivityHome"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sabithpkcmnr.webviewmaster;
package com.sawalasln.slnepay;

import android.content.DialogInterface;
import android.content.Intent;
Expand All @@ -7,6 +7,7 @@
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
Expand All @@ -22,8 +23,20 @@
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.progressindicator.LinearProgressIndicator;

public class ActivityHome extends AppCompatActivity {
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.InterstitialAd;
import com.google.android.gms.ads.MobileAds;
import com.google.android.gms.ads.initialization.InitializationStatus;
import com.google.android.gms.ads.initialization.OnInitializationCompleteListener;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

public class ActivityHome extends AppCompatActivity {
private AdView mAdView;
private InterstitialAd mInterstitialAd;
WebView superWebView;
LinearProgressIndicator superProgressBar;

Expand All @@ -37,14 +50,44 @@ protected void onCreate(Bundle savedInstanceState) {
superProgressBar = findViewById(R.id.myProgressBar);
superProgressBar.setMax(100);

superWebView.loadUrl("https://www.google.com");
superWebView.loadUrl("https://www.google.lk/search?q=epay.navy.lk");
superWebView.getSettings().setJavaScriptEnabled(true);
MobileAds.initialize(this, new OnInitializationCompleteListener() {
@Override
public void onInitializationComplete(InitializationStatus initializationStatus) {
}
});

mAdView = findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);

prepaperAD();

ScheduledExecutorService scheduledExecutorService =
Executors.newSingleThreadScheduledExecutor();
scheduledExecutorService.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
runOnUiThread(new Runnable() {
@Override
public void run() {
if (mInterstitialAd.isLoaded()) {
mInterstitialAd.show();
} else {
Log.d("TAG", "Interstital not Loaded");
}
prepaperAD();
}
});
}
}, 60, 60, TimeUnit.SECONDS);
superWebView.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
superProgressBar.setVisibility(View.GONE);
getSupportActionBar().setSubtitle(url);
//getSupportActionBar().setSubtitle(getTitle());
}
});
superWebView.setWebChromeClient(new WebChromeClient() {
Expand Down Expand Up @@ -132,4 +175,10 @@ public void onClick(DialogInterface dialog, int which) {

}
}

public void prepaperAD() {
mInterstitialAd = new InterstitialAd(this);
mInterstitialAd.setAdUnitId("ca-app-pub-6731891492361040/2000441212");
mInterstitialAd.loadAd(new AdRequest.Builder().build());
}
}
Binary file added app/src/main/res/drawable/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 14 additions & 2 deletions app/src/main/res/layout/activity_home.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand All @@ -16,4 +16,16 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />

</LinearLayout>
<com.google.android.gms.ads.AdView

xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="ca-app-pub-6731891492361040/1091534282">
</com.google.android.gms.ads.AdView>

</RelativeLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">WebView Master</string>
<string name="app_name">My Pay Slip</string>
</resources>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sabithpkcmnr.webviewmaster;
package com.sawalasln.slnepay;

import org.junit.Test;

Expand Down