Skip to content

Commit c3a8e49

Browse files
committed
Cordova 11: Updated Exercise
1 parent 48cefdf commit c3a8e49

Some content is hidden

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

73 files changed

+2061
-16
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,17 @@ Apache Cordova is an open-source mobile development framework. It allows you to
2222
* cordova-ios - 6.2.0
2323
* Gradle - 7.4
2424

25-
25+
# Exerices:
26+
* cordova create ex1 dev.instilllearning.cordova.ex1 ilHelloWorld
27+
* cordova create ex2 dev.instilllearning.cordova.ex2 ilDigitalClock
28+
* cordova create ex3 dev.instilllearning.cordova.ex3 ilAnalogClock
29+
* cordova create ex4 dev.instilllearning.cordova.ex4 ilDeviceInfo
30+
* cordova create ex5 dev.instilllearning.cordova.ex5 ilNetworkInfo
31+
* cordova create ex6 dev.instilllearning.cordova.ex6 ilInAppBrowser
32+
* cordova create ex7 dev.instilllearning.cordova.ex7 ilCameraPlugin
33+
* cordova create ex8 dev.instilllearning.cordova.ex8 ilRESTApiUsingFetch
34+
* cordova create ex9 dev.instilllearning.cordova.ex9 ilCustonPlugin1
35+
* cordova create ex10 dev.instilllearning.cordova.ex10 ilCustonPlugin2
2636

2737
# Instructions
2838
This repository has only master branch containing all examples. You can clone the repository and go to individual example's root folder and run it.

config.xml

Lines changed: 0 additions & 11 deletions
This file was deleted.

ex1/.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
19+
.DS_Store
20+
21+
# Generated by package manager
22+
node_modules/
23+
24+
# Generated by Cordova
25+
/plugins/
26+
/platforms/

ex1/config.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version='1.0' encoding='utf-8'?>
2+
<widget id="dev.instilllearning.cordova.ex1" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
3+
<name>ilHelloWorld</name>
4+
<description>Apache Cordova - Build Hybrid Mobile App for Android and iOS</description>
5+
<author email="courses@instilllearning.dev" href="https://courses.instilllearning.dev/">
6+
Instill Learning
7+
</author>
8+
<content src="index.html" />
9+
<allow-intent href="http://*/*" />
10+
<allow-intent href="https://*/*" />
11+
</widget>
Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json renamed to ex1/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "io.cordova.hellocordova",
3-
"displayName": "HelloCordova",
2+
"name": "dev.instilllearning.cordova.ex1",
3+
"displayName": "ilHelloWorld",
44
"version": "1.0.0",
55
"description": "A sample Apache Cordova application that responds to the deviceready event.",
66
"main": "index.js",

ex1/www/css/index.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
h1 {
2+
Color: Blue
3+
}
File renamed without changes.

ex1/www/index.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *; img-src 'self' data: content:;">
6+
<meta name="format-detection" content="telephone=no">
7+
<meta name="msapplication-tap-highlight" content="no">
8+
<meta name="viewport" content="initial-scale=1, width=device-width, viewport-fit=cover">
9+
<meta name="color-scheme" content="light dark">
10+
<link rel="stylesheet" href="css/index.css">
11+
<title>Hello World</title>
12+
</head>
13+
<body style="text-align:center">
14+
15+
<h1><a href="https://courses.instilllearning.dev/">Instill Learning</a></h1>
16+
<h2>Hello World</h2>
17+
<script src="cordova.js"></script>
18+
<script src="js/index.js"></script>
19+
</body>
20+
</html>

ex1/www/js/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
document.addEventListener('deviceready', onDeviceReady, false);
2+
3+
function onDeviceReady() {
4+
console.log('Hello World!');
5+
console.log('Running cordova-' + cordova.platformId + '@' + cordova.version);
6+
}

0 commit comments

Comments
 (0)