Skip to content

Commit dc0d839

Browse files
committed
Initial commit
0 parents  commit dc0d839

File tree

119 files changed

+7836
-0
lines changed

Some content is hidden

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

119 files changed

+7836
-0
lines changed

.gitignore

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Built application files
2+
*.apk
3+
*.aar
4+
*.ap_
5+
*.aab
6+
7+
# Files for the ART/Dalvik VM
8+
*.dex
9+
10+
# Java class files
11+
*.class
12+
13+
# Generated files
14+
bin/
15+
gen/
16+
out/
17+
# Uncomment the following line in case you need and you don't have the release build type files in your app
18+
# release/
19+
20+
# Gradle files
21+
.gradle/
22+
build/
23+
24+
# Local configuration file (sdk path, etc)
25+
local.properties
26+
27+
# Proguard folder generated by Eclipse
28+
proguard/
29+
30+
# Log Files
31+
*.log
32+
33+
# Android Studio Navigation editor temp files
34+
.navigation/
35+
36+
# Android Studio captures folder
37+
captures/
38+
39+
# IntelliJ
40+
*.iml
41+
.idea/workspace.xml
42+
.idea/tasks.xml
43+
.idea/gradle.xml
44+
.idea/assetWizardSettings.xml
45+
.idea/dictionaries
46+
.idea/libraries
47+
# Android Studio 3 in .gitignore file.
48+
.idea/caches
49+
.idea/modules.xml
50+
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
51+
.idea/navEditor.xml
52+
53+
# Keystore files
54+
# Uncomment the following lines if you do not want to check your keystore files in.
55+
#*.jks
56+
#*.keystore
57+
58+
# External native build folder generated in Android Studio 2.2 and later
59+
.externalNativeBuild
60+
.cxx/
61+
62+
# Google Services (e.g. APIs or Firebase)
63+
# google-services.json
64+
65+
# Freeline
66+
freeline.py
67+
freeline/
68+
freeline_project_description.json
69+
70+
# fastlane
71+
fastlane/report.xml
72+
fastlane/Preview.html
73+
fastlane/screenshots
74+
fastlane/test_output
75+
fastlane/readme.md
76+
77+
# Version control
78+
vcs.xml
79+
80+
# lint
81+
lint/intermediates/
82+
lint/generated/
83+
lint/outputs/
84+
lint/tmp/
85+
# lint/reports/
86+
87+
88+
# General
89+
.DS_Store

.idea/.name

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

.idea/compiler.xml

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

.idea/jarRepositories.xml

+25
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/runConfigurations.xml

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

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Trackingplan
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+118
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Trackingplan for Android
2+
3+
## Get started
4+
5+
### Requirements
6+
- Android Studio
7+
- Android SDK
8+
- Android emulator
9+
10+
### Build Trackingplan Adapter (gradle plugin)
11+
12+
```console
13+
$ cd _experimental/d3ce1t/android-client/adapter-plugin
14+
$ ./gradlew clean
15+
$ ./gradlew build
16+
$ ./gradlew publishToMavenLocal
17+
```
18+
19+
### Test
20+
21+
- Run Android Studio
22+
- Open existing project located at `_experimental/d3ce1t/android-client/url-connection-app-example`
23+
- Run application in emulator
24+
- Observe logs in Run tab
25+
26+
### Adding Trackingplan Adapter to another project
27+
28+
- Modify build.gradle at project level (see comments)
29+
30+
```gradle
31+
32+
buildscript {
33+
repositories {
34+
google()
35+
mavenCentral()
36+
mavenLocal() // <-- Add maven local
37+
}
38+
dependencies {
39+
classpath "com.android.tools.build:gradle:4.2.1"
40+
classpath "com.trackingplan.adapter:plugin:0.1" // <-- Add adapter plugin
41+
}
42+
}
43+
44+
allprojects {
45+
repositories {
46+
google()
47+
mavenCentral()
48+
mavenLocal() // <-- Add maven local
49+
}
50+
}
51+
52+
task clean(type: Delete) {
53+
delete rootProject.buildDir
54+
}
55+
```
56+
57+
- Modify build.gradle at module level (see comments)
58+
59+
```gradle
60+
plugins {
61+
id 'com.android.application'
62+
id 'com.trackingplan.adapter' // <-- Apply Trackingplan Adapter plugin
63+
}
64+
65+
android {
66+
compileSdkVersion 30
67+
buildToolsVersion "30.0.3"
68+
69+
defaultConfig {
70+
applicationId "com.example.urlconnectionappexample"
71+
minSdkVersion 16
72+
targetSdkVersion 30
73+
versionCode 1
74+
versionName "1.0"
75+
76+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
77+
}
78+
79+
buildTypes {
80+
release {
81+
minifyEnabled false
82+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
83+
}
84+
}
85+
compileOptions {
86+
sourceCompatibility JavaVersion.VERSION_1_8
87+
targetCompatibility JavaVersion.VERSION_1_8
88+
}
89+
}
90+
91+
dependencies {
92+
implementation 'androidx.appcompat:appcompat:1.3.0'
93+
implementation 'com.google.android.material:material:1.3.0'
94+
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
95+
implementation 'com.trackingplan.adapter:sdk:0.1' // <-- Add SDK dependency
96+
implementation 'commons-io:commons-io:2.9.0'
97+
testImplementation 'junit:junit:4.+'
98+
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
99+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
100+
}
101+
```
102+
103+
- Modify your MainActivity.java
104+
105+
```java
106+
// Import TrackingplanSdk in the top
107+
108+
import com.trackingplan.adapter.sdk.TrackingplanSdk;
109+
110+
// Initialize it in the onCreate method
111+
112+
try {
113+
TrackingplanSdk.init("TPID").withDebugEnabled();
114+
} catch (TrackingplanAlreadyInitializedException e) {
115+
Log.e("MY_APP", e.getMessage());
116+
}
117+
118+
```

adapter/.gitignore

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

adapter/build.gradle

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
plugins {
2+
id 'java-gradle-plugin'
3+
id 'maven-publish'
4+
// id 'java-library-distribution'
5+
}
6+
7+
version "${rootProject.ext.TrackingplanVersion}"
8+
9+
gradlePlugin {
10+
plugins {
11+
TrackingplanAdapterPlugin {
12+
id = 'com.trackingplan.client'
13+
implementationClass = 'com.trackingplan.client.adapter.TrackingplanPlugin'
14+
}
15+
}
16+
}
17+
18+
publishing {
19+
publications {
20+
// Creates a Maven publication called "release".
21+
pluginMaven(MavenPublication) {
22+
23+
afterEvaluate {
24+
groupId = rootProject.ext.groupId
25+
}
26+
27+
pom {
28+
name = "Trackingplan Android Adapter"
29+
description = "Gradle plugin for Trackingplan Android SDK"
30+
url = "https://www.trackingplan.com"
31+
licenses {
32+
license {
33+
name = "MIT License"
34+
url = "http://www.opensource.org/licenses/mit-license.php"
35+
}
36+
}
37+
developers {
38+
developer {
39+
name = "Jose Padilla"
40+
41+
organization = "Trackingplan"
42+
organizationUrl = "https://www.trackingplan.com"
43+
}
44+
}
45+
scm {
46+
connection = 'scm:git:git://example.com/my-library.git'
47+
developerConnection = 'scm:git:ssh://example.com/my-library.git'
48+
url = 'http://example.com/my-library/'
49+
}
50+
}
51+
}
52+
}
53+
}
54+
55+
/*
56+
distributions {
57+
main {
58+
distributionBaseName = 'trackingplan-client'
59+
}
60+
}
61+
*/
62+
63+
dependencies {
64+
compileOnly 'com.android.tools.build:gradle:4.2.0'
65+
implementation 'commons-io:commons-io:2.11.0'
66+
implementation 'org.ow2.asm:asm:9.1'
67+
implementation 'org.ow2.asm:asm-commons:9.1'
68+
}
69+
70+
java {
71+
sourceCompatibility = JavaVersion.VERSION_1_8
72+
targetCompatibility = JavaVersion.VERSION_1_8
73+
}

0 commit comments

Comments
 (0)