質問編集履歴

4

ソースコードを変更しました。また実行時の状況を記載しました

2017/01/19 06:37

投稿

nissy113
nissy113

スコア12

test CHANGED
File without changes
test CHANGED
@@ -12,256 +12,260 @@
12
12
 
13
13
  グラフを表示するためのbuild.gradleのコード追加はしています。
14
14
 
15
- エラーしてDeplicate class 'Sensor_Actovoty'とでま
15
+ コンパイルを行う、実行はできるのですが加速度の値が表示されせんまたグラフ表示もされていないので加速度の値が取れていなのでしょうか?
16
-
17
-
18
-
19
- コンパイルを行うと
16
+
20
-
21
- Error:(50, 12) エラー: クラス Sensor_Activityはすでにパッケージ com.example.yoshihiro.streetrhythmで定義されています
17
+
22
-
23
- と出ます。
18
+
24
-
25
-
26
-
27
- 下に現在のコードを載せます。どうにかならないでしょうか?
19
+
28
20
 
29
21
  ```ここに言語を入力
30
22
 
31
23
  コード
32
24
 
25
+
26
+
33
- main.java
27
+ package com.example.yoshihiro.streetrhythm;
34
-
35
-
36
-
28
+
29
+
30
+
37
- import java.util.List;
31
+ import java.util.List;
38
-
32
+
39
- import android.content.Intent;
33
+ import android.content.Intent;
40
-
34
+
41
- import android.app.Activity;
35
+ import android.app.Activity;
42
-
36
+
43
- import android.graphics.Color;
37
+ import android.graphics.Color;
44
-
38
+
45
- import android.hardware.Sensor;
39
+ import android.hardware.Sensor;
46
-
40
+
47
- import android.hardware.SensorEvent;
41
+ import android.hardware.SensorEvent;
48
-
42
+
49
- import android.hardware.SensorEventListener;
43
+ import android.hardware.SensorEventListener;
50
-
44
+
51
- import android.hardware.SensorManager;
45
+ import android.hardware.SensorManager;
52
-
46
+
53
- import android.net.Uri;
47
+ import android.net.Uri;
54
-
48
+
55
- import android.os.Bundle;
49
+ import android.os.Bundle;
56
-
50
+
57
- import android.view.View;
51
+ import android.view.View;
58
52
 
59
53
  import android.widget.TextView;
60
54
 
61
55
 
62
56
 
63
- import com.github.mikephil.charting.charts.LineChart;
57
+ import com.github.mikephil.charting.charts.LineChart;
64
-
58
+
65
- import com.github.mikephil.charting.data.Entry;
59
+ import com.github.mikephil.charting.data.Entry;
66
-
60
+
67
- import com.github.mikephil.charting.data.LineData;
61
+ import com.github.mikephil.charting.data.LineData;
68
-
62
+
69
- import com.github.mikephil.charting.data.LineDataSet;
63
+ import com.github.mikephil.charting.data.LineDataSet;
70
-
64
+
71
- import com.github.mikephil.charting.interfaces.datasets.ILineDataSet;
65
+ import com.github.mikephil.charting.interfaces.datasets.ILineDataSet;
72
-
66
+
73
- import com.google.android.gms.appindexing.Action;
67
+ import com.google.android.gms.appindexing.Action;
74
-
68
+
75
- import com.google.android.gms.appindexing.AppIndex;
69
+ import com.google.android.gms.appindexing.AppIndex;
76
-
70
+
77
- import com.google.android.gms.appindexing.Thing;
71
+ import com.google.android.gms.appindexing.Thing;
78
72
 
79
73
  import com.google.android.gms.common.api.GoogleApiClient;
80
74
 
81
75
 
82
76
 
77
+
78
+
83
79
  public class Sensor_Activity extends Activity {
84
80
 
85
81
 
86
82
 
87
- SensorManager manager;
88
-
89
- Sensor sensor;
90
-
91
- TextView xTextView;
92
-
93
- TextView yTextView;
94
-
95
- TextView zTextView;
96
-
97
-
98
-
99
- @Override
100
-
101
- public void onCreate(Bundle savedInstanceState) {
102
-
103
- super.onCreate(savedInstanceState);
104
-
105
- setContentView(R.layout.activity_sensor_);
106
-
107
-
108
-
109
- xTextView = (TextView) findViewById(R.id.xValue);
110
-
111
- yTextView = (TextView) findViewById(R.id.yValue);
112
-
113
- zTextView = (TextView) findViewById(R.id.zValue);
114
-
115
-
116
-
117
- manager = (SensorManager) getSystemService(SENSOR_SERVICE);
118
-
119
- sensor = manager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
120
-
121
-
83
+
84
+
85
+ SensorManager manager;
86
+
87
+ Sensor sensor;
88
+
89
+ TextView xTextView;
90
+
91
+ TextView yTextView;
92
+
93
+ TextView zTextView;
94
+
95
+
96
+
97
+ @Override
98
+
99
+ public void onCreate(Bundle savedInstanceState) {
100
+
101
+ super.onCreate(savedInstanceState);
102
+
103
+ setContentView(R.layout.activity_sensor_);
104
+
105
+
106
+
107
+ xTextView = (TextView) findViewById(R.id.xValue);
108
+
109
+ yTextView = (TextView) findViewById(R.id.yValue);
110
+
111
+ zTextView = (TextView) findViewById(R.id.zValue);
112
+
113
+
114
+
115
+ manager = (SensorManager) getSystemService(SENSOR_SERVICE);
116
+
117
+ sensor = manager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
118
+
119
+
120
+
121
+ }
122
+
123
+
124
+
125
+
126
+
127
+ public class a extends Activity implements SensorEventListener {
128
+
129
+
130
+
131
+ @Override
132
+
133
+ public void onAccuracyChanged(Sensor sensor, int accuracy) {
134
+
135
+
136
+
137
+ }
138
+
139
+
140
+
141
+ @Override
142
+
143
+ protected void onResume() {
144
+
145
+ super.onResume();
146
+
147
+ manager.registerListener(this, sensor, SensorManager.SENSOR_DELAY_UI);
148
+
149
+ }
150
+
151
+
152
+
153
+ @Override
154
+
155
+ protected void onPause() {
156
+
157
+ super.onPause();
158
+
159
+ manager.unregisterListener(this);
160
+
161
+ }
162
+
163
+
164
+
165
+
166
+
167
+ @Override
168
+
169
+ public void onSensorChanged(SensorEvent event) {
170
+
171
+ xTextView.setText(String.valueOf(event.values[0]));
172
+
173
+ yTextView.setText(String.valueOf(event.values[1]));
174
+
175
+ zTextView.setText(String.valueOf(event.values[2]));
176
+
177
+
178
+
179
+ LineData data = mChart.getLineData();
180
+
181
+ if (data != null) {
182
+
183
+ for (int i = 0; i < 3; i++) { // 3軸なのでそれぞれ処理します
184
+
185
+ ILineDataSet set = data.getDataSetByIndex(i);
186
+
187
+ if (set == null) {
188
+
189
+ set = createSet(names[i], colors[i]); // ILineDataSetの初期化は別メソッドにまとめました
190
+
191
+ data.addDataSet(set);
192
+
193
+ }
194
+
195
+
196
+
197
+ data.addEntry(new Entry(set.getEntryCount(), event.values[i]), i); // 実際にデータを追加する
198
+
199
+ data.notifyDataChanged();
200
+
201
+ }
202
+
203
+
204
+
205
+ mChart.notifyDataSetChanged(); // 表示の更新のために変更を通知する
206
+
207
+ mChart.setVisibleXRangeMaximum(50); // 表示の幅を決定する
208
+
209
+ mChart.moveViewToX(data.getEntryCount()); // 最新のデータまで表示を移動させる
210
+
211
+ }
212
+
213
+ }
214
+
215
+
216
+
217
+ LineChart mChart;
218
+
219
+
220
+
221
+ String[] names = new String[]{"x-value", "y-value", "z-value"};
222
+
223
+ int[] colors = new int[]{Color.RED, Color.GREEN, Color.BLUE};
224
+
225
+
226
+
227
+ @Override
228
+
229
+ protected void onCreate(Bundle savedInstanceState) {
230
+
231
+
232
+
233
+ mChart = (LineChart) findViewById(R.id.lineChart);
234
+
235
+
236
+
237
+ mChart.setDescription(""); // 表のタイトルを空にする
238
+
239
+ mChart.setData(new LineData()); // 空のLineData型インスタンスを追加
240
+
241
+ }
242
+
243
+
244
+
245
+ private LineDataSet createSet(String label, int color) {
246
+
247
+ LineDataSet set = new LineDataSet(null, label);
248
+
249
+ set.setLineWidth(2.5f); // 線の幅を指定
250
+
251
+ set.setColor(color); // 線の色を指定
252
+
253
+ set.setDrawCircles(false); // ポイントごとの円を表示しない
254
+
255
+ set.setDrawValues(false); // 値を表示しない
256
+
257
+
258
+
259
+ return set;
260
+
261
+ }
262
+
263
+ }
122
264
 
123
265
  }
124
266
 
125
267
 
126
268
 
127
- public class Sensor_Activity extends Activity implements SensorEventListener {
128
-
129
-
130
-
131
- @Override
132
-
133
- public void onAccuracyChanged(Sensor sensor, int accuracy) {
134
-
135
-
136
-
137
- }
138
-
139
-
140
-
141
- @Override
142
-
143
- protected void onResume() {
144
-
145
- super.onResume();
146
-
147
- manager.registerListener(this, sensor, SensorManager.SENSOR_DELAY_UI);
148
-
149
- }
150
-
151
-
152
-
153
- @Override
154
-
155
- protected void onPause() {
156
-
157
- super.onPause();
158
-
159
- manager.unregisterListener(this);
160
-
161
- }
162
-
163
-
164
-
165
- @Override
166
-
167
- public void onSensorChanged(SensorEvent event) {
168
-
169
- xTextView.setText(String.valueOf(event.values[0]));
170
-
171
- yTextView.setText(String.valueOf(event.values[1]));
172
-
173
- zTextView.setText(String.valueOf(event.values[2]));
174
-
175
-
176
-
177
- LineData data = mChart.getLineData();
178
-
179
- if (data != null) {
180
-
181
- for (int i = 0; i < 3; i++) { // 3軸なのでそれぞれ処理します
182
-
183
- ILineDataSet set = data.getDataSetByIndex(i);
184
-
185
- if (set == null) {
186
-
187
- set = createSet(names[i], colors[i]); // ILineDataSetの初期化は別メソッドにまとめました
188
-
189
- data.addDataSet(set);
190
-
191
- }
192
-
193
-
194
-
195
- data.addEntry(new Entry(set.getEntryCount(), event.values[i]), i); // 実際にデータを追加する
196
-
197
- data.notifyDataChanged();
198
-
199
- }
200
-
201
-
202
-
203
- mChart.notifyDataSetChanged(); // 表示の更新のために変更を通知する
204
-
205
- mChart.setVisibleXRangeMaximum(50); // 表示の幅を決定する
206
-
207
- mChart.moveViewToX(data.getEntryCount()); // 最新のデータまで表示を移動させる
208
-
209
- }
210
-
211
- }
212
-
213
-
214
-
215
- private LineDataSet createSet(String label, int color) {
216
-
217
- LineDataSet set = new LineDataSet(null, label);
218
-
219
- set.setLineWidth(2.5f); // 線の幅を指定
220
-
221
- set.setColor(color); // 線の色を指定
222
-
223
- set.setDrawCircles(false); // ポイントごとの円を表示しない
224
-
225
- set.setDrawValues(false); // 値を表示しない
226
-
227
-
228
-
229
- return set;
230
-
231
- }
232
-
233
-
234
-
235
- LineChart mChart;
236
-
237
-
238
-
239
- String[] names = new String[]{"x-value", "y-value", "z-value"};
240
-
241
- int[] colors = new int[]{Color.RED, Color.GREEN, Color.BLUE};
242
-
243
-
244
-
245
- @Override
246
-
247
- protected void onCreate(Bundle savedInstanceState) {
248
-
249
-
250
-
251
- mChart = (LineChart) findViewById(R.id.lineChart);
252
-
253
-
254
-
255
- mChart.setDescription(""); // 表のタイトルを空にする
256
-
257
- mChart.setData(new LineData()); // 空のLineData型インスタンスを追加
258
-
259
- }
260
-
261
- }
262
-
263
- }
264
-
265
269
 
266
270
 
267
271
  xml

3

コンパイル結果を載せました

2017/01/19 06:37

投稿

nissy113
nissy113

スコア12

test CHANGED
File without changes
test CHANGED
@@ -16,6 +16,14 @@
16
16
 
17
17
 
18
18
 
19
+ コンパイルを行うと
20
+
21
+ Error:(50, 12) エラー: クラス Sensor_Activityはすでにパッケージ com.example.yoshihiro.streetrhythmで定義されています
22
+
23
+ と出ます。
24
+
25
+
26
+
19
27
  下に現在のコードを載せます。どうにかならないでしょうか?
20
28
 
21
29
  ```ここに言語を入力

2

若干のコードを修正しました

2017/01/18 17:33

投稿

nissy113
nissy113

スコア12

test CHANGED
File without changes
test CHANGED
@@ -166,7 +166,7 @@
166
166
 
167
167
 
168
168
 
169
- ineData data = mChart.getLineData();
169
+ LineData data = mChart.getLineData();
170
170
 
171
171
  if (data != null) {
172
172
 

1

コードの記入方法を変更しました

2017/01/18 17:25

投稿

nissy113
nissy113

スコア12

test CHANGED
File without changes
test CHANGED
@@ -18,241 +18,239 @@
18
18
 
19
19
  下に現在のコードを載せます。どうにかならないでしょうか?
20
20
 
21
-
21
+ ```ここに言語を入力
22
+
23
+ コード
22
24
 
23
25
  main.java
24
26
 
25
27
 
26
28
 
27
- import java.util.List;
29
+ import java.util.List;
28
-
30
+
29
- import android.content.Intent;
31
+ import android.content.Intent;
30
-
32
+
31
- import android.app.Activity;
33
+ import android.app.Activity;
32
-
34
+
33
- import android.graphics.Color;
35
+ import android.graphics.Color;
34
-
36
+
35
- import android.hardware.Sensor;
37
+ import android.hardware.Sensor;
36
-
38
+
37
- import android.hardware.SensorEvent;
39
+ import android.hardware.SensorEvent;
38
-
40
+
39
- import android.hardware.SensorEventListener;
41
+ import android.hardware.SensorEventListener;
40
-
42
+
41
- import android.hardware.SensorManager;
43
+ import android.hardware.SensorManager;
42
-
44
+
43
- import android.net.Uri;
45
+ import android.net.Uri;
44
-
46
+
45
- import android.os.Bundle;
47
+ import android.os.Bundle;
46
-
48
+
47
- import android.view.View;
49
+ import android.view.View;
48
50
 
49
51
  import android.widget.TextView;
50
52
 
51
53
 
52
54
 
53
- import com.github.mikephil.charting.charts.LineChart;
55
+ import com.github.mikephil.charting.charts.LineChart;
54
-
56
+
55
- import com.github.mikephil.charting.data.Entry;
57
+ import com.github.mikephil.charting.data.Entry;
56
-
58
+
57
- import com.github.mikephil.charting.data.LineData;
59
+ import com.github.mikephil.charting.data.LineData;
58
-
60
+
59
- import com.github.mikephil.charting.data.LineDataSet;
61
+ import com.github.mikephil.charting.data.LineDataSet;
60
-
62
+
61
- import com.github.mikephil.charting.interfaces.datasets.ILineDataSet;
63
+ import com.github.mikephil.charting.interfaces.datasets.ILineDataSet;
62
-
64
+
63
- import com.google.android.gms.appindexing.Action;
65
+ import com.google.android.gms.appindexing.Action;
64
-
66
+
65
- import com.google.android.gms.appindexing.AppIndex;
67
+ import com.google.android.gms.appindexing.AppIndex;
66
-
68
+
67
- import com.google.android.gms.appindexing.Thing;
69
+ import com.google.android.gms.appindexing.Thing;
68
70
 
69
71
  import com.google.android.gms.common.api.GoogleApiClient;
70
72
 
71
73
 
72
74
 
73
-
74
-
75
75
  public class Sensor_Activity extends Activity {
76
76
 
77
77
 
78
78
 
79
-
80
-
81
- SensorManager manager;
82
-
83
- Sensor sensor;
84
-
85
- TextView xTextView;
86
-
87
- TextView yTextView;
88
-
89
- TextView zTextView;
90
-
91
-
92
-
93
- @Override
94
-
95
- public void onCreate(Bundle savedInstanceState) {
96
-
97
- super.onCreate(savedInstanceState);
98
-
99
- setContentView(R.layout.activity_sensor_);
100
-
101
-
102
-
103
- xTextView = (TextView) findViewById(R.id.xValue);
104
-
105
- yTextView = (TextView) findViewById(R.id.yValue);
106
-
107
- zTextView = (TextView) findViewById(R.id.zValue);
108
-
109
-
110
-
111
- manager = (SensorManager) getSystemService(SENSOR_SERVICE);
112
-
113
- sensor = manager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
114
-
115
-
116
-
117
- }
118
-
119
-
120
-
121
- public class Sensor_Activity extends Activity implements SensorEventListener {
122
-
123
-
124
-
125
- @Override
126
-
127
- public void onAccuracyChanged(Sensor sensor, int accuracy) {
128
-
129
-
130
-
131
- }
132
-
133
-
134
-
135
- @Override
136
-
137
- protected void onResume() {
138
-
139
- super.onResume();
140
-
141
- manager.registerListener(this, sensor, SensorManager.SENSOR_DELAY_UI);
142
-
143
- }
144
-
145
-
146
-
147
- @Override
148
-
149
- protected void onPause() {
150
-
151
- super.onPause();
152
-
153
- manager.unregisterListener(this);
154
-
155
- }
156
-
157
-
158
-
159
- @Override
160
-
161
- public void onSensorChanged(SensorEvent event) {
162
-
163
- xTextView.setText(String.valueOf(event.values[0]));
164
-
165
- yTextView.setText(String.valueOf(event.values[1]));
166
-
167
- zTextView.setText(String.valueOf(event.values[2]));
168
-
169
-
170
-
171
- ineData data = mChart.getLineData();
172
-
173
- if (data != null) {
174
-
175
- for (int i = 0; i < 3; i++) { // 3軸なのでそれぞれ処理します
176
-
177
- ILineDataSet set = data.getDataSetByIndex(i);
178
-
179
- if (set == null) {
180
-
181
- set = createSet(names[i], colors[i]); // ILineDataSetの初期化は別メソッドにまとめました
182
-
183
- data.addDataSet(set);
184
-
185
- }
186
-
187
-
188
-
189
- data.addEntry(new Entry(set.getEntryCount(), event.values[i]), i); // 実際にデータを追加する
190
-
191
- data.notifyDataChanged();
192
-
193
- }
194
-
195
-
196
-
197
- mChart.notifyDataSetChanged(); // 表示の更新のために変更通知する
198
-
199
- mChart.setVisibleXRangeMaximum(50); // 表示の幅決定す
200
-
201
- mChart.moveViewToX(data.getEntryCount()); // 最新のデータまで表示を移動させる
202
-
203
- }
204
-
205
- }
206
-
207
-
208
-
209
- private LineDataSet createSet(String label, int color) {
210
-
211
- LineDataSet set = new LineDataSet(null, label);
212
-
213
- set.setLineWidth(2.5f); // 線のを指定
214
-
215
- set.setColor(color); // 指定
216
-
217
- set.setDrawCircles(false); // ポイントごとの円を表示しない
218
-
219
- set.setDrawValues(false); // 値を表示しない
220
-
221
-
222
-
223
- return set;
224
-
225
- }
226
-
227
-
228
-
229
- LineChart mChart;
230
-
231
-
232
-
233
- String[] names = new String[]{"x-value", "y-value", "z-value"};
234
-
235
- int[] colors = new int[]{Color.RED, Color.GREEN, Color.BLUE};
236
-
237
-
238
-
239
- @Override
240
-
241
- protected void onCreate(Bundle savedInstanceState) {
242
-
243
-
244
-
245
- mChart = (LineChart) findViewById(R.id.lineChart);
246
-
247
-
248
-
249
- mChart.setDescription(""); // のタイトル空にする
250
-
251
- mChart.setData(new LineData()); // 空のLineData型インスタンスを追加
252
-
253
- }
254
-
255
- }
79
+ SensorManager manager;
80
+
81
+ Sensor sensor;
82
+
83
+ TextView xTextView;
84
+
85
+ TextView yTextView;
86
+
87
+ TextView zTextView;
88
+
89
+
90
+
91
+ @Override
92
+
93
+ public void onCreate(Bundle savedInstanceState) {
94
+
95
+ super.onCreate(savedInstanceState);
96
+
97
+ setContentView(R.layout.activity_sensor_);
98
+
99
+
100
+
101
+ xTextView = (TextView) findViewById(R.id.xValue);
102
+
103
+ yTextView = (TextView) findViewById(R.id.yValue);
104
+
105
+ zTextView = (TextView) findViewById(R.id.zValue);
106
+
107
+
108
+
109
+ manager = (SensorManager) getSystemService(SENSOR_SERVICE);
110
+
111
+ sensor = manager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
112
+
113
+
114
+
115
+ }
116
+
117
+
118
+
119
+ public class Sensor_Activity extends Activity implements SensorEventListener {
120
+
121
+
122
+
123
+ @Override
124
+
125
+ public void onAccuracyChanged(Sensor sensor, int accuracy) {
126
+
127
+
128
+
129
+ }
130
+
131
+
132
+
133
+ @Override
134
+
135
+ protected void onResume() {
136
+
137
+ super.onResume();
138
+
139
+ manager.registerListener(this, sensor, SensorManager.SENSOR_DELAY_UI);
140
+
141
+ }
142
+
143
+
144
+
145
+ @Override
146
+
147
+ protected void onPause() {
148
+
149
+ super.onPause();
150
+
151
+ manager.unregisterListener(this);
152
+
153
+ }
154
+
155
+
156
+
157
+ @Override
158
+
159
+ public void onSensorChanged(SensorEvent event) {
160
+
161
+ xTextView.setText(String.valueOf(event.values[0]));
162
+
163
+ yTextView.setText(String.valueOf(event.values[1]));
164
+
165
+ zTextView.setText(String.valueOf(event.values[2]));
166
+
167
+
168
+
169
+ ineData data = mChart.getLineData();
170
+
171
+ if (data != null) {
172
+
173
+ for (int i = 0; i < 3; i++) { // 3軸なのでそれぞれ処理します
174
+
175
+ ILineDataSet set = data.getDataSetByIndex(i);
176
+
177
+ if (set == null) {
178
+
179
+ set = createSet(names[i], colors[i]); // ILineDataSetの初期化は別メソッドにまとめました
180
+
181
+ data.addDataSet(set);
182
+
183
+ }
184
+
185
+
186
+
187
+ data.addEntry(new Entry(set.getEntryCount(), event.values[i]), i); // 実際にデータを追加する
188
+
189
+ data.notifyDataChanged();
190
+
191
+ }
192
+
193
+
194
+
195
+ mChart.notifyDataSetChanged(); // 表示の更新のために変更を通知する
196
+
197
+ mChart.setVisibleXRangeMaximum(50); // 表示の決定する
198
+
199
+ mChart.moveViewToX(data.getEntryCount()); // 最新のデータまで表示を移動させ
200
+
201
+ }
202
+
203
+ }
204
+
205
+
206
+
207
+ private LineDataSet createSet(String label, int color) {
208
+
209
+ LineDataSet set = new LineDataSet(null, label);
210
+
211
+ set.setLineWidth(2.5f); // 線の幅を指定
212
+
213
+ set.setColor(color); // 線のを指定
214
+
215
+ set.setDrawCircles(false); // ポイントごと表示しない
216
+
217
+ set.setDrawValues(false); // を表示しない
218
+
219
+
220
+
221
+ return set;
222
+
223
+ }
224
+
225
+
226
+
227
+ LineChart mChart;
228
+
229
+
230
+
231
+ String[] names = new String[]{"x-value", "y-value", "z-value"};
232
+
233
+ int[] colors = new int[]{Color.RED, Color.GREEN, Color.BLUE};
234
+
235
+
236
+
237
+ @Override
238
+
239
+ protected void onCreate(Bundle savedInstanceState) {
240
+
241
+
242
+
243
+ mChart = (LineChart) findViewById(R.id.lineChart);
244
+
245
+
246
+
247
+ mChart.setDescription(""); // 表のタイトルを空にする
248
+
249
+ mChart.setData(new LineData()); // LineData型インスンス追加
250
+
251
+ }
252
+
253
+ }
256
254
 
257
255
  }
258
256
 
@@ -262,100 +260,102 @@
262
260
 
263
261
 
264
262
 
265
- <?xml version="1.0" encoding="utf-8"?>
266
-
267
- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
268
-
269
- xmlns:tools="http://schemas.android.com/tools"
270
-
271
- android:id="@+id/activity_sensor"
272
-
273
- android:layout_width="match_parent"
274
-
275
- android:layout_height="match_parent"
276
-
277
- android:paddingBottom="@dimen/activity_vertical_margin"
278
-
279
- android:paddingLeft="@dimen/activity_horizontal_margin"
280
-
281
- android:paddingRight="@dimen/activity_horizontal_margin"
282
-
283
- android:paddingTop="@dimen/activity_vertical_margin"
284
-
285
- tools:context="com.example.yoshihiro.streetrhythm.Sensor_Activity">
286
-
287
-
288
-
289
- <TextView
290
-
291
- android:layout_width="wrap_content"
292
-
293
- android:layout_height="wrap_content"
294
-
295
- android:layout_below="@+id/xValue"
296
-
297
- android:layout_alignLeft="@+id/xValue"
298
-
299
- android:layout_alignStart="@+id/xValue"
300
-
301
- android:layout_marginTop="11dp"
302
-
303
- android:id="@+id/yValue" />
304
-
305
-
306
-
307
- <TextView
308
-
309
- android:layout_width="wrap_content"
310
-
311
- android:layout_height="wrap_content"
312
-
313
- android:layout_marginTop="14dp"
314
-
315
- android:id="@+id/zValue"
316
-
317
- android:layout_below="@+id/yValue"
318
-
319
- android:layout_alignLeft="@+id/yValue"
320
-
321
- android:layout_alignStart="@+id/yValue"
322
-
323
- android:layout_alignRight="@+id/yValue"
324
-
325
- android:layout_alignEnd="@+id/yValue" />
326
-
327
-
328
-
329
- <TextView
330
-
331
- android:layout_width="wrap_content"
332
-
333
- android:layout_height="wrap_content"
334
-
335
- android:layout_marginLeft="12dp"
336
-
337
- android:layout_marginStart="12dp"
338
-
339
- android:layout_marginTop="14dp"
340
-
341
- android:id="@+id/xValue"
342
-
343
- android:layout_alignParentTop="true"
344
-
345
- android:layout_alignParentLeft="true"
346
-
347
- android:layout_alignParentStart="true" />
348
-
349
-
350
-
351
- <com.github.mikephil.charting.charts.LineChart
352
-
353
- android:layout_width="match_parent"
354
-
355
- android:layout_height="match_parent"
356
-
357
- android:id="@+id/lineChart"/>
263
+ <?xml version="1.0" encoding="utf-8"?>
264
+
265
+ <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
266
+
267
+ xmlns:tools="http://schemas.android.com/tools"
268
+
269
+ android:id="@+id/activity_sensor"
270
+
271
+ android:layout_width="match_parent"
272
+
273
+ android:layout_height="match_parent"
274
+
275
+ android:paddingBottom="@dimen/activity_vertical_margin"
276
+
277
+ android:paddingLeft="@dimen/activity_horizontal_margin"
278
+
279
+ android:paddingRight="@dimen/activity_horizontal_margin"
280
+
281
+ android:paddingTop="@dimen/activity_vertical_margin"
282
+
283
+ tools:context="com.example.yoshihiro.streetrhythm.Sensor_Activity">
284
+
285
+
286
+
287
+ <TextView
288
+
289
+ android:layout_width="wrap_content"
290
+
291
+ android:layout_height="wrap_content"
292
+
293
+ android:layout_below="@+id/xValue"
294
+
295
+ android:layout_alignLeft="@+id/xValue"
296
+
297
+ android:layout_alignStart="@+id/xValue"
298
+
299
+ android:layout_marginTop="11dp"
300
+
301
+ android:id="@+id/yValue" />
302
+
303
+
304
+
305
+ <TextView
306
+
307
+ android:layout_width="wrap_content"
308
+
309
+ android:layout_height="wrap_content"
310
+
311
+ android:layout_marginTop="14dp"
312
+
313
+ android:id="@+id/zValue"
314
+
315
+ android:layout_below="@+id/yValue"
316
+
317
+ android:layout_alignLeft="@+id/yValue"
318
+
319
+ android:layout_alignStart="@+id/yValue"
320
+
321
+ android:layout_alignRight="@+id/yValue"
322
+
323
+ android:layout_alignEnd="@+id/yValue" />
324
+
325
+
326
+
327
+ <TextView
328
+
329
+ android:layout_width="wrap_content"
330
+
331
+ android:layout_height="wrap_content"
332
+
333
+ android:layout_marginLeft="12dp"
334
+
335
+ android:layout_marginStart="12dp"
336
+
337
+ android:layout_marginTop="14dp"
338
+
339
+ android:id="@+id/xValue"
340
+
341
+ android:layout_alignParentTop="true"
342
+
343
+ android:layout_alignParentLeft="true"
344
+
345
+ android:layout_alignParentStart="true" />
346
+
347
+
348
+
349
+ <com.github.mikephil.charting.charts.LineChart
350
+
351
+ android:layout_width="match_parent"
352
+
353
+ android:layout_height="match_parent"
354
+
355
+ android:id="@+id/lineChart"/>
358
356
 
359
357
 
360
358
 
361
359
  </RelativeLayout>
360
+
361
+ ```