├── .github └── workflows │ ├── android.yml │ └── detekt-analysis.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── SECURITY.md ├── SUPPORT.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── microsoft │ │ └── office │ │ └── outlook │ │ └── magnifier │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── office │ │ │ └── outlook │ │ │ └── magnifier │ │ │ └── MainActivity.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── values-night │ │ └── themes.xml │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── themes.xml │ └── test │ └── java │ └── com │ └── microsoft │ └── office │ └── outlook │ └── magnifier │ └── ExampleUnitTest.kt ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── magnifierlib ├── .gitignore ├── build.gradle ├── consumer-rules.pro ├── gradle.properties ├── proguard-rules.pro ├── publish.gradle └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── microsoft │ │ └── office │ │ └── outlook │ │ └── magnifierlib │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── microsoft │ │ │ └── office │ │ │ └── outlook │ │ │ └── magnifierlib │ │ │ ├── Magnifier.kt │ │ │ ├── Permissions.kt │ │ │ ├── frame │ │ │ ├── FPSMonitor.kt │ │ │ ├── FPSMonitorConfig.kt │ │ │ ├── FrameCalculator.kt │ │ │ └── FrameViewer.kt │ │ │ └── memory │ │ │ ├── FileDescriptorMetricCollector.kt │ │ │ ├── HeapMetricCollector.kt │ │ │ ├── MemoryMonitor.kt │ │ │ ├── MemoryMonitorConfig.kt │ │ │ ├── MemorySampler.kt │ │ │ ├── MemorySamplersFactory.kt │ │ │ ├── MemoryUtils.kt │ │ │ ├── SamplePolicy.kt │ │ │ └── ThreadMetricCollector.kt │ └── res │ │ ├── drawable │ │ ├── fps_bad.xml │ │ ├── fps_good.xml │ │ └── fps_medium.xml │ │ ├── layout │ │ └── frame_view.xml │ │ └── values │ │ └── dimens.xml │ └── test │ └── java │ └── com │ └── microsoft │ └── office │ └── outlook │ └── magnifierlib │ └── ExampleUnitTest.kt └── settings.gradle /.github/workflows/android.yml: -------------------------------------------------------------------------------- 1 | name: Android CI 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v2 16 | - name: set up JDK 11 17 | uses: actions/setup-java@v2 18 | with: 19 | java-version: '11' 20 | distribution: 'adopt' 21 | 22 | - name: Grant execute permission for gradlew 23 | run: chmod +x gradlew 24 | - name: Build with Gradle 25 | run: ./gradlew build 26 | -------------------------------------------------------------------------------- /.github/workflows/detekt-analysis.yml: -------------------------------------------------------------------------------- 1 | # This workflow performs a static analysis of your Kotlin source code using 2 | # Detekt. 3 | # 4 | # Scans are triggered: 5 | # 1. On every push to default and protected branches 6 | # 2. On every Pull Request targeting the default branch 7 | # 3. On a weekly schedule 8 | # 4. Manually, on demand, via the "workflow_dispatch" event 9 | # 10 | # The workflow should work with no modifications, but you might like to use a 11 | # later version of the Detekt CLI by modifing the $DETEKT_RELEASE_TAG 12 | # environment variable. 13 | name: Scan with Detekt 14 | 15 | on: 16 | # Triggers the workflow on push or pull request events but only for default and protected branches 17 | push: 18 | branches: [ main ] 19 | pull_request: 20 | branches: [ main ] 21 | schedule: 22 | - cron: '20 19 * * 1' 23 | 24 | # Allows you to run this workflow manually from the Actions tab 25 | workflow_dispatch: 26 | 27 | env: 28 | # Release tag associated with version of Detekt to be installed 29 | # SARIF support (required for this workflow) was introduced in Detekt v1.15.0 30 | DETEKT_RELEASE_TAG: v1.15.0 31 | 32 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 33 | jobs: 34 | # This workflow contains a single job called "scan" 35 | scan: 36 | name: Scan 37 | # The type of runner that the job will run on 38 | runs-on: ubuntu-latest 39 | 40 | # Steps represent a sequence of tasks that will be executed as part of the job 41 | steps: 42 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 43 | - uses: actions/checkout@v2 44 | 45 | # Gets the download URL associated with the $DETEKT_RELEASE_TAG 46 | - name: Get Detekt download URL 47 | id: detekt_info 48 | env: 49 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 50 | run: | 51 | DETEKT_DOWNLOAD_URL=$( gh api graphql --field tagName=$DETEKT_RELEASE_TAG --raw-field query=' 52 | query getReleaseAssetDownloadUrl($tagName: String!) { 53 | repository(name: "detekt", owner: "detekt") { 54 | release(tagName: $tagName) { 55 | releaseAssets(name: "detekt", first: 1) { 56 | nodes { 57 | downloadUrl 58 | } 59 | } 60 | } 61 | } 62 | } 63 | ' | \ 64 | jq --raw-output '.data.repository.release.releaseAssets.nodes[0].downloadUrl' ) 65 | echo "::set-output name=download_url::$DETEKT_DOWNLOAD_URL" 66 | 67 | # Sets up the detekt cli 68 | - name: Setup Detekt 69 | run: | 70 | dest=$( mktemp -d ) 71 | curl --request GET \ 72 | --url ${{ steps.detekt_info.outputs.download_url }} \ 73 | --silent \ 74 | --location \ 75 | --output $dest/detekt 76 | chmod a+x $dest/detekt 77 | echo $dest >> $GITHUB_PATH 78 | 79 | # Performs static analysis using Detekt 80 | - name: Run Detekt 81 | continue-on-error: true 82 | run: | 83 | detekt --input ${{ github.workspace }} --report sarif:${{ github.workspace }}/detekt.sarif.json 84 | 85 | # Modifies the SARIF output produced by Detekt so that absolute URIs are relative 86 | # This is so we can easily map results onto their source files 87 | # This can be removed once relative URI support lands in Detekt: https://git.io/JLBbA 88 | - name: Make artifact location URIs relative 89 | continue-on-error: true 90 | run: | 91 | echo "$( 92 | jq \ 93 | --arg github_workspace ${{ github.workspace }} \ 94 | '. | ( .runs[].results[].locations[].physicalLocation.artifactLocation.uri |= if test($github_workspace) then .[($github_workspace | length | . + 1):] else . end )' \ 95 | ${{ github.workspace }}/detekt.sarif.json 96 | )" > ${{ github.workspace }}/detekt.sarif.json 97 | 98 | # Uploads results to GitHub repository using the upload-sarif action 99 | - uses: github/codeql-action/upload-sarif@v1 100 | with: 101 | # Path to SARIF file relative to the root of the repository 102 | sarif_file: ${{ github.workspace }}/detekt.sarif.json 103 | checkout_path: ${{ github.workspace }} 104 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 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 | # Android Studio 40 | */.idea/ 41 | 42 | # Keystore files 43 | # Uncomment the following lines if you do not want to check your keystore files in. 44 | #*.jks 45 | #*.keystore 46 | 47 | # External native build folder generated in Android Studio 2.2 and later 48 | .externalNativeBuild 49 | .cxx/ 50 | 51 | # Google Services (e.g. APIs or Firebase) 52 | # google-services.json 53 | 54 | # Freeline 55 | freeline.py 56 | freeline/ 57 | freeline_project_description.json 58 | 59 | # fastlane 60 | fastlane/report.xml 61 | fastlane/Preview.html 62 | fastlane/screenshots 63 | fastlane/test_output 64 | fastlane/readme.md 65 | 66 | # Version control 67 | vcs.xml 68 | 69 | # lint 70 | lint/intermediates/ 71 | lint/generated/ 72 | lint/outputs/ 73 | lint/tmp/ 74 | # lint/reports/ 75 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Microsoft Open Source Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 4 | 5 | Resources: 6 | 7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) 8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns 10 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribution Guidelines 2 | 3 | Thank you for your interest in Verifiable Credentials! 4 | 5 | This project welcomes contributions and suggestions. Most contributions require you to 6 | agree to a Contributor License Agreement (CLA) declaring that you have the right to, 7 | and actually do, grant us the rights to use your contribution. 8 | 9 | For details, visit https://cla.microsoft.com. 10 | 11 | When you submit a pull request, a CLA-bot will automatically determine whether you need 12 | to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the 13 | instructions provided by the bot. You will only need to do this once across all repositories using our CLA. 14 | 15 | This project has adopted the Microsoft Open Source Code of Conduct. 16 | For more information see the Code of Conduct FAQ 17 | or contact opencode@microsoft.com with any additional questions or comments. 18 | 19 | Contributions come in many forms: submitting issues, writing code, participating in discussions and community calls. 20 | 21 | This document provides the guidelines for how to contribute to the Verifiable Credentials Wallet SDK project. 22 | 23 | ## Issues 24 | 25 | This section describes the guidelines for submitting issues 26 | 27 | ### Issue Types 28 | 29 | There are 4 types of issues: 30 | 31 | - Issue/Bug: You've found a bug with the code, and want to report it, or create an issue to track the bug. 32 | - Issue/Discussion: You have something on your mind, which requires input form others in a discussion, before it eventually manifests as a proposal. 33 | - Issue/Proposal: Used for items that propose a new idea or functionality. This allows feedback from others before code is written. 34 | - Issue/Question: Use this issue type, if you need help or have a question. 35 | 36 | ## Contributing 37 | 38 | This section describes the guidelines for contributing code / docs to the project. 39 | 40 | ### Pull Requests 41 | 42 | All contributions come through pull requests. To submit a proposed change, we recommend following this workflow: 43 | 44 | 1. Make sure there's an issue (bug or proposal) raised, which sets the expectations for the contribution you are about to make. 45 | 2. Fork the relevant repo and create a new branch 46 | 3. Create your change 47 | - Code changes require tests 48 | 4. Update relevant documentation for the change 49 | 5. Commit and open a PR 50 | 6. Wait for the CI process to finish and make sure all checks are green 51 | 7. A maintainer of the project will be assigned, and you can expect a review within a few days 52 | 53 | #### Use work-in-progress PRs for early feedback 54 | 55 | A good way to communicate before investing too much time is to create a "Work-in-progress" PR and share it with your reviewers. The standard way of doing this is to add a "[WIP]" prefix in your PR's title and assign the **do-not-merge** label. This will let people looking at your PR know that it is not well baked yet. 56 | 57 | ### Use of Third-party code 58 | 59 | - Third-party code must include licenses. 60 | 61 | **Thank You!** - Your contributions to open source, large or small, make projects like this possible. Thank you for taking the time to contribute. 62 | 63 | ## Code of Conduct 64 | 65 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. 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 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OMagnifier 2 | 3 | OMagnifier is an Android APM SDK that can be used to monitor the app performance. 4 | 5 | ## Features Support 6 | - [x] Frame rate monitor: floating window for showing fps 7 | - [x] Memory usage metrics monitor: monitor and collect the memeory usage metrics 8 | - [ ] Memory usage viewer 9 | - [ ] Battery usage monitor 10 | 11 | ## APIs 12 | ### Frame rate monitor 13 | 14 | 1. Start frame rate monitor 15 | ```kotlin 16 | Magnifier.startMonitorFPS( 17 | FPSMonitorConfig.Builder(this.application) 18 | .lowPercentage(40 / 60f) // show red tips, (2.0f / 3.0f) by default 19 | .mediumPercentage(50 / 60f) // show yellow tips, (5.0f / 6.0f) by default 20 | .refreshRate(60f) // defaultDisplay.refreshRate by default 21 | .build() 22 | ) 23 | ``` 24 | 25 | 2. Stop frame rate monitor 26 | ```kotlin 27 | Magnifier.stopMonitorFPS() 28 | ``` 29 | 30 | ### Memory usage monitor 31 | 32 | The mectrics we support now: 33 | 34 | - `HeapMemoryInfo`: heap memory and vss/pss memory 35 | - `FileDescriptorInfo`: file readlink and max open file count 36 | - `ThreadInfo`: thread count and thread stack trace 37 | 38 | 1. Start Memory usage metrics monitor 39 | 40 | ```kotlin 41 | MemoryMonitorConfig.Builder() 42 | .enableExceedLimitSample(0.8f, // the benchmark for Exceed_Limit type sampler, if we reach out 80% the max, collect the metrics, 0.8f by default 43 | 10000 // the threshold for Exceed_Limit type sampler, 10s by default 44 | ) 45 | .enableTimingSample(60 * 1000) // threshold for the timing checker, 1 min by default 46 | .onSampleListener(object : MemoryMonitor.OnSampleListener { 47 | override fun onSampleHeap( 48 | heapMemoryInfo: HeapMemoryInfo, 49 | sampleType: MemoryMonitor.SampleType 50 | ) { 51 | Log.d(TAG, "heapMemoryInfo:$heapMemoryInfo,sampleType:$sampleType") 52 | } 53 | 54 | override fun onSampleFile( 55 | fileDescriptorInfo: FileDescriptorInfo, 56 | sampleType: MemoryMonitor.SampleType 57 | ) { 58 | Log.d(TAG, "fileDescriptorInfo:${fileDescriptorInfo.fdMaxCount},sampleType:$sampleType") 59 | } 60 | 61 | override fun onSampleThread( 62 | threadInfo: ThreadInfo, 63 | sampleType: MemoryMonitor.SampleType 64 | ) { 65 | Log.d(TAG, "threadInfo:${threadInfo.threadsCount},sampleType:$sampleType") 66 | } 67 | }).build() 68 | ``` 69 | 70 | 2. Collect the memory usage metrics immdiately 71 | 72 | ```kotlin 73 | Magnifier.dumpMemoryImmediately(object : MemoryMonitor.OnSampleListener { 74 | override fun onSampleHeap( 75 | heapMemoryInfo: HeapMemoryInfo, 76 | sampleType: MemoryMonitor.SampleType 77 | ) { 78 | Log.d(TAG, "heapMemoryInfo:$heapMemoryInfo,sampleType:$sampleType") 79 | } 80 | 81 | override fun onSampleFile( 82 | fileDescriptorInfo: FileDescriptorInfo, 83 | sampleType: MemoryMonitor.SampleType 84 | ) { 85 | Log.d(TAG, "fileDescriptorInfo:${fileDescriptorInfo.fdMaxCount},sampleType:$sampleType") 86 | } 87 | 88 | override fun onSampleThread( 89 | threadInfo: ThreadInfo, 90 | sampleType: MemoryMonitor.SampleType 91 | ) { 92 | Log.d(TAG, "threadInfo:${threadInfo.threadsCount},sampleType:$sampleType") 93 | } 94 | }) 95 | ``` 96 | 97 | 98 | 3. Stop frame rate monitor 99 | 100 | ```kotlin 101 | Magnifier.stopMonitorMemory() 102 | ``` 103 | 104 | ## Demo 105 | 106 | The demo is under Module app. 107 | 108 | 1. Install the app 109 | 2. Run the app 110 | 3. Click the button for testing 111 | 112 | 113 | 114 | ## Contributing 115 | 116 | This project welcomes contributions and suggestions. Most contributions require you to agree to a 117 | Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us 118 | the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. 119 | 120 | When you submit a pull request, a CLA bot will automatically determine whether you need to provide 121 | a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions 122 | provided by the bot. You will only need to do this once across all repos using our CLA. 123 | 124 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 125 | For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or 126 | contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. 127 | 128 | ## [Security reporting](SECURITY.md) 129 | 130 | ## [Code of conduct](CODE_OF_CONDUCT.md) 131 | 132 | ## License 133 | 134 | Copyright (c) Microsoft Corporation. All rights reserved. 135 | 136 | Licensed under the [MIT](LICENSE) license. 137 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Security 4 | 5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). 6 | 7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets Microsoft's [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)) of a security vulnerability, please report it to us as described below. 8 | 9 | ## Reporting Security Issues 10 | 11 | **Please do not report security vulnerabilities through public GitHub issues.** 12 | 13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). 14 | 15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). 16 | 17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). 18 | 19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: 20 | 21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) 22 | * Full paths of source file(s) related to the manifestation of the issue 23 | * The location of the affected source code (tag/branch/commit or direct URL) 24 | * Any special configuration required to reproduce the issue 25 | * Step-by-step instructions to reproduce the issue 26 | * Proof-of-concept or exploit code (if possible) 27 | * Impact of the issue, including how an attacker might exploit the issue 28 | 29 | This information will help us triage your report more quickly. 30 | 31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. 32 | 33 | ## Preferred Languages 34 | 35 | We prefer all communications to be in English. 36 | 37 | ## Policy 38 | 39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). 40 | 41 | 42 | -------------------------------------------------------------------------------- /SUPPORT.md: -------------------------------------------------------------------------------- 1 | # TODO: The maintainer of this repo has not yet edited this file 2 | 3 | **REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project? 4 | 5 | - **No CSS support:** Fill out this template with information about how to file issues and get help. 6 | - **Yes CSS support:** Fill out an intake form at [aka.ms/spot](https://aka.ms/spot). CSS will work with/help you to determine next steps. More details also available at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). 7 | - **Not sure?** Fill out a SPOT intake as though the answer were "Yes". CSS will help you decide. 8 | 9 | *Then remove this first heading from this SUPPORT.MD file before publishing your repo.* 10 | 11 | # Support 12 | 13 | ## How to file issues and get help 14 | 15 | This project uses GitHub Issues to track bugs and feature requests. Please search the existing 16 | issues before filing new issues to avoid duplicates. For new issues, file your bug or 17 | feature request as a new Issue. 18 | 19 | For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE 20 | FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER 21 | CHANNEL. WHERE WILL YOU HELP PEOPLE?**. 22 | 23 | ## Microsoft Support Policy 24 | 25 | Support for this **PROJECT or PRODUCT** is limited to the resources listed above. 26 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. 4 | */ 5 | 6 | plugins { 7 | id 'com.android.application' 8 | id 'kotlin-android' 9 | } 10 | 11 | android { 12 | compileSdkVersion 30 13 | buildToolsVersion "30.0.3" 14 | 15 | defaultConfig { 16 | applicationId "com.microsoft.office.outlook.magnifier" 17 | minSdkVersion 16 18 | targetSdkVersion 30 19 | versionCode 1 20 | versionName "1.0" 21 | 22 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 23 | } 24 | 25 | buildTypes { 26 | release { 27 | minifyEnabled false 28 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 29 | } 30 | } 31 | compileOptions { 32 | sourceCompatibility JavaVersion.VERSION_1_8 33 | targetCompatibility JavaVersion.VERSION_1_8 34 | } 35 | kotlinOptions { 36 | jvmTarget = '1.8' 37 | } 38 | } 39 | 40 | dependencies { 41 | 42 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 43 | implementation 'androidx.core:core-ktx:1.3.2' 44 | implementation 'androidx.appcompat:appcompat:1.2.0' 45 | implementation 'com.google.android.material:material:1.3.0' 46 | implementation 'androidx.constraintlayout:constraintlayout:2.0.4' 47 | testImplementation 'junit:junit:4.+' 48 | androidTestImplementation 'androidx.test.ext:junit:1.1.2' 49 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' 50 | implementation project(':magnifierlib') 51 | } -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /app/src/androidTest/java/com/microsoft/office/outlook/magnifier/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. 4 | */ 5 | 6 | package com.microsoft.office.outlook.magnifier 7 | 8 | import androidx.test.platform.app.InstrumentationRegistry 9 | import androidx.test.ext.junit.runners.AndroidJUnit4 10 | 11 | import org.junit.Test 12 | import org.junit.runner.RunWith 13 | 14 | import org.junit.Assert.* 15 | 16 | /** 17 | * Instrumented test, which will execute on an Android device. 18 | * 19 | * See [testing documentation](http://d.android.com/tools/testing). 20 | */ 21 | @RunWith(AndroidJUnit4::class) 22 | class ExampleInstrumentedTest { 23 | @Test 24 | fun useAppContext() { 25 | // Context of the app under test. 26 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 27 | assertEquals("com.microsoft.office.outlook.magnifier", appContext.packageName) 28 | } 29 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 8 | 9 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/microsoft/office/outlook/magnifier/MainActivity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. 4 | */ 5 | 6 | package com.microsoft.office.outlook.magnifier 7 | 8 | import android.app.Activity 9 | import android.os.Bundle 10 | import android.util.Log 11 | import android.widget.Button 12 | import com.microsoft.office.outlook.magnifierlib.Magnifier 13 | import com.microsoft.office.outlook.magnifierlib.frame.FPSMonitorConfig 14 | import com.microsoft.office.outlook.magnifierlib.memory.FileDescriptorInfo 15 | import com.microsoft.office.outlook.magnifierlib.memory.HeapMemoryInfo 16 | import com.microsoft.office.outlook.magnifierlib.memory.MemoryMonitor 17 | import com.microsoft.office.outlook.magnifierlib.memory.MemoryMonitorConfig 18 | import com.microsoft.office.outlook.magnifierlib.memory.ThreadInfo 19 | 20 | class MainActivity : Activity() { 21 | 22 | override fun onCreate(savedInstanceState: Bundle?) { 23 | super.onCreate(savedInstanceState) 24 | setContentView(R.layout.activity_main) 25 | 26 | val buttonStartFPS = findViewById