Skip to content

Commit 0680d6d

Browse files
ver101
0 parents  commit 0680d6d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1092
-0
lines changed

.gitignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild
14+
.cxx
15+
local.properties

.idea/.gitignore

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.name

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/compiler.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/deploymentTargetDropDown.xml

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/migrations.xml

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
plugins {
2+
id 'com.android.application'
3+
}
4+
5+
android {
6+
namespace 'com.aqyanoos.androidappweb'
7+
compileSdk 34
8+
9+
defaultConfig {
10+
applicationId "com.aqyanoos.androidappweb"
11+
minSdk 19
12+
targetSdk 34
13+
versionCode 1
14+
versionName "1.0.1"
15+
16+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17+
}
18+
19+
buildTypes {
20+
release {
21+
minifyEnabled false
22+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
23+
}
24+
}
25+
compileOptions {
26+
sourceCompatibility JavaVersion.VERSION_1_8
27+
targetCompatibility JavaVersion.VERSION_1_8
28+
}
29+
}
30+
31+
dependencies {
32+
33+
implementation 'androidx.appcompat:appcompat:1.6.1'
34+
implementation 'com.google.android.material:material:1.11.0'
35+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
36+
testImplementation 'junit:junit:4.13.2'
37+
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
38+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
39+
40+
implementation ("androidx.webkit:webkit:1.10.0")
41+
42+
}

app/proguard-rules.pro

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.aqyanoos.androidappweb;
2+
3+
import android.content.Context;
4+
5+
import androidx.test.platform.app.InstrumentationRegistry;
6+
import androidx.test.ext.junit.runners.AndroidJUnit4;
7+
8+
import org.junit.Test;
9+
import org.junit.runner.RunWith;
10+
11+
import static org.junit.Assert.*;
12+
13+
/**
14+
* Instrumented test, which will execute on an Android device.
15+
*
16+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
17+
*/
18+
@RunWith(AndroidJUnit4.class)
19+
public class ExampleInstrumentedTest {
20+
@Test
21+
public void useAppContext() {
22+
// Context of the app under test.
23+
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24+
assertEquals("com.aqyanoos.androidappweb", appContext.getPackageName());
25+
}
26+
}

app/src/main/AndroidManifest.xml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools">
4+
<uses-permission android:name="android.permission.INTERNET"/>
5+
<application
6+
android:allowBackup="true"
7+
android:dataExtractionRules="@xml/data_extraction_rules"
8+
android:fullBackupContent="@xml/backup_rules"
9+
android:icon="@mipmap/ic_launcher"
10+
android:label="@string/app_name"
11+
android:roundIcon="@mipmap/ic_launcher_round"
12+
android:supportsRtl="true"
13+
android:theme="@style/Theme.AndroidAppWeb"
14+
tools:targetApi="31">
15+
<activity
16+
android:name=".MainActivity"
17+
android:exported="true">
18+
<intent-filter>
19+
<action android:name="android.intent.action.MAIN" />
20+
21+
<category android:name="android.intent.category.LAUNCHER" />
22+
</intent-filter>
23+
</activity>
24+
</application>
25+
26+
</manifest>

app/src/main/assets/www/about.html

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<link rel="stylesheet" href="style.css">
8+
</head>
9+
10+
<body>
11+
12+
<header>
13+
<h1>My First Android App</h1>
14+
</header>
15+
16+
<nav>
17+
<a href="index.html">Home</a>
18+
<a href="about.html" class="current">About</a>
19+
</nav>
20+
<section class="main">
21+
<h3>Who Are We?</h3>
22+
<hr>
23+
<p>
24+
We are group of super duper lazy peole.
25+
</p>
26+
27+
<div>
28+
<strong>
29+
These are our main business:
30+
</strong>
31+
</div>
32+
<ol>
33+
<li>Make others work for us</li>
34+
<li>Wake up late</li>
35+
<li>Do nothing</li>
36+
<li>Get paid</li>
37+
<li>Enjoy Delicious foods</li>
38+
</ol>
39+
</section>
40+
41+
<section>
42+
<h3>Follow us on our social Media Platforms:</h3>
43+
<ul id="social-media-links"></ul>
44+
</section>
45+
46+
<footer>
47+
<p>
48+
Created by Aqyanoos.com
49+
</p>
50+
</footer>
51+
52+
<script src="scripts.js"></script>
53+
</body>
54+
55+
</html>

app/src/main/assets/www/index.html

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<link rel="stylesheet" href="style.css">
8+
</head>
9+
10+
<body>
11+
12+
<header>
13+
<h1>My First Android App</h1>
14+
</header>
15+
<nav>
16+
<a href="index.html" class="current">Home</a>
17+
<a href="about.html">About</a>
18+
</nav>
19+
20+
<section class="main">
21+
<h3>How did I create this Android app?</h3>
22+
<hr>
23+
<p>
24+
I have created this Android app using pure html css and js.
25+
</p>
26+
27+
<div>
28+
<strong>
29+
These are the steps to build and Android app with HTML CSS and JavaScript:
30+
</strong>
31+
</div>
32+
<ol>
33+
<li>Create A project</li>
34+
<li>Add webview component in main_activity.xml</li>
35+
<li>Create Assets Folder</li>
36+
<li>Create another folder inside Assets Folder(WWW:optional)</li>
37+
<li>Create Files inside Your Assets Folder</li>
38+
<li>Add content to your files</li>
39+
<li>Write the logic to bring your web content into webview component</li>
40+
<li>Handle the navigation</li>
41+
<li>Handle the user interface interactions using JS</li>
42+
<li>Link JS to Java</li>
43+
<li>Test The app</li>
44+
<li>Publish</li>
45+
</ol>
46+
</section>
47+
48+
<footer>
49+
<p>
50+
Created by Aqyanoos.com
51+
</p>
52+
</footer>
53+
54+
<script src="scripts.js"></script>
55+
</body>
56+
57+
</html>

app/src/main/assets/www/scripts.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
const socialMediaListEl = document.getElementById("social-media-links")
3+
4+
5+
6+
try {
7+
const links = Android.SocialMediaLinks()
8+
const linksArray = links.split(";")
9+
linksArray.forEach(link => {
10+
const liEl = document.createElement("li")
11+
const linkItems = link.split("&")
12+
liEl.innerHTML = "<a href='" + linkItems[0] + "'> " + linkItems[1] + "</a>"
13+
socialMediaListEl.appendChild(liEl)
14+
});
15+
} catch (e) {
16+
console.log("Could not get the links: ", e)
17+
socialMediaListEl.innerHTML = "Could not get the links"
18+
}

app/src/main/assets/www/style.css

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
body {
2+
margin: 0;
3+
padding: 0;
4+
font-family: Verdana, Tahoma, Arial;
5+
font-size: 16px;
6+
background: #eee;
7+
line-height: 25px;
8+
letter-spacing: 1px;
9+
}
10+
11+
header,
12+
footer {
13+
background-color: #005050;
14+
color: #fff;
15+
text-align: center;
16+
padding: 10px 0;
17+
line-height: 35px;
18+
}
19+
20+
.main {
21+
padding: 10px;
22+
}
23+
24+
nav {
25+
display: flex;
26+
align-items: center;
27+
justify-content: center;
28+
margin: 20px 10px;
29+
}
30+
31+
nav a {
32+
margin-left: 10px;
33+
text-decoration: none;
34+
}
35+
36+
.current {
37+
background: #008cff;
38+
color: white;
39+
}

0 commit comments

Comments
 (0)