├── AndroidManifest.xml
├── bin
├── AndroidManifest.xml
├── Light.apk
├── Visible.apk
├── classes.dex
├── classes
│ └── com
│ │ └── example
│ │ └── light
│ │ ├── BuildConfig.class
│ │ ├── MainActivity$1.class
│ │ ├── MainActivity$2.class
│ │ ├── MainActivity.class
│ │ ├── R$attr.class
│ │ ├── R$dimen.class
│ │ ├── R$drawable.class
│ │ ├── R$id.class
│ │ ├── R$layout.class
│ │ ├── R$menu.class
│ │ ├── R$string.class
│ │ ├── R$style.class
│ │ └── R.class
├── dexedLibs
│ ├── android-support-v4-30e9095d1121efce5358137e5f487e14.jar
│ ├── android-support-v4-5aae5e34b687ca22cc1a4ece8e6e0059.jar
│ ├── android-support-v4-b5b72c1dc9c8a8cc39dad5a1a07d3c1a.jar
│ └── android-support-v4-f0320ab3a2c8263293d68f6043aa0dfd.jar
├── jarlist.cache
├── res
│ └── crunch
│ │ ├── drawable-hdpi
│ │ └── ic_launcher.png
│ │ ├── drawable-mdpi
│ │ └── ic_launcher.png
│ │ ├── drawable-xhdpi
│ │ └── ic_launcher.png
│ │ └── drawable-xxhdpi
│ │ └── ic_launcher.png
└── resources.ap_
├── gen
└── com
│ └── example
│ └── 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
│ └── activity_main.xml
├── menu
│ └── main.xml
├── values-sw600dp
│ └── dimens.xml
├── values-sw720dp-land
│ └── dimens.xml
├── values-v11
│ └── styles.xml
├── values-v14
│ └── styles.xml
└── values
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
└── src
└── com
└── example
└── light
└── MainActivity.java
/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
12 |
13 |
18 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/bin/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
12 |
13 |
18 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/bin/Light.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/bin/Light.apk
--------------------------------------------------------------------------------
/bin/Visible.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/bin/Visible.apk
--------------------------------------------------------------------------------
/bin/classes.dex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/bin/classes.dex
--------------------------------------------------------------------------------
/bin/classes/com/example/light/BuildConfig.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/bin/classes/com/example/light/BuildConfig.class
--------------------------------------------------------------------------------
/bin/classes/com/example/light/MainActivity$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/bin/classes/com/example/light/MainActivity$1.class
--------------------------------------------------------------------------------
/bin/classes/com/example/light/MainActivity$2.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/bin/classes/com/example/light/MainActivity$2.class
--------------------------------------------------------------------------------
/bin/classes/com/example/light/MainActivity.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/bin/classes/com/example/light/MainActivity.class
--------------------------------------------------------------------------------
/bin/classes/com/example/light/R$attr.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/bin/classes/com/example/light/R$attr.class
--------------------------------------------------------------------------------
/bin/classes/com/example/light/R$dimen.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/bin/classes/com/example/light/R$dimen.class
--------------------------------------------------------------------------------
/bin/classes/com/example/light/R$drawable.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/bin/classes/com/example/light/R$drawable.class
--------------------------------------------------------------------------------
/bin/classes/com/example/light/R$id.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/bin/classes/com/example/light/R$id.class
--------------------------------------------------------------------------------
/bin/classes/com/example/light/R$layout.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/bin/classes/com/example/light/R$layout.class
--------------------------------------------------------------------------------
/bin/classes/com/example/light/R$menu.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/bin/classes/com/example/light/R$menu.class
--------------------------------------------------------------------------------
/bin/classes/com/example/light/R$string.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/bin/classes/com/example/light/R$string.class
--------------------------------------------------------------------------------
/bin/classes/com/example/light/R$style.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/bin/classes/com/example/light/R$style.class
--------------------------------------------------------------------------------
/bin/classes/com/example/light/R.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/bin/classes/com/example/light/R.class
--------------------------------------------------------------------------------
/bin/dexedLibs/android-support-v4-30e9095d1121efce5358137e5f487e14.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/bin/dexedLibs/android-support-v4-30e9095d1121efce5358137e5f487e14.jar
--------------------------------------------------------------------------------
/bin/dexedLibs/android-support-v4-5aae5e34b687ca22cc1a4ece8e6e0059.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/bin/dexedLibs/android-support-v4-5aae5e34b687ca22cc1a4ece8e6e0059.jar
--------------------------------------------------------------------------------
/bin/dexedLibs/android-support-v4-b5b72c1dc9c8a8cc39dad5a1a07d3c1a.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/bin/dexedLibs/android-support-v4-b5b72c1dc9c8a8cc39dad5a1a07d3c1a.jar
--------------------------------------------------------------------------------
/bin/dexedLibs/android-support-v4-f0320ab3a2c8263293d68f6043aa0dfd.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/bin/dexedLibs/android-support-v4-f0320ab3a2c8263293d68f6043aa0dfd.jar
--------------------------------------------------------------------------------
/bin/jarlist.cache:
--------------------------------------------------------------------------------
1 | # cache for current jar dependency. DO NOT EDIT.
2 | # format is
3 | # Encoding is UTF-8
4 |
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/bin/res/crunch/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/bin/res/crunch/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/bin/res/crunch/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/bin/res/crunch/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/resources.ap_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/bin/resources.ap_
--------------------------------------------------------------------------------
/gen/com/example/light/BuildConfig.java:
--------------------------------------------------------------------------------
1 | /** Automatically generated file. DO NOT MODIFY */
2 | package com.example.light;
3 |
4 | public final class BuildConfig {
5 | public final static boolean DEBUG = true;
6 | }
--------------------------------------------------------------------------------
/gen/com/example/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 com.example.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 | Customize dimensions originally defined in res/values/dimens.xml (such as
17 | screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here.
18 |
19 | */
20 | public static final int activity_horizontal_margin=0x7f040000;
21 | public static final int activity_vertical_margin=0x7f040001;
22 | }
23 | public static final class drawable {
24 | public static final int ic_launcher=0x7f020000;
25 | }
26 | public static final class id {
27 | public static final int action_settings=0x7f080004;
28 | public static final int editText=0x7f080000;
29 | public static final int sendButton=0x7f080001;
30 | public static final int textView=0x7f080002;
31 | public static final int toggleButton=0x7f080003;
32 | }
33 | public static final class layout {
34 | public static final int activity_main=0x7f030000;
35 | }
36 | public static final class menu {
37 | public static final int main=0x7f070000;
38 | }
39 | public static final class string {
40 | public static final int action_settings=0x7f050001;
41 | public static final int adapt_button=0x7f050005;
42 | public static final int app_name=0x7f050000;
43 | public static final int out_view=0x7f050006;
44 | public static final int read_view=0x7f050004;
45 | public static final int send_button=0x7f050003;
46 | public static final int send_editText=0x7f050002;
47 | }
48 | public static final class style {
49 | /**
50 | Base application theme, dependent on API level. This theme is replaced
51 | by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
52 |
53 |
54 | Theme customizations available in newer API levels can go in
55 | res/values-vXX/styles.xml, while customizations related to
56 | backward-compatibility can go here.
57 |
58 |
59 | Base application theme for API 11+. This theme completely replaces
60 | AppBaseTheme from res/values/styles.xml on API 11+ devices.
61 |
62 | API 11 theme customizations can go here.
63 |
64 | Base application theme for API 14+. This theme completely replaces
65 | AppBaseTheme from BOTH res/values/styles.xml and
66 | res/values-v11/styles.xml on API 14+ devices.
67 |
68 | API 14 theme customizations can go here.
69 | */
70 | public static final int AppBaseTheme=0x7f060000;
71 | /** Application theme.
72 | All customizations that are NOT specific to a particular API-level can go here.
73 | */
74 | public static final int AppTheme=0x7f060001;
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/ic_launcher-web.png
--------------------------------------------------------------------------------
/libs/android-support-v4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/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-19
15 |
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jjeon5/LiFi-on-Android/6f501b72214316013e2aa73afff3753e7dd9ba53/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
19 |
20 |
28 |
29 |
37 |
38 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/res/menu/main.xml:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/res/values-sw600dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/res/values-sw720dp-land/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 | 128dp
8 |
9 |
10 |
--------------------------------------------------------------------------------
/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/res/values-v14/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 16dp
5 | 16dp
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Visible
5 | Settings
6 |
7 |
8 | SEND
9 | OUTPUT
10 | ADAPT
11 | OUTPUT
12 |
13 |
--------------------------------------------------------------------------------
/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
14 |
15 |
16 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/com/example/light/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.light;
2 |
3 | import org.ejml.data.DenseMatrix64F;
4 | import org.ejml.simple.SimpleMatrix;
5 | import android.graphics.Bitmap;
6 | import android.graphics.BitmapFactory;
7 | import android.hardware.Camera;
8 | import android.hardware.Sensor;
9 |
10 |
11 | import java.io.UnsupportedEncodingException;
12 | import java.math.BigInteger;
13 | import java.util.Arrays;
14 | import java.util.LinkedList;
15 | import java.util.Queue;
16 | import java.util.concurrent.Executors;
17 | import java.util.concurrent.Future;
18 | import java.util.concurrent.ScheduledExecutorService;
19 | import java.util.concurrent.TimeUnit;
20 |
21 | import android.hardware.Camera.Parameters;
22 | import android.hardware.SensorEvent;
23 | import android.hardware.SensorEventListener;
24 | import android.hardware.SensorManager;
25 | import android.os.Bundle;
26 | import android.app.Activity;
27 | import android.util.Log;
28 | import android.view.View;
29 | import android.widget.EditText;
30 | import android.widget.ImageView;
31 | import android.widget.TextView;
32 | import android.widget.ToggleButton;
33 |
34 | public class MainActivity extends Activity{
35 |
36 | TextView textField;
37 | EditText input;
38 | ImageView imageView;
39 |
40 | SensorManager mySensorManager;
41 | Sensor LightSensor;
42 | public String s = new String();
43 | public boolean isOn = false;
44 | String is="";
45 | String was="";
46 | long interval, then;
47 | int inter;
48 | public ScheduledExecutorService scheduleTaskExecutor;
49 | Future future;
50 | double oneCount=0;
51 | double zeroCount=0;
52 | float onValue;
53 | float offValue;
54 | float dx, dy, avgSlope;
55 | float[] slopeArray;
56 | public String stri="";
57 | public float y;
58 | public float yThen;
59 | public float onThreshold;
60 | public float offThreshold;
61 | int offCount;
62 | public Thread thread, thread2;
63 | public boolean firstTime;
64 | int firstCount;
65 | SimpleMatrix G, H;
66 | SimpleMatrix[] perms;
67 |
68 |
69 |
70 |
71 |
72 | Camera camera;
73 | Parameters paramOn, paramOff;
74 | String keySeq;
75 | char[] a;
76 |
77 | protected void onStop() {
78 | super.onStop();
79 | if (camera != null) {
80 | camera.release();
81 | }
82 | scheduleTaskExecutor.shutdownNow();
83 | }
84 |
85 | @Override
86 | public void onCreate(Bundle savedInstanceState) {
87 | super.onCreate(savedInstanceState);
88 | setContentView(R.layout.activity_main);
89 |
90 | G = new SimpleMatrix(new double[][]{
91 |
92 | {1, 1, 0, 1},
93 | {1, 0, 1, 1},
94 | {1, 0, 0, 0},
95 | {0, 1, 1, 1},
96 | {0, 1, 0, 0},
97 | {0, 0, 1, 0},
98 | {0, 0, 0, 1}
99 |
100 | });
101 | H = new SimpleMatrix(new double[][]{
102 |
103 | {1, 0, 1, 0, 1, 0, 1},
104 | {0, 1, 1, 0, 0, 1, 1},
105 | {0, 0, 0, 1, 1, 1, 1}
106 |
107 | });
108 | perms = new SimpleMatrix[7];
109 | for(int x = 0; x < perms.length; x++)
110 | {
111 | double[][] t = new double[7][1];
112 | t[x][0] = 1;
113 | perms[x] = new SimpleMatrix(t);
114 | }
115 |
116 |
117 |
118 |
119 | textField = (TextView)findViewById(R.id.textView);
120 | input = (EditText)findViewById(R.id.editText);
121 |
122 | mySensorManager = (SensorManager)getSystemService(SENSOR_SERVICE);
123 | LightSensor = mySensorManager.getDefaultSensor(Sensor.TYPE_LIGHT);
124 |
125 | if(LightSensor != null){
126 | textField.setText("Sensor.TYPE_LIGHT Available");
127 | }else{
128 | textField.setText("Sensor.TYPE_LIGHT NOT Available");
129 | }
130 |
131 | scheduleTaskExecutor = Executors.newScheduledThreadPool(1);
132 | }
133 |
134 | public void onToggleClicked(View view) {
135 | if (((ToggleButton) view).isChecked()) {
136 | mySensorManager.registerListener(
137 | LightSensorListener,
138 | LightSensor,
139 | SensorManager.SENSOR_DELAY_FASTEST);
140 | future = scheduleTaskExecutor.scheduleAtFixedRate(record, 0, 2, TimeUnit.MILLISECONDS);
141 | } else {
142 | future.cancel(true);
143 | yThen = 0;
144 | mySensorManager.unregisterListener(LightSensorListener);
145 | try {
146 | readMessage();
147 | } catch (UnsupportedEncodingException e) {
148 | e.printStackTrace();
149 | }
150 | }
151 | }
152 |
153 | Runnable record = new Runnable() {
154 | @Override
155 | public void run() {
156 | dy=y-yThen;
157 | if(dy>200)
158 | isOn=true;
159 | else if(dy<-200)
160 | isOn=false;
161 |
162 | if(isOn)
163 | s=s+"1";
164 | else
165 | s=s+"0";
166 | yThen=y;
167 | }
168 | };
169 |
170 | private final SensorEventListener LightSensorListener = new SensorEventListener(){
171 | @Override
172 | public void onAccuracyChanged(Sensor sensor, int accuracy) {
173 | }
174 | @Override
175 | public void onSensorChanged(SensorEvent event) {
176 | if(event.sensor.getType() == Sensor.TYPE_LIGHT){
177 | y=event.values[0];
178 | //textField.setText(String.valueOf(event.values[0]));
179 | }
180 | }
181 | };
182 |
183 | public void readMessage() throws UnsupportedEncodingException{
184 | textField.setText(toRealString(decode(read(s))));
185 | s = "";
186 | }
187 | public String read(String str){
188 | zeroCount =0;
189 | oneCount =0;
190 | String nus = new String();
191 | for(int k=0;k q = new LinkedList();
230 | String snip = "";
231 | String fin ="";
232 | for(int i=0;i