|
| 1 | +<h1 style="text-align:center;">Sense User Activity - Android</h1> |
| 2 | + |
| 3 | +<p style="text-align:center;width:100%;"> |
| 4 | +<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="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"> |
| 5 | +</p> |
| 6 | + |
| 7 | +<h2 style="text-align:center;">Welcome to Sense's open source repository</h2> |
| 8 | + |
| 9 | +<p style="text-align:center;width:100%;"> |
| 10 | +<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"> |
| 11 | +</p> |
| 12 | + |
| 13 | +<p style="text-align:center;"> |
| 14 | + |
| 15 | + |
| 16 | +<p style="text-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> |
| 17 | +<p style="text-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> |
| 18 | + |
| 19 | + |
| 20 | +<p style="text-align:center;"> Sense’s real time demo : https://pro.getsense.co/ |
| 21 | + |
| 22 | +*** Try visiting the same page in an incognito mode or switch on the VPN and |
| 23 | +notice how the visitor identifier remains the same in spite of all these changes!*** |
| 24 | + |
| 25 | +<h3 style="text-align:center;">Getting started with Sense </h3> |
| 26 | + |
| 27 | + |
| 28 | +## Sense - Android SDK |
| 29 | + |
| 30 | +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. |
| 31 | +Requirements |
| 32 | + |
| 33 | +``` |
| 34 | +* Use Android 5.1 (API level 21) and above. |
| 35 | +* Use Kotlin version 1.6.10 and above. |
| 36 | +* Add READ_PHONE_STATE Permission in Android Manifest for deivce information(Optional) |
| 37 | +``` |
| 38 | + |
| 39 | +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. |
| 40 | + |
| 41 | +#### Step 1 - Add Dependency |
| 42 | + |
| 43 | +Add the dependency in the app level build.gradle: |
| 44 | + |
| 45 | +``` |
| 46 | +dependencies { |
| 47 | + implementation 'io.github.sense-opensource:SenseOSUserActivity:0.0.1' |
| 48 | +} |
| 49 | +``` |
| 50 | + |
| 51 | +#### Step 2 - Import SDK |
| 52 | + |
| 53 | +``` |
| 54 | +import io.github.sense-opensource.SenseOSUserActivity |
| 55 | +
|
| 56 | +``` |
| 57 | + |
| 58 | +#### Step 3 - Initialize SDK |
| 59 | + |
| 60 | +Add the following line of code to initialize it. |
| 61 | + |
| 62 | +``` |
| 63 | +
|
| 64 | +SenseOSUserActivity.initSDK(activity) |
| 65 | +
|
| 66 | +SenseOSUserActivity.initKeyStrokeBehaviour(context, email, password) // Here email and password are id of EditText Fields |
| 67 | +
|
| 68 | +SenseOSUserActivity.initTouchBehaviour(context, touchView) // Here touchView is id of Layout which needs to capture touch metrics |
| 69 | +
|
| 70 | +SenseOSUserActivity.initScrollBehaviour(scrollView) // Here scrollView is id of Layout which needs to capture scroll metrics |
| 71 | +
|
| 72 | +``` |
| 73 | + |
| 74 | +#### Step 4 - Get User Activity Details |
| 75 | + |
| 76 | +Use the below code to get the User Activity Details |
| 77 | + |
| 78 | +``` |
| 79 | +Sense.getBehaviourData(); |
| 80 | +``` |
| 81 | + |
| 82 | +#### Sample Program |
| 83 | + |
| 84 | +Here you can find the demonstration to do the integration. |
| 85 | + |
| 86 | +``` |
| 87 | +import io.github.sense-opensource.SenseOSUserActivity |
| 88 | +import io.github.sense-opensource.SenseOSUserActivityConfig |
| 89 | +
|
| 90 | +class MainActivity : AppCompatActivity() { |
| 91 | + override fun onCreate(savedInstanceState: Bundle?) { |
| 92 | + super.onCreate(savedInstanceState) |
| 93 | + setContentView(R.layout.activity_main) |
| 94 | +
|
| 95 | + //Initialize SDK |
| 96 | + SenseOSUserActivity.initSDK(this) |
| 97 | +
|
| 98 | + val scrollView = view?.findViewById<ScrollView>(R.id.scrollView) |
| 99 | + val touchView = view?.findViewById<LinearLayout>(R.id.touchView) |
| 100 | +
|
| 101 | + val email = view?.findViewById<EditText>(R.id.public_key) |
| 102 | + val password = view?.findViewById<EditText>(R.id.secret_key) |
| 103 | +
|
| 104 | + if (email != null && password != null) { |
| 105 | + SenseOSUserActivity.initKeyStrokeBehaviour(requireContext(), email, password) |
| 106 | + } |
| 107 | + if (touchView != null) { |
| 108 | + SenseOSUserActivity.initTouchBehaviour(requireContext(), touchView) |
| 109 | + } |
| 110 | + if (scrollView != null) { |
| 111 | + SenseOSUserActivity.initScrollBehaviour(scrollView) |
| 112 | + } |
| 113 | +
|
| 114 | + // Fetch device details |
| 115 | + getUserActivityDetails(); |
| 116 | + } |
| 117 | + private fun getUserActivityDetails() { |
| 118 | + val details = SenseOSUserActivity.getBehaviourData(); |
| 119 | + println(details); |
| 120 | + } |
| 121 | +} |
| 122 | +``` |
| 123 | + |
| 124 | +<h4 style="text-align:center;">Plug and play, in just 3 steps</h3> |
| 125 | + |
| 126 | +1️⃣ Visit the Git hub repository for the desired function : Validate your desired repository |
| 127 | +2️⃣ Download the code as a ZIP file : Host/clone the code in your local system or website |
| 128 | +3️⃣ Run the installer : Start testing the accuracy of your desired metrics |
| 129 | + |
| 130 | +#### With Sense, you can |
| 131 | + |
| 132 | +✅ Predict user intent : Identify the good from the bad visitors with precision |
| 133 | +✅ Create user identities : Tokenise events with a particular user and device |
| 134 | +✅ Custom risk signals : Developer specific scripts that perform unique functions |
| 135 | +✅ Protect against Identity spoofing : Prevent users from impersonation |
| 136 | +✅ Stop device or browser manipulation : Detect user behaviour anomalies |
| 137 | + |
| 138 | +### Resources |
| 139 | + |
| 140 | +#### MIT license : |
| 141 | + |
| 142 | +Sense OS is available under the <a href="https://github.com/sense-opensource/sense-device-identity-android/blob/main/LICENSE"> MIT license </a> |
| 143 | + |
| 144 | +#### Contributors code of conduct : |
| 145 | + |
| 146 | +Thank you for your interest in contributing to this project! We welcome all contributions and are excited to have you join our community. Please read these <a href="https://github.com/sense-opensource/sense-device-identity-android/blob/main/code_of_conduct.md"> code of conduct </a> to ensure a smooth collaboration. |
| 147 | + |
| 148 | +#### Where you can get support : |
| 149 | + product@getsense.co |
| 150 | + |
| 151 | +Public Support: |
| 152 | +For questions, bug reports, or feature requests, please use the Issues and Discussions sections on our repository. This helps the entire community benefit from shared knowledge and solutions. |
| 153 | + |
| 154 | +Community Chat: |
| 155 | +Join our Discord server (link) to connect with other developers, ask questions in real-time, and share your feedback on Sense. |
| 156 | + |
| 157 | +Interested in contributing to Sense? |
| 158 | +Please review our <a href="https://github.com/sense-opensource/sense-device-identity-android/blob/main/CONTRIBUTING.md"> Contribution Guidelines </a> to learn how to get started, submit pull requests, or run the project locally. We encourage you to read these guidelines carefully before making any contributions. Your input helps us make Sense better for everyone! |
0 commit comments