|
1 | | -# sense-user-activity-android |
| 1 | +## Sense - Android SDK |
| 2 | + |
| 3 | +Sense is a device intelligence and identification tool. This tool collects a comprehensive set of attributes unique to a device or browser, forming an identity that will help businesses. |
| 4 | +Requirements |
| 5 | + |
| 6 | +``` |
| 7 | +* Use Android 5.1 (API level 21) and above. |
| 8 | +* Use Kotlin version 1.6.10 and above. |
| 9 | +* Add READ_PHONE_STATE Permission in Android Manifest for deivce information(Optional) |
| 10 | +``` |
| 11 | + |
| 12 | +Note: If the application does not have the listed permissions, the values collected using those permissions will be ignored. To provide a valid device details, we recommend employing as much permission as possible based on your use-case. |
| 13 | + |
| 14 | +#### Step 1 - Add Dependency |
| 15 | + |
| 16 | +Add the dependency in the app level build.gradle: |
| 17 | + |
| 18 | +``` |
| 19 | +dependencies { |
| 20 | + implementation 'co.getsense:android:0.0.6' |
| 21 | +} |
| 22 | +``` |
| 23 | + |
| 24 | +#### Step 2 - Import SDK |
| 25 | + |
| 26 | +``` |
| 27 | +import co.getsense.android.Sense |
| 28 | +import co.getsense.android.SenseConfig |
| 29 | +``` |
| 30 | + |
| 31 | +#### Step 3 - Initialize SDK |
| 32 | + |
| 33 | +Add the following line of code to initialize it with the api key you obtained from the Sense Client panel. If you don't have a api key create new one. |
| 34 | + |
| 35 | +``` |
| 36 | +val config = SenseConfig( |
| 37 | + apiKey = "Your API Key", |
| 38 | + senseInfo = true, // true or false |
| 39 | + allowGeoLocation = true, // true or false |
| 40 | + tag = ""// Whatever you need, just mention the string here like home, contact, etc. |
| 41 | +) |
| 42 | +Sense.initSDK(activity, config) |
| 43 | +``` |
| 44 | + |
| 45 | +#### Step 4 - Get Device Details |
| 46 | + |
| 47 | +Use the below code to get the Device Details |
| 48 | + |
| 49 | +``` |
| 50 | +Sense.getSenseDetails(this) |
| 51 | +``` |
| 52 | + |
| 53 | +#### Step 5 - Implement Listener |
| 54 | + |
| 55 | +Set and Implement our listener to receive the Callback details |
| 56 | + |
| 57 | +``` |
| 58 | +Sense.getDeviceDetails(object : Sense.SenseListener { |
| 59 | + override fun onSuccess(data: String) { |
| 60 | + // success callback |
| 61 | + } |
| 62 | + override fun onFailure(message: String) { |
| 63 | + // failure callback |
| 64 | + } |
| 65 | +}) |
| 66 | +``` |
| 67 | + |
| 68 | +#### Step 6 - Location Permission (Optional) |
| 69 | + |
| 70 | +```` |
| 71 | +You have to add this permission in AndroidManifest.xml to get Device Location Information and to get Retrieve call state, Network state, Network information, Sim datas from READ_PHONE_STATE and READ_PRIVILEGED_PHONE_STATE. |
| 72 | +
|
| 73 | +<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> |
| 74 | +<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> |
| 75 | +<uses-permission android:name="android.permission.READ_PHONE_STATE" /> |
| 76 | +<uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE" |
| 77 | +tools:ignore="ProtectedPermissions"/> |
| 78 | +
|
| 79 | +```` |
| 80 | + |
| 81 | +#### Step 7 - Progurad Rules (Optional) |
| 82 | + |
| 83 | +If you encounter any problem in your integration related to Proguard, you can use add the below lines Proguard Rules. |
| 84 | + |
| 85 | +``` |
| 86 | +-keep,allowobfuscation,allowshrinking interface retrofit2.Call |
| 87 | +-keep,allowobfuscation,allowshrinking class retrofit2.Response |
| 88 | +-keep,allowobfuscation,allowshrinking class kotlin.coroutines.** { *; } |
| 89 | +-dontwarn co.getsense.** |
| 90 | +-keep class co.getsense.** {*;} |
| 91 | +``` |
| 92 | + |
| 93 | +#### Sample Program |
| 94 | + |
| 95 | +Here you can find the demonstration to do the integration. |
| 96 | + |
| 97 | +``` |
| 98 | +import co.getsense.android.Sense |
| 99 | +import co.getsense.android.SenseConfig |
| 100 | +
|
| 101 | +class MainActivity : AppCompatActivity() { |
| 102 | + override fun onCreate(savedInstanceState: Bundle?) { |
| 103 | + super.onCreate(savedInstanceState) |
| 104 | + setContentView(R.layout.activity_main) |
| 105 | +
|
| 106 | + val config = SenseConfig( |
| 107 | + apiKey = "Your API Key", //Replace with your Client Public API Key |
| 108 | + senseInfo = true, // true or false |
| 109 | + allowGeoLocation = true, // true or false |
| 110 | + tag = ""// Whatever you need, just mention the string here like home, contact, etc. |
| 111 | + ) |
| 112 | +
|
| 113 | + //Initialize SDK |
| 114 | + Sense.initSDK(this, config) |
| 115 | +
|
| 116 | + // Fetch device details |
| 117 | + getDeviceDtails(); |
| 118 | + } |
| 119 | + private fun getDeviceDtails() { |
| 120 | + Sense.getDeviceDetails(object : Sense.SenseListener { |
| 121 | + override fun onSuccess(data: String) { |
| 122 | + // Handle success callback |
| 123 | + } |
| 124 | + override fun onFailure(message: String) { |
| 125 | + // Handle failure callback |
| 126 | + } |
| 127 | + }) |
| 128 | + } |
| 129 | +} |
| 130 | +``` |
| 131 | + |
| 132 | +# sense-device-identity |
| 133 | +<h1 align="center">Understanding User Intent : Sense</h1> |
| 134 | + |
| 135 | +<p align="center" width="100%"> |
| 136 | +<img width="9%" src="https://custom-icon-badges.demolab.com/github/license/denvercoder1/custom-icon-badges?logo=law"> <img width="12%" src="https://custom-icon-badges.demolab.com/github/last-commit/DenverCoder1/custom-icon-badges?logo=history&logoColor=white"> <img width="10%" src="https://custom-icon-badges.demolab.com/github/issues-raw/DenverCoder1/custom-icon-badges?logo=issue"> <img width="9%" src="https://custom-icon-badges.demolab.com/github/actions/workflow/status/DenverCoder1/custom-icon-badges/ci.yml?branch=main&logo=check-circle-fill&logoColor=white"> |
| 137 | +</p> |
| 138 | + |
| 139 | +<h2 align="center">Welcome to Sense’s open source repository</h2> |
| 140 | + |
| 141 | +<p align="center" width="100%"> |
| 142 | +<img width="4.5%" src="https://custom-icon-badges.demolab.com/badge/Fork-orange.svg?logo=fork"> <img width="4.5%" src="https://custom-icon-badges.demolab.com/badge/Star-yellow.svg?logo=star"> <img width="6.5%" src="https://custom-icon-badges.demolab.com/badge/Commit-green.svg?logo=git-commit&logoColor=fff"> |
| 143 | +</p> |
| 144 | + |
| 145 | +<p style="text-align:center;"> |
| 146 | + |
| 147 | + |
| 148 | +<p align="center"> Sense is a client side library that enables you to identify users by pinpointing their hardware and software characteristics. This is done by computing a token that stays consistent in spite of any manipulation.</p> |
| 149 | +<p align="center"> This tracking method works even in the browser's incognito mode and is not cleared by flushing the cache, closing the browser or restarting the operating system, using a VPN or installing AdBlockers. Sense is available as SenseOS for every open source requirement and is different from Sense PRO, our extremely accurate and detailed product.</p> |
| 150 | + |
| 151 | + |
| 152 | +<p align="center"> Sense’s real time demo : https://pro.getsense.co/ |
| 153 | + |
| 154 | +*** Try visiting the same page in an incognito mode or switch on the VPN and |
| 155 | +notice how the visitor identifier remains the same in spite of all these changes!*** |
| 156 | + |
| 157 | +<h3 align="center">Getting started with Sense </h3> |
| 158 | + |
| 159 | +``` |
| 160 | +(code snippet) |
| 161 | +``` |
| 162 | +<h3 align="center">Run this code here : (sandbox environment to check and verify the code)</h3> |
| 163 | + |
| 164 | +<h4 align="center">Plug and play, in just 3 steps</h3> |
| 165 | + |
| 166 | +1️⃣ Visit the Git hub repository for the desired function : Validate your desired repository |
| 167 | +2️⃣ Download the code as a ZIP file : Host/clone the code in your local system or website |
| 168 | +3️⃣ Run the installer : Start testing the accuracy of your desired metrics |
| 169 | + |
| 170 | +#### With Sense, you can |
| 171 | + |
| 172 | +✅ Predict user intent : Identify the good from the bad visitors with precision |
| 173 | +✅ Create user identities : Tokenise events with a particular user and device |
| 174 | +✅ Custom risk signals : Developer specific scripts that perform unique functions |
| 175 | +✅ Protect against Identity spoofing : Prevent users from impersonation |
| 176 | +✅ Stop device or browser manipulation : Detect user behaviour anomalies |
| 177 | + |
| 178 | +### Resources |
| 179 | + |
| 180 | +#### MIT license : |
| 181 | + |
| 182 | +#### Contributors code of conduct : |
| 183 | + |
| 184 | +#### Where you can get support : |
| 185 | + product@getsense.co |
| 186 | + |
| 187 | +#### Contributing guidelines : |
| 188 | + |
| 189 | +#### What's New : |
| 190 | + |
| 191 | +[02/24/2025]: Face parameters update |
| 192 | +``` |
| 193 | +We’ve trained the model for an increased accuracy of 94%. |
| 194 | +
|
| 195 | +Here’s the installation steps : |
| 196 | +
|
| 197 | +1. Click on the download link |
| 198 | +2. Download the model file and push it to the file directory |
| 199 | +3. Run the file file |
| 200 | +4. Restart the docker |
| 201 | +
|
| 202 | +``` |
| 203 | +[08/27/2024]: User behavior added signals |
| 204 | +``` |
| 205 | +A new set of signals that track the user behaviour data has been |
| 206 | +added to the code. These signals analyse the typing speed and the |
| 207 | +duration between letter clicks on the keyboard |
| 208 | +
|
| 209 | +``` |
0 commit comments