Password validation for bluetooth connection to the device
This commit is contained in:
parent
d03fbd016b
commit
7c6dfdb3e1
@ -2,6 +2,8 @@ package com.example.beacondemo.Activity;
|
|||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@ -31,6 +33,10 @@ public class DetailActivity extends AppCompatActivity implements View.OnClickLis
|
|||||||
|
|
||||||
int mCurSlot = 2;
|
int mCurSlot = 2;
|
||||||
|
|
||||||
|
TextView txt_name,txt_mac,txt_battery,txt_rssi,txt_device,txt_xaxis,txt_yaxis,txt_zaxis;
|
||||||
|
String mac,name;
|
||||||
|
int battery,rssi;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@ -44,6 +50,35 @@ public class DetailActivity extends AppCompatActivity implements View.OnClickLis
|
|||||||
private void initView() {
|
private void initView() {
|
||||||
ivBack = findViewById(R.id.iv_back);
|
ivBack = findViewById(R.id.iv_back);
|
||||||
tvSet = findViewById(R.id.tv_set);
|
tvSet = findViewById(R.id.tv_set);
|
||||||
|
|
||||||
|
//txt_battery=findViewById(R.id.txt_battery);
|
||||||
|
txt_mac=findViewById(R.id.txt_mac);
|
||||||
|
txt_name=findViewById(R.id.txt_name);
|
||||||
|
//txt_rssi=findViewById(R.id.txt_rssi);
|
||||||
|
txt_device=findViewById(R.id.txt_device);
|
||||||
|
txt_xaxis=findViewById(R.id.txt_xaxis);
|
||||||
|
txt_yaxis=findViewById(R.id.txt_yaxis);
|
||||||
|
txt_zaxis=findViewById(R.id.txt_zaxis);
|
||||||
|
|
||||||
|
Intent intent = getIntent();
|
||||||
|
String mac = intent.getStringExtra("mac");
|
||||||
|
String name = intent.getStringExtra("name");
|
||||||
|
int battery = intent.getIntExtra("battery",0);
|
||||||
|
int rssi = intent.getIntExtra("rssi",0);
|
||||||
|
String xaxis = intent.getStringExtra("xaxis");
|
||||||
|
String yaxis = intent.getStringExtra("yaxis");
|
||||||
|
String zaxis = intent.getStringExtra("zaxis");
|
||||||
|
|
||||||
|
txt_mac.setText("Mac Address : "+mac);
|
||||||
|
txt_name.setText("Device Name : "+name);
|
||||||
|
/*txt_rssi.setText(rssi);
|
||||||
|
txt_battery.setText(battery);*/
|
||||||
|
txt_xaxis.setText("X axis: " +xaxis);
|
||||||
|
txt_yaxis.setText("Y axis: " +yaxis);
|
||||||
|
txt_zaxis.setText("Z axis: " +zaxis);
|
||||||
|
txt_device.setText("Device in range. ");
|
||||||
|
txt_device.setTextColor(Color.BLUE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initData() {
|
private void initData() {
|
||||||
|
@ -15,8 +15,10 @@ import android.bluetooth.BluetoothManager;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.text.Html;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
@ -29,6 +31,7 @@ import com.example.beacondemo.adapter.RecycleViewDivider;
|
|||||||
import com.minew.beaconplus.sdk.MTCentralManager;
|
import com.minew.beaconplus.sdk.MTCentralManager;
|
||||||
import com.minew.beaconplus.sdk.MTFrameHandler;
|
import com.minew.beaconplus.sdk.MTFrameHandler;
|
||||||
import com.minew.beaconplus.sdk.MTPeripheral;
|
import com.minew.beaconplus.sdk.MTPeripheral;
|
||||||
|
import com.minew.beaconplus.sdk.Utils.LogUtils;
|
||||||
import com.minew.beaconplus.sdk.enums.BluetoothState;
|
import com.minew.beaconplus.sdk.enums.BluetoothState;
|
||||||
import com.minew.beaconplus.sdk.enums.ConnectionStatus;
|
import com.minew.beaconplus.sdk.enums.ConnectionStatus;
|
||||||
import com.minew.beaconplus.sdk.enums.FrameType;
|
import com.minew.beaconplus.sdk.enums.FrameType;
|
||||||
@ -76,7 +79,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
ArrayList<MinewFrame> advFrames;
|
ArrayList<MinewFrame> advFrames;
|
||||||
|
|
||||||
TextView txt_name,txt_mac,txt_battery,txt_rssi,txt_device,txt_xaxis,txt_yaxis,txt_zaxis;
|
TextView txt_name,txt_mac,txt_battery,txt_rssi,txt_device,txt_xaxis,txt_yaxis,txt_zaxis;
|
||||||
String mac,name;
|
String mac,name,xaxis,yaxis,zaxis;
|
||||||
int battery,rssi;
|
int battery,rssi;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -116,6 +119,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
@SuppressLint("MissingPermission")
|
@SuppressLint("MissingPermission")
|
||||||
private void showBLEDialog() {
|
private void showBLEDialog() {
|
||||||
|
System.out.println("Hitting the dialog box");
|
||||||
final Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
|
final Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
|
||||||
startActivityForResult(enableIntent, REQUEST_ENABLE_BT);
|
startActivityForResult(enableIntent, REQUEST_ENABLE_BT);
|
||||||
}
|
}
|
||||||
@ -134,11 +138,14 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
private void initData() {
|
private void initData() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mMtCentralManager.startScan();
|
mMtCentralManager.startScan();
|
||||||
mMtCentralManager.setMTCentralManagerListener(new MTCentralManagerListener() {
|
mMtCentralManager.setMTCentralManagerListener(new MTCentralManagerListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onScanedPeripheral(final List<MTPeripheral> peripherals) {
|
public void onScanedPeripheral(final List<MTPeripheral> peripherals) {
|
||||||
Log.e("Peripherals : ", String.valueOf(peripherals.size()));
|
Log.e("Peripherals : ", String.valueOf(peripherals.size()));
|
||||||
|
mAdapter.setData(peripherals);
|
||||||
for (MTPeripheral mtPeripheral : peripherals) {
|
for (MTPeripheral mtPeripheral : peripherals) {
|
||||||
// get FrameHandler of a device.
|
// get FrameHandler of a device.
|
||||||
MTFrameHandler mtFrameHandler = mtPeripheral.mMTFrameHandler;
|
MTFrameHandler mtFrameHandler = mtPeripheral.mMTFrameHandler;
|
||||||
@ -147,9 +154,15 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
battery = mtFrameHandler.getBattery(); //battery
|
battery = mtFrameHandler.getBattery(); //battery
|
||||||
rssi = mtFrameHandler.getRssi(); //rssi
|
rssi = mtFrameHandler.getRssi(); //rssi
|
||||||
txt_device.setText("Device in range. ");
|
txt_device.setText("Device in range. ");
|
||||||
|
txt_device.setTextColor(Color.BLUE);
|
||||||
|
|
||||||
|
String html1 = "<font color=" + Color.BLACK
|
||||||
|
+ ">Mac Address : </font><font color="
|
||||||
|
+ Color.BLACK + ">"+ mac+"</font>";
|
||||||
|
|
||||||
|
txt_mac.setText(Html.fromHtml(html1));
|
||||||
|
|
||||||
|
|
||||||
txt_mac.setText("Mac Address : "+mac);
|
|
||||||
txt_name.setText("Device Name : "+name);
|
txt_name.setText("Device Name : "+name);
|
||||||
txt_battery.setText("Battery Status : "+battery);
|
txt_battery.setText("Battery Status : "+battery);
|
||||||
txt_rssi.setText(" Rssi : "+rssi);
|
txt_rssi.setText(" Rssi : "+rssi);
|
||||||
@ -171,9 +184,23 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
break;
|
break;
|
||||||
case FrameAccSensor:
|
case FrameAccSensor:
|
||||||
AccFrame accFrame = (AccFrame) minewFrame;//acc
|
AccFrame accFrame = (AccFrame) minewFrame;//acc
|
||||||
txt_xaxis.setText("X axis: " + accFrame.getXAxis());
|
xaxis = String.valueOf(accFrame.getXAxis());
|
||||||
txt_yaxis.setText("Y axis: " + accFrame.getYAxis());
|
yaxis = String.valueOf(accFrame.getYAxis());
|
||||||
txt_zaxis.setText("Z axis: " + accFrame.getZAxis());
|
zaxis = String.valueOf(accFrame.getZAxis());
|
||||||
|
|
||||||
|
txt_xaxis.setText("X axis: " + xaxis);
|
||||||
|
txt_yaxis.setText("Y axis: " + yaxis);
|
||||||
|
txt_zaxis.setText("Z axis: " + zaxis);
|
||||||
|
|
||||||
|
if (accFrame.getXAxis() == Double.MIN_VALUE) {
|
||||||
|
Log.v("tag","this value is not available.");
|
||||||
|
}
|
||||||
|
if (accFrame.getYAxis() == Double.MIN_VALUE) {
|
||||||
|
Log.v("tag","this value is not available.");
|
||||||
|
}
|
||||||
|
if (accFrame.getZAxis() == Double.MIN_VALUE) {
|
||||||
|
Log.v("tag","this value is not available.");
|
||||||
|
}
|
||||||
Log.v("beaconplus3", String.valueOf(accFrame.getXAxis() + " "+ accFrame.getYAxis() +" "+ accFrame.getZAxis()));
|
Log.v("beaconplus3", String.valueOf(accFrame.getXAxis() + " "+ accFrame.getYAxis() +" "+ accFrame.getZAxis()));
|
||||||
break;
|
break;
|
||||||
case FrameHTSensor:
|
case FrameHTSensor:
|
||||||
@ -206,7 +233,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
break;
|
break;
|
||||||
case FrameTVOCSensor://tvoc
|
case FrameTVOCSensor://tvoc
|
||||||
TvocFrame tvocFrame = (TvocFrame) minewFrame;
|
TvocFrame tvocFrame = (TvocFrame) minewFrame;
|
||||||
Log.v("beaconplus11", "battery:" + tvocFrame.getBattery() + " "+ ",TVOC:"+ tvocFrame.getValue() + " "+ "ppb," + "battery:" " "+ +tvocFrame.getBattery() + "mV");
|
Log.v("beaconplus11", "battery:" + tvocFrame.getBattery() + " "+ ",TVOC:"+ tvocFrame.getValue() + " "+ "ppb," + "battery:"+ " "+ +tvocFrame.getBattery() + "mV");
|
||||||
break;
|
break;
|
||||||
case FrameLineBeacon://FrameLineBeacon
|
case FrameLineBeacon://FrameLineBeacon
|
||||||
LineBeaconFrame lineBeacon = ((LineBeaconFrame) minewFrame);
|
LineBeaconFrame lineBeacon = ((LineBeaconFrame) minewFrame);
|
||||||
@ -272,15 +299,76 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/*mMtCentralManager.connect(mtPeripheral,connectionStatueListener);
|
||||||
|
ConnectionStatueListener connectionStatueListener = new ConnectionStatueListener(){
|
||||||
|
@Override
|
||||||
|
public void onUpdateConnectionStatus(final ConnectionStatus connectionStatus,final GetPasswordListener getPasswordListener) {
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
switch (connectionStatus){
|
||||||
|
case PASSWORDVALIDATING:
|
||||||
|
String password = "minew123";
|
||||||
|
getPasswordListener.getPassword(password);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
switch (connectionStatus) {
|
||||||
|
case CONNECTING:
|
||||||
|
Log.e("minew_tag", ": CONNECTING");
|
||||||
|
break;
|
||||||
|
case CONNECTED:
|
||||||
|
Log.e("minew_tag", ": CONNECTED");
|
||||||
|
break;
|
||||||
|
case READINGINFO:
|
||||||
|
//Advanced exercise can be notified when reading firmware information
|
||||||
|
Log.e("minew_tag", ": Read device firmware information");
|
||||||
|
break;
|
||||||
|
case DEVICEVALIDATING://After successfully verifying the device, write the verification key to the device
|
||||||
|
LogUtils.e("DEVICEVALIDATING");
|
||||||
|
break;
|
||||||
|
case PASSWORDVALIDATING:
|
||||||
|
String password = "minew123";
|
||||||
|
getPasswordListener.getPassword(password);
|
||||||
|
break;
|
||||||
|
case SYNCHRONIZINGTIME://Password verification completed
|
||||||
|
Log.e("minew_tag", ": SYNCHRONIZINGTIME");
|
||||||
|
break;
|
||||||
|
case READINGCONNECTABLE:
|
||||||
|
Log.e("minew_tag", ": Read device firmware information");
|
||||||
|
LogUtils.e("READINGCONNECTABLE");
|
||||||
|
break;
|
||||||
|
case READINGFEATURE:
|
||||||
|
LogUtils.e("READINGFEATURE");
|
||||||
|
break;
|
||||||
|
case READINGFRAMES:
|
||||||
|
LogUtils.e("READINGFRAMES");
|
||||||
|
break;
|
||||||
|
case READINGTRIGGERS:
|
||||||
|
LogUtils.e("READINGTRIGGERS");
|
||||||
|
break;
|
||||||
|
case READINGSENSORS:
|
||||||
|
LogUtils.e("READINGSENSORS");
|
||||||
|
break;
|
||||||
|
case COMPLETED:
|
||||||
|
//At this point the connection is successful and the parameters are written to the device
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(MTException e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
mMtCentralManager.disconnect(mtPeripheral);*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initView() {
|
private void initView() {
|
||||||
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this);
|
|
||||||
txt_battery=findViewById(R.id.txt_battery);
|
txt_battery=findViewById(R.id.txt_battery);
|
||||||
txt_mac=findViewById(R.id.txt_mac);
|
txt_mac=findViewById(R.id.txt_mac);
|
||||||
txt_name=findViewById(R.id.txt_name);
|
txt_name=findViewById(R.id.txt_name);
|
||||||
@ -289,9 +377,11 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
txt_xaxis=findViewById(R.id.txt_xaxis);
|
txt_xaxis=findViewById(R.id.txt_xaxis);
|
||||||
txt_yaxis=findViewById(R.id.txt_yaxis);
|
txt_yaxis=findViewById(R.id.txt_yaxis);
|
||||||
txt_zaxis=findViewById(R.id.txt_zaxis);
|
txt_zaxis=findViewById(R.id.txt_zaxis);
|
||||||
|
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this);
|
||||||
mRecycle.setLayoutManager(layoutManager);
|
mRecycle.setLayoutManager(layoutManager);
|
||||||
mAdapter = new RecycleAdapter();
|
mAdapter = new RecycleAdapter();
|
||||||
mRecycle.setAdapter(mAdapter);
|
mRecycle.setAdapter(mAdapter);
|
||||||
|
System.out.println("Data is set in recyclerview through the adapter");
|
||||||
/*mRecycle.addItemDecoration(new RecycleViewDivider(this, LinearLayoutManager
|
/*mRecycle.addItemDecoration(new RecycleViewDivider(this, LinearLayoutManager
|
||||||
.HORIZONTAL));*/
|
.HORIZONTAL));*/
|
||||||
|
|
||||||
@ -358,17 +448,21 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initListener() {
|
private void initListener() {
|
||||||
|
|
||||||
|
mMtCentralManager.startScan();
|
||||||
mMtCentralManager.setMTCentralManagerListener(new MTCentralManagerListener() {
|
mMtCentralManager.setMTCentralManagerListener(new MTCentralManagerListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onScanedPeripheral(final List<MTPeripheral> peripherals) {
|
public void onScanedPeripheral(final List<MTPeripheral> peripherals) {
|
||||||
Log.e("demo11", " " + peripherals.size());
|
Log.e("demo11", " " + peripherals.size());
|
||||||
mAdapter.setData(peripherals);
|
mAdapter.setData(peripherals);
|
||||||
|
System.out.println("Data set in the adapter");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mAdapter.setOnItemClickListener(new RecycleAdapter.OnItemClickListener() {
|
mAdapter.setOnItemClickListener(new RecycleAdapter.OnItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(View view, int position) {
|
public void onItemClick(View view, int position) {
|
||||||
mtPeripheral = mAdapter.getData(position);
|
mtPeripheral = mAdapter.getData(position);
|
||||||
|
System.out.println("Inside click listener of the adapter");
|
||||||
mMtCentralManager.connect(mtPeripheral, connectionStatueListener);
|
mMtCentralManager.connect(mtPeripheral, connectionStatueListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -432,9 +526,16 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
Log.e("tag", "COMPLETED");
|
Log.e("tag", "COMPLETED");
|
||||||
Toast.makeText(MainActivity.this, "COMPLETED", Toast.LENGTH_SHORT).show();
|
Toast.makeText(MainActivity.this, "COMPLETED", Toast.LENGTH_SHORT).show();
|
||||||
mMtCentralManager.disconnect(mtPeripheral);
|
mMtCentralManager.disconnect(mtPeripheral);
|
||||||
// Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
// intent.setClass(MainActivity.this, DetailActivity.class);
|
intent.setClass(MainActivity.this, DetailActivity.class);
|
||||||
// startActivity(intent);
|
intent.putExtra("mac", mac);
|
||||||
|
intent.putExtra("name", name);
|
||||||
|
intent.putExtra("battery", battery);
|
||||||
|
intent.putExtra("rssi", rssi);
|
||||||
|
intent.putExtra("xaxis", xaxis);
|
||||||
|
intent.putExtra("yaxis", yaxis);
|
||||||
|
intent.putExtra("zaxis", zaxis);
|
||||||
|
startActivity(intent);
|
||||||
break;
|
break;
|
||||||
case CONNECTFAILED:
|
case CONNECTFAILED:
|
||||||
case DISCONNECTED:
|
case DISCONNECTED:
|
||||||
|
@ -31,6 +31,104 @@
|
|||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="300dp"
|
||||||
|
app:cardElevation="10dp"
|
||||||
|
app:cardCornerRadius="20dp"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
app:cardBackgroundColor="#D3D3D3"
|
||||||
|
app:cardMaxElevation="12dp"
|
||||||
|
app:cardPreventCornerOverlap="true"
|
||||||
|
app:cardUseCompatPadding="true">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="5dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Name :"
|
||||||
|
android:id="@+id/txt_name"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
>
|
||||||
|
</TextView>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Macc :"
|
||||||
|
android:id="@+id/txt_mac"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
|
||||||
|
>
|
||||||
|
</TextView>
|
||||||
|
|
||||||
|
<!--<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Battery :"
|
||||||
|
android:id="@+id/txt_battery"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
>
|
||||||
|
</TextView>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_rssi"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:text="Rssi :"></TextView>-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_xaxis"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:text="X axis :"></TextView>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_yaxis"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:text="Y axis :"></TextView>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_zaxis"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:text="Z axis :"></TextView>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_device"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:text="Device range :"></TextView>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_set"
|
android:id="@+id/tv_set"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -11,12 +11,54 @@
|
|||||||
android:padding="20dp"
|
android:padding="20dp"
|
||||||
>
|
>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_Condevice"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:text="Connected devices"></TextView>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recycle"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
>
|
||||||
|
|
||||||
|
</androidx.recyclerview.widget.RecyclerView>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="450dp"
|
||||||
|
app:cardElevation="10dp"
|
||||||
|
app:cardCornerRadius="20dp"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
app:cardBackgroundColor="@color/white"
|
||||||
|
app:cardMaxElevation="12dp"
|
||||||
|
app:cardPreventCornerOverlap="true"
|
||||||
|
app:cardUseCompatPadding="true"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="5dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Name :"
|
android:text="Name :"
|
||||||
android:id="@+id/txt_name"
|
android:id="@+id/txt_name"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="20dp"
|
||||||
|
android:textStyle="bold"
|
||||||
>
|
>
|
||||||
</TextView>
|
</TextView>
|
||||||
|
|
||||||
@ -26,6 +68,8 @@
|
|||||||
android:text="Macc :"
|
android:text="Macc :"
|
||||||
android:id="@+id/txt_mac"
|
android:id="@+id/txt_mac"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="20dp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
|
||||||
>
|
>
|
||||||
</TextView>
|
</TextView>
|
||||||
|
|
||||||
@ -35,6 +79,7 @@
|
|||||||
android:text="Battery :"
|
android:text="Battery :"
|
||||||
android:id="@+id/txt_battery"
|
android:id="@+id/txt_battery"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="20dp"
|
||||||
|
android:textStyle="bold"
|
||||||
>
|
>
|
||||||
</TextView>
|
</TextView>
|
||||||
|
|
||||||
@ -46,6 +91,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="20dp"
|
||||||
|
android:textStyle="bold"
|
||||||
android:text="Rssi :"></TextView>
|
android:text="Rssi :"></TextView>
|
||||||
|
|
||||||
|
|
||||||
@ -55,6 +101,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="20dp"
|
||||||
|
android:textStyle="bold"
|
||||||
android:text="X axis :"></TextView>
|
android:text="X axis :"></TextView>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -62,6 +109,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="20dp"
|
||||||
|
android:textStyle="bold"
|
||||||
android:text="Y axis :"></TextView>
|
android:text="Y axis :"></TextView>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -69,22 +117,21 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="20dp"
|
||||||
|
android:textStyle="bold"
|
||||||
android:text="Z axis :"></TextView>
|
android:text="Z axis :"></TextView>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/txt_device"
|
android:id="@+id/txt_device"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="20dp"
|
||||||
|
android:textStyle="bold"
|
||||||
android:text="Device range :"></TextView>
|
android:text="Device range :"></TextView>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
</LinearLayout>
|
||||||
android:id="@+id/recycle"
|
|
||||||
android:layout_marginTop="20dp"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
>
|
|
||||||
|
|
||||||
</androidx.recyclerview.widget.RecyclerView>
|
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user