Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.1.0 - Merge dev into master #45

Merged
merged 76 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
4e96768
Update README.md
aminekarimii Jun 21, 2023
beee358
create maven central scripts
aminekarimii Jul 13, 2023
7e870d9
Update publish scripts
aminekarimii Jul 15, 2023
104752e
Resolve conflicts
aminekarimii Jul 16, 2023
29b70d6
Update readme file
aminekarimii Jul 16, 2023
1eac983
Update README.md
aminekarimii Jul 16, 2023
1143ff0
Merge pull request #35 from aminekarimii/dev-maven-central
aminekarimii Jul 16, 2023
9d088d3
Merge branch 'dev' into aminekarimii-patch-2
aminekarimii Jul 16, 2023
926945e
Fix merge conflicts
aminekarimii Jul 16, 2023
622661a
Fix merge conflicts
aminekarimii Jul 16, 2023
23f472f
Merge pull request #34 from aminekarimii/aminekarimii-patch-2
aminekarimii Jul 16, 2023
62c7baf
Update README.md
aminekarimii Jul 18, 2023
64c69b8
Create README.md
aminekarimii Jul 18, 2023
8ccfe6a
Update README.md
aminekarimii Jul 18, 2023
9b2dffb
Update README files
aminekarimii Jul 18, 2023
011a6ee
Merge pull request #38 from aminekarimii/aminekarimii-patch-3
aminekarimii Jul 24, 2023
da9121c
Create app visor package with default activity
aminekarimii Feb 9, 2024
5011feb
Link app visor to the sample app
aminekarimii Feb 9, 2024
50a5eb1
Merge branch 'dev' into feature/events-app-log-shortcut
aminekarimii Feb 9, 2024
0ec441a
Update targetSdk & compileSdk & kotlin
aminekarimii Feb 10, 2024
f42f3ef
Create app visor recyclerview
aminekarimii Feb 10, 2024
ef25916
Move Analytiks parameters to Builder
aminekarimii Feb 12, 2024
10a8e23
[wip] intercept events
aminekarimii Feb 12, 2024
46d0870
[wip] create LoggingAnalytiksInterceptor to provide the log history t…
aminekarimii Feb 12, 2024
d55101f
change shortcut id, short label, and long label
aminekarimii Feb 12, 2024
7c5f2e2
switch the implementation to the Builder version in the sample app
aminekarimii Feb 12, 2024
eb403a1
change item event color
aminekarimii Feb 12, 2024
f152218
implement core analytiks in the app visor lib
aminekarimii Feb 12, 2024
e6c8064
Provide analytiks via hilt
aminekarimii Feb 12, 2024
ea831b8
Create app visor data collector and link it with interceptor
aminekarimii Feb 16, 2024
7e346f9
Display date time of the logged events
aminekarimii Feb 16, 2024
8ec0ac8
Display date time of the logged events
aminekarimii Feb 16, 2024
61aec79
Replace the string in interceptAndLog to EventLog object
aminekarimii Feb 17, 2024
c26bf26
Add eventParams textView
aminekarimii Feb 17, 2024
28dd221
Log reset event
aminekarimii Feb 17, 2024
3184e3f
Remove unused dependency: constraintlayout:constraintlayout
aminekarimii Feb 17, 2024
04728b0
Enhance item_event.xml UI
aminekarimii Feb 17, 2024
5646de8
Fix EventAdapter
aminekarimii Feb 19, 2024
2f453e5
Update README.md
aminekarimii Feb 21, 2024
7184e08
Apply interceptor to all Analytiks events
aminekarimii Feb 23, 2024
73d75e1
Delete AppVisorController.kt
aminekarimii Feb 23, 2024
196e3aa
Logs the analytics clients
aminekarimii Feb 23, 2024
66a7ea4
Moved events formating to AppVisorDataCollector
aminekarimii Feb 23, 2024
805d137
Merge remote-tracking branch 'origin/feature/events-app-log-shortcut'…
aminekarimii Feb 23, 2024
76460aa
Improve showing events logs
aminekarimii Feb 26, 2024
251e64f
Add new event triggers
aminekarimii Feb 26, 2024
604d030
Remove clients header ui
aminekarimii Feb 26, 2024
e83aa9a
Remove events props (to be implemented in v2)
aminekarimii Feb 26, 2024
9fe0df4
Display addons as icons
aminekarimii Feb 26, 2024
5363d43
Code formating
aminekarimii Feb 26, 2024
28606a4
[wip] Initialize custom adapter to display the specific view of each …
aminekarimii Feb 26, 2024
5443a9c
Update README.md
aminekarimii Mar 1, 2024
2812ec7
Merge pull request #42 from aminekarimii/aminekarimii-update-readme
aminekarimii Mar 1, 2024
d4b730f
Show the last sent event first
aminekarimii Mar 1, 2024
6cce053
Get rid of the EventLog mapping and display items based on getItemVie…
aminekarimii Mar 1, 2024
4de99ba
Change the custom addon icon
aminekarimii Mar 4, 2024
2ab8005
Complete the final UI target
aminekarimii Mar 4, 2024
12be4cd
Open Analytiks readme on link click
aminekarimii Mar 4, 2024
352e3e6
Display readme link underline
aminekarimii Mar 4, 2024
afdcfaf
Rename AppVisor activity and move createShortcut to AppVisor
aminekarimii Mar 4, 2024
0741348
Send event name in the message param
aminekarimii Mar 4, 2024
6de77b3
Ui enhancement
aminekarimii Mar 4, 2024
d925a23
Set button events
aminekarimii Mar 4, 2024
5b68f33
Add property numbering to logEvent method with properties
yessinej Mar 5, 2024
3beaead
Rename AppVisor to AnalytiksVisor
aminekarimii Mar 5, 2024
5658b59
Update README.md
aminekarimii Mar 5, 2024
28ede93
Update README.md
aminekarimii Mar 5, 2024
16190b1
Merge pull request #43 from apachi1444/feature/fix-timber-log-event-w…
aminekarimii Mar 6, 2024
b908d8b
Add the missing service icons
aminekarimii Mar 8, 2024
eed6987
Implement publish-module to appvisor addon
aminekarimii Mar 12, 2024
bb45df7
Merge branch 'dev' into feature/events-app-log-shortcut
aminekarimii Mar 13, 2024
d77dff3
Merge pull request #40 from aminekarimii/feature/events-app-log-shortcut
aminekarimii Mar 13, 2024
c627104
Moved publish variables to gradle.properties
aminekarimii Mar 13, 2024
9ea9108
Moved publish-module script impl in amplitude outside android
aminekarimii Mar 13, 2024
32a7e04
Remove the generic oss variable from analytiks module
aminekarimii Mar 13, 2024
e8d4252
Merge pull request #44 from aminekarimii/feature/improve-oss-publish-…
aminekarimii Mar 13, 2024
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.iml
*.gpg
.gradle
/local.properties
/.idea
Expand Down
152 changes: 110 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,78 +1,137 @@
# <p align="center"> 📊Analytiks</p>
<p align="center">
<a href="https://github.com/skydoves/PowerSpinner/actions"><img alt="Build Status" src="https://github.com/aminekarimii/analytiks/workflows/Android%20CI/badge.svg"/></a>
<a href="https://jitpack.io/#aminekarimii/Analytiks"><img alt="JitPack version" src="https://jitpack.io/v/aminekarimii/Analytiks.svg"/></a>
<a href="https://github.com/aminekarimii/analytiks/actions"><img alt="Build Status" src="https://github.com/aminekarimii/analytiks/workflows/Android%20CI/badge.svg"/></a>
</p>

![Analytiks cover illustration](https://user-images.githubusercontent.com/20410115/228402805-3309d17a-0bc5-4404-90f8-20c9b30e33a9.png)
![Group 54 (1)](https://user-images.githubusercontent.com/20410115/228402805-3309d17a-0bc5-4404-90f8-20c9b30e33a9.png)

## ✏️ Description
An android library that centralizes analytics services in one place can be a useful tool for developers who want to track the usage and performance of their app.
Should be easy as it sounds, a single implementation to start with the base analytics core features, and then you can add each analytics service separately (to preserve library size).
## 💭 Overview

An android library that centralizes analytics services in one place can be a useful tool for
developers who want to track the usage and performance of their app.
Should be easy as it sounds, a single implementation to start with the base analytics core features,
and then you can add each analytic service separately (to preserve library size).
A debug analytics mode that can log the same properties in the debug console.

![Scheme of the library logic](https://user-images.githubusercontent.com/20410115/225161402-d3a7d24f-da0d-4360-abab-fe86c68f0214.png)

## 📥 Download
Add it in your root ```build.gradle``` at the end of repositories:
```gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
and in your app level ```build.gradle``` file, add:
[![Release](https://img.shields.io/maven-central/v/io.github.aminekarimii/analytiks)](https://img.shields.io/maven-central/v/io.github.aminekarimii/analytiks)

In your app level ```build.gradle``` file, add:

```gradle
dependencies {
implementation 'com.github.aminekarimii.analytiks:analytiks:{LATEST-VERSION}'

// You can add each addon separately as following:
implementation 'com.github.aminekarimii.analytiks:analytiks-googleanalytics:{LATEST-VERSION}' // Optional Firebase Analytics addon
implementation 'com.github.aminekarimii.analytiks:analytiks-segment:{LATEST-VERSION}' // Optional Segment addon

// Add any other optional addons here using this pattern:
// com.github.aminekarimii.analytiks:analytiks-<ADDON-NAME>:<LATEST-VERSION>
implementation 'io.github.aminekarimii:analytiks:VERSION'
implementation 'io.github.aminekarimii:analytiks-core:VERSION'

// You can add each Addon separately as following:
implementation 'io.github.aminekarimii:analytiks-addon-googleanalytics:VERSION'
implementation 'io.github.aminekarimii:analytiks-addon-mixpanel:VERSION'
implementation 'io.github.aminekarimii:analytiks-addon-timber:VERSION'
implementation 'io.github.aminekarimii:analytiks-addon-segment:VERSION'
}
```

## 🔌 Setup
1- In your activity, initiate the Analytiks library and keep an object to be used after as following:

1. In your activity, initiate the Analytiks library and keep an object to be used after as
following:

```kotlin
private lateinit var analytiks: Analytiks

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// ...
val clients = listOf(
TimberLocalClient(),
MixpanelAnalyticsClient(token = "YOUR_TOKEN")
// Your addons
)

analytiks = Analytiks(clients)
analytiks = Analytiks.Builder()
.addClient(CustomAnalytiksAddon())
.addClient(MixpanelAnalyticsClient(token = "YOUR_TOKEN"))
.addClient(
SegmentAnalyticsClient(
token = "YOUR_TOKEN",
flushIntervalInSeconds = 5,
trackApplicationLifecycleEvents = true,
)
)
}
```
2- Initialize the addons

2. Initialize the addons

```kotlin
analytiks.initialize(this.applicationContext)
```

3- You're good to go!
3. You're good to go!

```kotlin
analytiks.logEvent("your_event_name")
// ...
analytiks.pushAll()
```

## 🪄 Features
The list of features provided by the library
- **Initialization:** `init` Initialize the "analytiks" library, along with its sub-libraries, during the initialization process.
## 🧪 Features

The list of features provided by the library

- **Initialization:** `init` Initialize the "analytiks" library, along with its sub-libraries,
during the initialization process.
- **Log event:** `event` send/save an event with a name and an optional set of properties.
- **Identify user:** `identify` Identify the current user by the given id or a random uuid in case of an empty one.
- **Identify user:** `identify` Identify the current user by the given ID or a random UUID in case
of an empty one.
- **Set user property:** `setUserProperty` Sets a key value property to the identified user.
- **Reset:** `reset` the plugins and remove the default users configuration.
- **Flush events** `pushAll` send the recorded local data to the service servers on call.
- **Reset:** `reset` the plugins and remove the default user's configuration.
- **Flush events** `flush` sends the recorded local data to the service servers on call.

## 🔍 AnalytiksVisor
<details>
<summary><strong> Events App Log Shortcut</strong> (expand) </summary>
See what's happening in your app in real-time with Analytiks AppVisor. It's essentially your go-to for tracking events, serving as a local logger to make sure everything's logged just right, from the initialization to the events push with the exact date & time.

### Key Features

- **Event Visualization**: Easily view all recorded events within your application in a simple and intuitive UI.
#### 🚧 Coming up
- **Event Sharing**: Share specific events as text directly from the app visor, facilitating seamless collaboration among team members.
- **New Event Notifications**: Receive notifications for new events to stay updated on your app's activity without constant manual checks.

### Getting Started

To integrate this feature into your application, follow the steps below:

1. **Add Dependency**: Ensure your `build.gradle` file includes the `analytiks-addon-appvisor` module as a dependency:

```groovy
dependencies {
implementation 'io.github.aminekarimii:analytiks-addon-appvisor:{LATEST_VERSION}'
}
```

2. **Initialization**: Initialize AnalytiksVisor and add the interceptor to your Analytiks configuration:

```kotlin
Analytiks.Builder()
.addInterceptor(AppVisorActivity.initialize())
// ...
.build()
```

3. **Create Shortcut**: to create AnalytiksVisor Shortcut, add:

```kotlin
class AnalytiksApplication : Application() {
override fun onCreate() {
super.onCreate()
AnalytiksVisor.createShortcut(this)
}
}
```

### Video Demo
[Screen_recording_20240305_234527.webm](https://github.com/aminekarimii/analytiks/assets/20410115/944a0f7e-da56-4f64-907a-8df0d803e3b7)

</details>


## 🗃 Supported analytics SDKs
Here's a list of the most known analytics services that we will support in our library.
Expand All @@ -82,7 +141,7 @@ Here's a list of the most known analytics services that we will support in our l
| Segment | ✅ | <a href="./addon/analytiks-segment/README.md">Segment Addon doc</a> | <a href="https://segment.com/docs/connections/sources/catalog/libraries/mobile/kotlin-android/" >Segment doc</a> |
| Mixpanel | ✅ | <a href="./addon/analytiks-mixpanel/README.md">Mixpanel Addon doc</a>| <a href="https://developer.mixpanel.com/docs/android">Mixpanel doc</a> |
| Flurry Analytics | 🚧 | - | - |
| Amplitude | 🚧 | - | - |
| Amplitude | ✅ | <a href="./addon/analytiks-amplitude/README.md">Amplitude Addon doc</a> | <a href="https://www.docs.developers.amplitude.com/data/sdks/sdk-quickstart/">Amplitude doc</a> |
| App Annie | 🚧 | - | - |
| Localytics | 🚧 | - | - |
| AppsFlyer | 🚧 | - | - |
Expand All @@ -93,6 +152,15 @@ Here's a list of the most known analytics services that we will support in our l

➕ Can't find your service? [open an issue](https://github.com/aminekarimii/analytiks/issues/new) with the name and the direct documentation link in the comment section.

## 📫 Contact Information

For any questions, suggestions, or discussions regarding the "Analytiks" library, feel free to reach out through the following channels:

- **Email:** [aminekarimi1998@gmail.com](mailto:aminekarimi1998@gmail.com)
- **LinkedIn:** [aminekarimi](https://www.linkedin.com/in/aminekarimi)
- **Twitter:** [@aminekarimii](https://twitter.com/aminekarimii)
- **GitHub:** [aminekarimii](https://github.com/aminekarimii)

## License 🔖

```
Expand Down
32 changes: 32 additions & 0 deletions addon/analytiks-amplitude/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

<h1 align="center">Amplitude Add-on implementation</h1></br>
<p align="center">
<img src="https://github.com/aminekarimii/analytiks/assets/20410115/1f330afd-c805-4d54-9b74-654192f019b3" width="25%" />
</p>

## Configuration
| Field Name | Description | Default Value |
|----------------------------|------------------------------------------------|---------------|
| token | The token used for tracking events. | - |
| serverGeoZone | The server geo zone for Amplitude server. | ServerGeoZone.EU |
| optOut | Indicates whether opt-out is enabled. | false |
| minTimeBetweenSessionsMillis | Minimum time between sessions in milliseconds. | 10000 |

Note: The default values mentioned above can be overridden by providing custom values during initialization.
## Create Add-on
1. Download Amplitude analytics add-on:
```gradle
implementation 'io.github.aminekarimii:analytiks-amplitude:1.0.0'
```
2. Create your own client:
``` kotlin
class AmplitudeClient(
token: "TOUR_TOKEN",
serverGeoZone = ServerGeoZone.EU,
optOut = false,
minTimeBetweenSessionsMillis = 10000
)
```

### Check the official documentation for more details:
➡️ [Official amplitude analytics](https://www.docs.developers.amplitude.com/data/sdks/sdk-quickstart/)
10 changes: 8 additions & 2 deletions addon/analytiks-amplitude/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@ plugins {
id 'org.jetbrains.kotlin.android'
}

ext {
PUBLISH_ARTIFACT_ID = 'analytiks-core'
}
apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"

android {
namespace 'com.analytiks.addon.amplitude'
compileSdk 33
compileSdk rootProject.compileSdk

defaultConfig {
minSdk 21
targetSdk 33
targetSdk rootProject.targetSdk

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}


buildTypes {
release {
minifyEnabled false
Expand Down
1 change: 1 addition & 0 deletions addon/analytiks-appvisor/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
62 changes: 62 additions & 0 deletions addon/analytiks-appvisor/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
}

ext {
PUBLISH_ARTIFACT_ID = 'analytiks-addon-appvisor'
}
apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"

android {
namespace 'com.analytiks.addon.appvisor'
compileSdk rootProject.compileSdk

defaultConfig {
minSdk 21
targetSdk rootProject.targetSdk

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding true
}
composeOptions {
kotlinCompilerExtensionVersion '1.5.1'
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
}

dependencies {

implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

implementation project(':analytiks-core')
}
21 changes: 21 additions & 0 deletions addon/analytiks-appvisor/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
39 changes: 39 additions & 0 deletions addon/analytiks-appvisor/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<uses-permission
android:name="android.permission.WAKE_LOCK"
android:maxSdkVersion="25" />

<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
</intent>
<intent>
<action android:name="android.intent.action.VIEW" />
<data
android:scheme="https"
android:host="www.github.com" />
</intent>
</queries>

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:theme="@style/Theme.AnalyticsApp">
<activity
android:name="com.analytiks.addon.appvisor.ui.AppVisorActivity"
android:label="@string/app_name"
android:launchMode="singleTask"
android:exported="true"
android:taskAffinity="com.analytiks.addon.appvisor.task"
android:theme="@style/Theme.AnalyticsApp"/>

</application>

</manifest>
Loading
Loading