├── .classpath ├── .gitattributes ├── .gitignore ├── .project ├── AndroidManifest.xml ├── bin ├── AndroidManifest.xml ├── Sensor-Light.apk ├── classes.dex ├── classes │ └── app │ │ └── akexorcist │ │ └── sensor_light │ │ ├── BuildConfig.class │ │ ├── Main$1.class │ │ ├── Main.class │ │ ├── R$attr.class │ │ ├── R$dimen.class │ │ ├── R$drawable.class │ │ ├── R$id.class │ │ ├── R$layout.class │ │ ├── R$string.class │ │ ├── R$style.class │ │ └── R.class ├── dexedLibs │ ├── android-support-v4-6f74dbcaa5011c2caccd0b09dc155f1e.jar │ └── annotations-4447f168f572ce41735c636d276eb004.jar ├── jarlist.cache ├── res │ ├── drawable-hdpi │ │ └── ic_launcher.png │ ├── drawable-mdpi │ │ └── ic_launcher.png │ ├── drawable-xhdpi │ │ └── ic_launcher.png │ └── drawable-xxhdpi │ │ └── ic_launcher.png └── resources.ap_ ├── gen └── app │ └── akexorcist │ └── sensor_light │ ├── BuildConfig.java │ └── R.java ├── ic_launcher-web.png ├── libs └── android-support-v4.jar ├── proguard-project.txt ├── project.properties ├── res ├── drawable-hdpi │ └── ic_launcher.png ├── drawable-mdpi │ └── ic_launcher.png ├── drawable-xhdpi │ └── ic_launcher.png ├── drawable-xxhdpi │ └── ic_launcher.png ├── layout │ └── main.xml └── values │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml └── src └── app └── akexorcist └── sensor_light └── Main.java /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # ========================= 18 | # Operating System Files 19 | # ========================= 20 | 21 | # OSX 22 | # ========================= 23 | 24 | .DS_Store 25 | .AppleDouble 26 | .LSOverride 27 | 28 | # Icon must ends with two \r. 29 | Icon 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear on external disk 35 | .Spotlight-V100 36 | .Trashes 37 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Sensor-Light 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /bin/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /bin/Sensor-Light.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akexorcist/Android-Sensor-Light/81ba2bd1e3aea3e479c540adef3eaa56aa183d34/bin/Sensor-Light.apk -------------------------------------------------------------------------------- /bin/classes.dex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akexorcist/Android-Sensor-Light/81ba2bd1e3aea3e479c540adef3eaa56aa183d34/bin/classes.dex -------------------------------------------------------------------------------- /bin/classes/app/akexorcist/sensor_light/BuildConfig.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akexorcist/Android-Sensor-Light/81ba2bd1e3aea3e479c540adef3eaa56aa183d34/bin/classes/app/akexorcist/sensor_light/BuildConfig.class -------------------------------------------------------------------------------- /bin/classes/app/akexorcist/sensor_light/Main$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akexorcist/Android-Sensor-Light/81ba2bd1e3aea3e479c540adef3eaa56aa183d34/bin/classes/app/akexorcist/sensor_light/Main$1.class -------------------------------------------------------------------------------- /bin/classes/app/akexorcist/sensor_light/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akexorcist/Android-Sensor-Light/81ba2bd1e3aea3e479c540adef3eaa56aa183d34/bin/classes/app/akexorcist/sensor_light/Main.class -------------------------------------------------------------------------------- /bin/classes/app/akexorcist/sensor_light/R$attr.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akexorcist/Android-Sensor-Light/81ba2bd1e3aea3e479c540adef3eaa56aa183d34/bin/classes/app/akexorcist/sensor_light/R$attr.class -------------------------------------------------------------------------------- /bin/classes/app/akexorcist/sensor_light/R$dimen.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akexorcist/Android-Sensor-Light/81ba2bd1e3aea3e479c540adef3eaa56aa183d34/bin/classes/app/akexorcist/sensor_light/R$dimen.class -------------------------------------------------------------------------------- /bin/classes/app/akexorcist/sensor_light/R$drawable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akexorcist/Android-Sensor-Light/81ba2bd1e3aea3e479c540adef3eaa56aa183d34/bin/classes/app/akexorcist/sensor_light/R$drawable.class -------------------------------------------------------------------------------- /bin/classes/app/akexorcist/sensor_light/R$id.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akexorcist/Android-Sensor-Light/81ba2bd1e3aea3e479c540adef3eaa56aa183d34/bin/classes/app/akexorcist/sensor_light/R$id.class -------------------------------------------------------------------------------- /bin/classes/app/akexorcist/sensor_light/R$layout.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akexorcist/Android-Sensor-Light/81ba2bd1e3aea3e479c540adef3eaa56aa183d34/bin/classes/app/akexorcist/sensor_light/R$layout.class -------------------------------------------------------------------------------- /bin/classes/app/akexorcist/sensor_light/R$string.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akexorcist/Android-Sensor-Light/81ba2bd1e3aea3e479c540adef3eaa56aa183d34/bin/classes/app/akexorcist/sensor_light/R$string.class -------------------------------------------------------------------------------- /bin/classes/app/akexorcist/sensor_light/R$style.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akexorcist/Android-Sensor-Light/81ba2bd1e3aea3e479c540adef3eaa56aa183d34/bin/classes/app/akexorcist/sensor_light/R$style.class -------------------------------------------------------------------------------- /bin/classes/app/akexorcist/sensor_light/R.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akexorcist/Android-Sensor-Light/81ba2bd1e3aea3e479c540adef3eaa56aa183d34/bin/classes/app/akexorcist/sensor_light/R.class -------------------------------------------------------------------------------- /bin/dexedLibs/android-support-v4-6f74dbcaa5011c2caccd0b09dc155f1e.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akexorcist/Android-Sensor-Light/81ba2bd1e3aea3e479c540adef3eaa56aa183d34/bin/dexedLibs/android-support-v4-6f74dbcaa5011c2caccd0b09dc155f1e.jar -------------------------------------------------------------------------------- /bin/dexedLibs/annotations-4447f168f572ce41735c636d276eb004.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akexorcist/Android-Sensor-Light/81ba2bd1e3aea3e479c540adef3eaa56aa183d34/bin/dexedLibs/annotations-4447f168f572ce41735c636d276eb004.jar -------------------------------------------------------------------------------- /bin/jarlist.cache: -------------------------------------------------------------------------------- 1 | # cache for current jar dependecy. DO NOT EDIT. 2 | # format is 3 | # Encoding is UTF-8 4 | -------------------------------------------------------------------------------- /bin/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akexorcist/Android-Sensor-Light/81ba2bd1e3aea3e479c540adef3eaa56aa183d34/bin/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akexorcist/Android-Sensor-Light/81ba2bd1e3aea3e479c540adef3eaa56aa183d34/bin/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akexorcist/Android-Sensor-Light/81ba2bd1e3aea3e479c540adef3eaa56aa183d34/bin/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akexorcist/Android-Sensor-Light/81ba2bd1e3aea3e479c540adef3eaa56aa183d34/bin/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/resources.ap_: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akexorcist/Android-Sensor-Light/81ba2bd1e3aea3e479c540adef3eaa56aa183d34/bin/resources.ap_ -------------------------------------------------------------------------------- /gen/app/akexorcist/sensor_light/BuildConfig.java: -------------------------------------------------------------------------------- 1 | /** Automatically generated file. DO NOT MODIFY */ 2 | package app.akexorcist.sensor_light; 3 | 4 | public final class BuildConfig { 5 | public final static boolean DEBUG = true; 6 | } -------------------------------------------------------------------------------- /gen/app/akexorcist/sensor_light/R.java: -------------------------------------------------------------------------------- 1 | /* AUTO-GENERATED FILE. DO NOT MODIFY. 2 | * 3 | * This class was automatically generated by the 4 | * aapt tool from the resource data it found. It 5 | * should not be modified by hand. 6 | */ 7 | 8 | package app.akexorcist.sensor_light; 9 | 10 | public final class R { 11 | public static final class attr { 12 | } 13 | public static final class dimen { 14 | /** Default screen margins, per the Android Design guidelines. 15 | */ 16 | public static final int activity_horizontal_margin=0x7f040000; 17 | public static final int activity_vertical_margin=0x7f040001; 18 | } 19 | public static final class drawable { 20 | public static final int ic_launcher=0x7f020000; 21 | } 22 | public static final class id { 23 | public static final int textLight=0x7f070000; 24 | } 25 | public static final class layout { 26 | public static final int main=0x7f030000; 27 | } 28 | public static final class string { 29 | public static final int action_settings=0x7f050001; 30 | public static final int app_name=0x7f050000; 31 | public static final int hello_world=0x7f050002; 32 | } 33 | public static final class style { 34 | /** 35 | Base application theme, dependent on API level. This theme is replaced 36 | by AppBaseTheme from res/values-vXX/styles.xml on newer devices. 37 | 38 | 39 | Theme customizations available in newer API levels can go in 40 | res/values-vXX/styles.xml, while customizations related to 41 | backward-compatibility can go here. 42 | 43 | */ 44 | public static final int AppBaseTheme=0x7f060000; 45 | /** Application theme. 46 | All customizations that are NOT specific to a particular API-level can go here. 47 | */ 48 | public static final int AppTheme=0x7f060001; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akexorcist/Android-Sensor-Light/81ba2bd1e3aea3e479c540adef3eaa56aa183d34/ic_launcher-web.png -------------------------------------------------------------------------------- /libs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akexorcist/Android-Sensor-Light/81ba2bd1e3aea3e479c540adef3eaa56aa183d34/libs/android-support-v4.jar -------------------------------------------------------------------------------- /proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-8 15 | -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akexorcist/Android-Sensor-Light/81ba2bd1e3aea3e479c540adef3eaa56aa183d34/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akexorcist/Android-Sensor-Light/81ba2bd1e3aea3e479c540adef3eaa56aa183d34/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akexorcist/Android-Sensor-Light/81ba2bd1e3aea3e479c540adef3eaa56aa183d34/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akexorcist/Android-Sensor-Light/81ba2bd1e3aea3e479c540adef3eaa56aa183d34/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | -------------------------------------------------------------------------------- /res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 16dp 6 | 7 | -------------------------------------------------------------------------------- /res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Light 5 | Settings 6 | Hello world! 7 | 8 | -------------------------------------------------------------------------------- /res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 19 | 20 | -------------------------------------------------------------------------------- /src/app/akexorcist/sensor_light/Main.java: -------------------------------------------------------------------------------- 1 | package app.akexorcist.sensor_light; 2 | 3 | import android.hardware.Sensor; 4 | import android.hardware.SensorEvent; 5 | import android.hardware.SensorEventListener; 6 | import android.hardware.SensorManager; 7 | import android.os.Bundle; 8 | import android.app.Activity; 9 | import android.content.Context; 10 | import android.widget.TextView; 11 | 12 | public class Main extends Activity { 13 | TextView textLight; 14 | SensorManager sensorManager; 15 | Sensor sensor; 16 | 17 | public void onCreate(Bundle savedInstanceState) { 18 | super.onCreate(savedInstanceState); 19 | setContentView(R.layout.main); 20 | 21 | sensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE); 22 | sensor = sensorManager.getDefaultSensor(Sensor.TYPE_LIGHT); 23 | 24 | textLight = (TextView) findViewById(R.id.textLight); 25 | } 26 | 27 | public void onResume() { 28 | super.onResume(); 29 | sensorManager.registerListener(lightListener, sensor, 30 | SensorManager.SENSOR_DELAY_NORMAL); 31 | } 32 | 33 | public void onStop() { 34 | super.onStop(); 35 | sensorManager.unregisterListener(lightListener); 36 | } 37 | 38 | public SensorEventListener lightListener = new SensorEventListener() { 39 | public void onAccuracyChanged(Sensor sensor, int acc) { } 40 | 41 | public void onSensorChanged(SensorEvent event) { 42 | float x = event.values[0]; 43 | 44 | textLight.setText((int)x + " lux"); 45 | } 46 | }; 47 | } --------------------------------------------------------------------------------