├── .gitignore ├── .idea ├── encodings.xml ├── gradle.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── marlonjones │ │ └── gyrocheck │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── marlonjones │ │ │ └── gyrocheck │ │ │ └── MainActivity.java │ └── res │ │ ├── layout │ │ ├── activity_main.xml │ │ └── content_main.xml │ │ ├── menu │ │ └── menu_main.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-v21 │ │ └── styles.xml │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── marlonjones │ └── gyrocheck │ └── ExampleUnitTest.java ├── build.gradle ├── example.gif ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── library ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── marlonjones │ │ └── gyrochecklib │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── marlonjones │ │ │ └── gyrochecklib │ │ │ ├── GyroCheck.java │ │ │ └── GyroView.java │ └── res │ │ ├── layout │ │ └── text.xml │ │ └── values │ │ └── strings.xml │ └── test │ └── java │ └── com │ └── marlonjones │ └── gyrochecklib │ └── ExampleUnitTest.java ├── license └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 27 | 28 | 29 | 30 | 31 | 32 | 34 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Gyro Check for Android 2 | 3 | ## This project is now archived and no longer being maintained, but will be kept up for educational and reference purposes! 4 | Gyro Check is a simple Android Library that will show your Gyroscope's X, Y, and Z stats in the 5 | bottom of your activity. 6 | This can be used with apps and games (and soon on Android's VR platforms: Google Cardboard and Google Daydream) that use 7 | the Gyroscope, in order to make sure that it is working properly. When the phone is in movement and has a GyroScope that is 8 | available, then the numbers will change between negative and positive integers, and will reset to 0 when the device is still. 9 | If the numbers are always at 0 and never change, then your device does not have a gyroscope or it is defective. 10 | The minimum SDK that this can be used with is SDK 16. Note that this library will also have some Kotlin code written for it to make the experience of using it a little bit better. This will be added in version 1.0.8. 11 |

12 | 13 |

14 | 15 | ## Gradle Dependency 16 | NOTE: THIS IS BEING MIGRATED TO ANDROIDX AND WILL NOT WORK FOR THE TIME BEING DUE TO ERRORS. THERE IS NO ESTIMATED TIME 17 | OF COMPLETION DUE TO WORK AND SCHOOL, AS WELL AS ART/DESIGN WORK. 18 | 19 | The Gradle dependency is available in jCenter, which is the default Repository that Android Studio uses. 20 | So to get started, Just add the dependency into your Gradle file. 21 | 22 | ```gradle 23 | dependencies { 24 | // ... other dependencies here 25 | compile 'com.marlonjones.library:GyroCheck:1.0.5' 26 | } 27 | ``` 28 | 29 | ## Use 30 | In order to use this, you must use the Gyroscope feature. You do this by adding this to your Android Manifest: 31 | 32 | ```` ```` 33 | 34 | After adding this, in your activity's OnCreate, call ````GyroCheck.addTo(this);```` 35 | 36 | Then, you're done! It will show in the corner of your app as a small clear box. You can also make this into a version 37 | specific call by adding an if statement with it. 38 | ```` 39 | if (BuildConfig.DEBUG) { 40 | GyroCheck.addTo(this); 41 | } 42 | ```` 43 | ## Credits 44 | This library uses code based off of code from Akexorcist and 45 | their YouTube video and their original project. I used this code with modifications as I felt that it could be used for testing games, apps, and ROMs. Also huge thanks to James Fenn for helping out on this. 46 | ## License (Apache 2.0) 47 | ```` 48 | Copyright 2017 Marlon Jones 49 | 50 | Licensed under the Apache License, Version 2.0 (the "License"); 51 | you may not use this file except in compliance with the License. 52 | You may obtain a copy of the License at 53 | 54 | http://www.apache.org/licenses/LICENSE-2.0 55 | 56 | Unless required by applicable law or agreed to in writing, software 57 | distributed under the License is distributed on an "AS IS" BASIS, 58 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 59 | See the License for the specific language governing permissions and 60 | limitations under the License. 61 | 62 | ```` 63 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 28 5 | buildToolsVersion '28.0.3' 6 | defaultConfig { 7 | applicationId "com.marlonjones.gyrocheck" 8 | minSdkVersion 16 9 | targetSdkVersion 28 10 | versionCode 5 11 | versionName "1.0.6 - SAMPLE" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 25 | exclude group: 'com.android.support', module: 'support-annotations' 26 | }) 27 | implementation 'com.android.support:appcompat-v7:28.0.0' 28 | implementation 'com.android.support:cardview-v7:28.0.0' 29 | implementation 'com.android.support:design:28.0.0' 30 | implementation 'com.afollestad.material-dialogs:core:2.0.0-rc5' //From afollestad 31 | testCompile 'junit:junit:4.12' 32 | 33 | } 34 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\AndroidSDK/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/marlonjones/gyrocheck/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.marlonjones.gyrocheck; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.marlonjones.gyrocheck", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 15 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/marlonjones/gyrocheck/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.marlonjones.gyrocheck; 2 | 3 | import android.os.Bundle; 4 | import android.support.v4.*; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.support.v7.widget.Toolbar; 7 | import android.text.Html; 8 | import android.text.Spanned; 9 | import android.view.Menu; 10 | import android.view.MenuItem; 11 | 12 | import com.afollestad.materialdialogs.MaterialDialog; 13 | import com.marlonjones.gyrochecklib.GyroCheck; 14 | 15 | public class MainActivity extends AppCompatActivity { 16 | 17 | @Override 18 | protected void onCreate(Bundle savedInstanceState) { 19 | super.onCreate(savedInstanceState); 20 | setContentView(R.layout.activity_main); 21 | 22 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); 23 | setSupportActionBar(toolbar); 24 | new MaterialDialog.Builder(this) 25 | .title(R.string.opening_title) 26 | .content(R.string.opening) 27 | .positiveText(R.string.ok) 28 | .show(); 29 | 30 | /** 31 | * GyroCheck.addTo(this); - Adds the GyroCheck library to your current view. 32 | * BuildConfig.DEBUG - If the app is in DEBUG mode, it will show the library. 33 | **/ 34 | 35 | if (BuildConfig.DEBUG) { 36 | GyroCheck.addTo(this); 37 | } 38 | else { 39 | GyroCheck.addTo(this); 40 | /** 41 | * Without using BuildConfig.DEBUG, the library will be shown 42 | * in the view you put it in, no matter the build type. 43 | **/ 44 | } 45 | } 46 | @Override 47 | public boolean onCreateOptionsMenu(Menu menu) { 48 | getMenuInflater().inflate(R.menu.menu_main, menu); 49 | return super.onCreateOptionsMenu(menu); 50 | } 51 | 52 | @Override 53 | public boolean onOptionsItemSelected(MenuItem item) { 54 | if (item.getItemId() == R.id.action_settings) { 55 | new MaterialDialog.Builder(this) 56 | .title(R.string.action_settings) 57 | .content(Html.fromHtml(getString(R.string.about_body))) 58 | .positiveText(R.string.dismiss) 59 | .show(); 60 | return true; 61 | } 62 | return super.onOptionsItemSelected(item); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/layout/content_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 22 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PanHyridae/GyroCheck-Android-Library/ed1eeada2d549b9356711ee4fb28c195745dd546/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PanHyridae/GyroCheck-Android-Library/ed1eeada2d549b9356711ee4fb28c195745dd546/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PanHyridae/GyroCheck-Android-Library/ed1eeada2d549b9356711ee4fb28c195745dd546/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PanHyridae/GyroCheck-Android-Library/ed1eeada2d549b9356711ee4fb28c195745dd546/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PanHyridae/GyroCheck-Android-Library/ed1eeada2d549b9356711ee4fb28c195745dd546/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 16dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | GyroCheck 3 | About 4 | 5 | Please Note 6 | This is a sample app intended for developers of Android apps and games 7 | intending to use the GyroCheck Library. 8 | OK 9 | Dismiss 10 | GyroCheck is a simple Library that will allow a developer to easily 11 | test for proper Gyroscope functions in their app. When placed into the target Java file, 12 | the library will display the Gyroscope stats in the bottom right hand corner of the activity, 13 | and will change as the phone is rotated. This can be used to check if the Gyroscope is 14 | working properly. For suggestions or any issues, visit github.com/MJonesDev/GyroCheck. 15 | 16 | Marlon Jones.
18 | Website   19 | Twitter   20 | Google+   21 | GitHub   22 | Dribbble   23 | LinkedIn 24 | ]]>
25 | 26 | 27 |
28 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 |