修复cma,cmdid设置相关的bug

serial
Matthew 2 years ago
parent ff17f26cbd
commit de50d81f7c

@ -76,11 +76,7 @@
</receiver>
<receiver android:name=".NetworkChangedReceiver" >
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
<action android:name="android.net.wifi.WIFI_STATE_CHANGED" />
<action android:name="android.net.wifi.STATE_CHANGE" />
</intent-filter>
</receiver>
@ -104,7 +100,8 @@
<activity
android:name=".MainActivity"
android:exported="true">
android:exported="true"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

@ -183,7 +183,7 @@ CPhoneDevice::CPhoneDevice(JavaVM* vm, jobject service)
mReleaseWakelockMid = env->GetMethodID(classService, "releaseWakelock", "(Ljava/lang/String;)V");
mGetPowerInfoMid = env->GetMethodID(classService, "getPowerInfo", "()Ljava/lang/String;");
mRebootMid = env->GetMethodID(classService, "reboot", "()V");
mRebootMid = env->GetMethodID(classService, "reboot", "(I)V");
mEnableGpsMid = env->GetMethodID(classService, "enableGps", "(Z)V");
mRequestPositionMid = env->GetMethodID(classService, "requestPosition", "()Z");
@ -328,7 +328,7 @@ bool CPhoneDevice::GetNextScheduleItem(uint32_t tsBasedZero, uint32_t scheduleTi
return false;
}
bool CPhoneDevice::Reboot()
bool CPhoneDevice::Reboot(int resetType)
{
JNIEnv* env = NULL;
bool didAttachThread = false;
@ -337,7 +337,7 @@ bool CPhoneDevice::Reboot()
{
ALOGE("Failed to get JNI Env");
}
env->CallVoidMethod(m_javaService, mRebootMid);
env->CallVoidMethod(m_javaService, mRebootMid, resetType);
if (didAttachThread)
{
m_vm->DetachCurrentThread();

@ -46,7 +46,7 @@ public:
virtual bool UpdateTime(time_t ts);
virtual bool UpdateSchedules();
virtual bool QuerySystemProperties(map<string, string>& properties);
virtual bool Reboot();
virtual bool Reboot(int resetType);
virtual bool EnableGPS(bool enabled);
virtual bool RequestPosition();
virtual timer_uid_t RegisterHeartbeat(unsigned int timerType, unsigned int timeout);

@ -96,13 +96,14 @@ public class MainActivity extends AppCompatActivity {
Log.d(TAG, "Screen Size: " + width + " x " + height);
Intent intent = getIntent();
final int noDelay = intent.getIntExtra("noDelay", 0);
int rebootFlag = intent.getIntExtra("reboot", 0);
if (rebootFlag == 1) {
// SysApi.enableAirPlane(MainActivity.this, true);
}
String cmdid = "0123456789ABCDEFG";
String server = "47.96.238.157";
String cmdid = "";
String server = "";
Integer port = new Integer(6891);
Integer protocol = new Integer(DEFAULT_PROTOCOL); // 0xFF00
@ -148,6 +149,9 @@ public class MainActivity extends AppCompatActivity {
AppConfig curAppConfig = retrieveAndSaveAppConfig();
if (TextUtils.isEmpty(appConfig.cmdid) || TextUtils.isEmpty(appConfig.server) || appConfig.port == 0) {
return;
}
Intent intent = new Intent(MainActivity.this, MicroPhotoService.class);
intent.setAction(MicroPhotoService.ACTION_START);
intent.putExtra("cmdid", curAppConfig.cmdid);
@ -294,7 +298,7 @@ public class MainActivity extends AppCompatActivity {
}
}
};
handler.postDelayed(runnable, 5000);
handler.postDelayed(runnable, noDelay != 0 ? 100 : 5000);
}
binding.tcpudp.setOnClickListener(new View.OnClickListener() {
@ -374,7 +378,8 @@ public class MainActivity extends AppCompatActivity {
appConfig.cmdid = MainActivity.this.binding.cmdid.getText().toString();
appConfig.server = MainActivity.this.binding.server.getText().toString();
appConfig.port = Integer.parseInt(MainActivity.this.binding.port.getText().toString());
String portStr = MainActivity.this.binding.port.getText().toString();
appConfig.port = TextUtils.isEmpty(portStr) ? 0 : Integer.parseInt(portStr);
String protocolStr = MainActivity.this.binding.protocol.getSelectedItem().toString();
appConfig.protocol = DEFAULT_PROTOCOL;
String[] parts = protocolStr.split("-");
@ -437,6 +442,7 @@ public class MainActivity extends AppCompatActivity {
private void saveAppConfig(String cmdid, String server, int port, int protocol, int networkProtocol) {
String appPath = MicroPhotoService.buildAppDir(this.getApplicationContext());
InputStreamReader inputStreamReader = null;
OutputStreamWriter outputStreamWriter = null;
try {
@ -445,7 +451,17 @@ public class MainActivity extends AppCompatActivity {
dataPath.mkdirs();
}
JSONObject jsonObject = new JSONObject();
inputStreamReader = new InputStreamReader(new FileInputStream(new File(appPath + "data/App.json")), "UTF-8");
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
String line;
StringBuilder stringBuilder = new StringBuilder();
while ((line = bufferedReader.readLine()) != null) {
stringBuilder.append(line);
}
bufferedReader.close();
JSONObject jsonObject = new JSONObject(stringBuilder.toString());
jsonObject.put("CMDID", cmdid);
jsonObject.put("Server", server);
jsonObject.put("Port", port);
@ -461,6 +477,12 @@ public class MainActivity extends AppCompatActivity {
} catch (JSONException e) {
e.printStackTrace();
} finally {
if (inputStreamReader != null) {
try {
inputStreamReader.close();
} catch (Exception ex) {
}
}
if (outputStreamWriter != null) {
try {
outputStreamWriter.close();

@ -1,5 +1,6 @@
package com.xypower.mpapp;
import android.app.ActivityManager;
import android.app.AlarmManager;
import android.app.Notification;
import android.app.NotificationChannel;
@ -19,6 +20,8 @@ import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.Messenger;
import android.os.PowerManager;
import android.os.SystemClock;
@ -79,6 +82,8 @@ public class MicroPhotoService extends Service {
}
private static int mStateService = STATE_SERVICE.NOT_CONNECTED;
public final static int MSG_WHAT_NETWORK_CHANGE = 10;
private String mCmdid = "";
private NotificationManager mNotificationManager;
private final Map<String, PowerManager.WakeLock> mWakeLocks = new HashMap<>();
@ -88,11 +93,14 @@ public class MicroPhotoService extends Service {
private PositionManager mPositionManager = null;
private final Map<Long, PendingIntent> mTimers = new HashMap<>();
protected long mHandler = 0;
protected long mNativeHandle = 0;
private AlarmReceiver mAlarmReceiver = null;
private ScreenActionReceiver mScreenaAtionReceiver = null;
private NetworkChangedReceiver mNetworkChangedReceiver = null;
private ServiceHandler mHander = null;
private Messenger mMessenger = null;
public MicroPhotoService() {
}
@Override
@ -104,12 +112,14 @@ public class MicroPhotoService extends Service {
public void onCreate() {
super.onCreate();
mHander = new ServiceHandler();
mMessenger = new Messenger(mHander);
mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
mStateService = STATE_SERVICE.NOT_CONNECTED;
DeviceUtil.getPhoneState(this.getApplicationContext());
mScreenaAtionReceiver = new ScreenActionReceiver();
// 注册广播接受者
@ -122,7 +132,7 @@ public class MicroPhotoService extends Service {
registerReceiver(mAlarmReceiver, intentFilter);
}
{
mNetworkChangedReceiver = new NetworkChangedReceiver();
mNetworkChangedReceiver = new NetworkChangedReceiver(this);
IntentFilter filter = new IntentFilter();
filter.addAction(WifiManager.WIFI_STATE_CHANGED_ACTION);
filter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
@ -157,8 +167,8 @@ public class MicroPhotoService extends Service {
mStateService = STATE_SERVICE.NOT_CONNECTED;
uninit(mHandler);
mHandler = 0;
uninit(mNativeHandle);
mNativeHandle = 0;
unregisterReceiver(mAlarmReceiver);
unregisterReceiver(mScreenaAtionReceiver);
@ -172,6 +182,21 @@ public class MicroPhotoService extends Service {
super.onDestroy();
}
public static class ServiceHandler extends Handler {
@Override
public void dispatchMessage(Message msg) {
super.dispatchMessage(msg);
// Log.i("life", "MyHandler----dispatchMessage");
// Log.i("life", Thread.currentThread().getName());
}
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
// Log.i("life", "MyHandler----handleMessage");
}
}
public String getCmdid() {
return mCmdid;
}
@ -188,7 +213,7 @@ public class MicroPhotoService extends Service {
String action = intent.getAction();
if (TextUtils.equals(ACTION_HEARTBEAT, action)) {
Log.i(TAG, "HB Timer Fired ACTION=" + action);
mService.sendHeartbeat(mService.mHandler);
mService.sendHeartbeat(mService.mNativeHandle);
mService.registerHeartbeatTimer();
String cmdid = mService.getCmdid();
@ -209,7 +234,7 @@ public class MicroPhotoService extends Service {
int preset = (int) ((val & 0xFF00L) >> 8);
Log.i(TAG, "PhotoTimer Fired: CH=" + channel + " PR=" + preset);
mService.notifyToTakePhoto(mService.mHandler, channel, preset, ts, mService.buildPhotoDir(mService.getApplicationContext(), channel), mService.buildPhotoFileName(channel, preset, ts), true);
mService.notifyToTakePhoto(mService.mNativeHandle, channel, preset, ts, mService.buildPhotoDir(mService.getApplicationContext(), channel), mService.buildPhotoFileName(channel, preset, ts), true);
}
}
@ -231,7 +256,7 @@ public class MicroPhotoService extends Service {
long ts = System.currentTimeMillis() / 1000;
Log.i(TAG, "Take Photo CH=" + channel + " PR=" + preset + " Mannually");
mService.notifyToTakePhoto(mService.mHandler, channel, preset, ts, mService.buildPhotoDir(mService.getApplicationContext(), channel), mService.buildPhotoFileName(channel, preset, ts), photoOrVideo);
mService.notifyToTakePhoto(mService.mNativeHandle, channel, preset, ts, mService.buildPhotoDir(mService.getApplicationContext(), channel), mService.buildPhotoFileName(channel, preset, ts), photoOrVideo);
} else if (TextUtils.equals(ACTION_TIMEOUT, action)) {
long uid = intent.getLongExtra(EXTRA_PARAM_TIMER_UID, 0);
long expectedTimes = intent.getLongExtra(EXTRA_PARAM_TIMES, 0);
@ -239,7 +264,7 @@ public class MicroPhotoService extends Service {
elapsedTimes++;
Log.i(TAG, "Timeout uid=" + uid + " expectedTimes=" + expectedTimes + " Times=" + elapsedTimes);
mService.fireTimeout(mService.mHandler, uid, elapsedTimes);
mService.fireTimeout(mService.mNativeHandle, uid, elapsedTimes);
intent.putExtra(EXTRA_PARAM_ELASPED_TIMES, elapsedTimes);
@ -379,7 +404,7 @@ public class MicroPhotoService extends Service {
}
private boolean registerCaptureSchedule(long startTime, long baseTime) {
long[] photoTimeData = getPhotoTimeData(mHandler);
long[] photoTimeData = getPhotoTimeData(mNativeHandle);
if (photoTimeData == null) {
return false;
}
@ -483,13 +508,13 @@ public class MicroPhotoService extends Service {
int protocol = intent.getIntExtra("protocol", 0);
int networkProtocol = intent.getIntExtra("networkProtocol", 0);
Log.i(TAG, "AppPath=" + appPath + " Server=" + ip + ":" + port + " cmdid=" + cmdid + " protocol" + protocol + " Network=" + networkProtocol);
mHandler = init(appPath, ip, port, cmdid, protocol, networkProtocol);
Log.i(TAG, "AppPath=" + appPath + " Server=" + ip + ":" + port + " cmdid=" + cmdid + " protocol=" + protocol + " Network=" + networkProtocol);
// Start the locker receiver
MicroPhotoService service = MicroPhotoService.this;
service.mNativeHandle = init(appPath, ip, port, cmdid, protocol, networkProtocol);
if (mHandler !=0) {
mCmdid = cmdid;
if (service.mNativeHandle !=0) {
service.mCmdid = cmdid;
Date date = new Date();
long nowTs = date.getTime() / 1000;
date.setHours(0);
@ -498,7 +523,7 @@ public class MicroPhotoService extends Service {
long startTime = date.getTime() / 1000;
long baseTime = nowTs - startTime;
registerCaptureSchedule(startTime, baseTime);
service.registerCaptureSchedule(startTime, baseTime);
// AppMaster appMaster = new AppMaster(this, cmdid);
// appMaster.start();
@ -552,7 +577,7 @@ public class MicroPhotoService extends Service {
private void connect() {
// after 10 seconds its connected
new android.os.Handler().postDelayed(
mHander.postDelayed(
new Runnable() {
public void run() {
Log.d(TAG, "Bluetooth Low Energy device is connected!!");
@ -699,7 +724,7 @@ public class MicroPhotoService extends Service {
Location location = mLocationManager.getLastKnownLocation(mLocateType);
if (location != null) {
updatePosition(mHandler, location.getLongitude(), location.getLatitude(), location.getTime());
updatePosition(mNativeHandle, location.getLongitude(), location.getLatitude(), location.getTime());
}
// Set Listener
mLocationManager.requestLocationUpdates(mLocateType, 100,0, locationListener);
@ -750,16 +775,35 @@ public class MicroPhotoService extends Service {
return sb.toString();
}
public void reboot() {
public void reboot(final int rebootType) {
Handler handler = new Handler();
Runnable runnable = new Runnable() {
@Override
public void run() {
SysApi.reboot(getApplicationContext());
if (rebootType == 0) {
/*
Context context = MicroPhotoService.this.getApplicationContext();
Intent intent = getPackageManager().getLaunchIntentForPackage(context.getPackageName());
int noDelay = 1;
intent.putExtra("noDelay", noDelay);
PendingIntent restartIntent = PendingIntent.getActivity(context, 0, intent, 0);
AlarmManager mgr = (AlarmManager)getSystemService(Context.ALARM_SERVICE);
mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 1000, restartIntent); // 1秒钟后重启应用
System.exit(0);
*/
Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(getApplication().getPackageName());
LaunchIntent.putExtra("noDelay", 1);
LaunchIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(LaunchIntent);
} else {
SysApi.reboot(getApplicationContext());
}
}
};
handler.postDelayed(runnable, 1000);
mHander.postDelayed(runnable, 1000);
}
public void enableGps(boolean enabled) {
SysApi.enableGps(getApplicationContext(), enabled);
@ -797,7 +841,7 @@ cellSignalStrengthGsm.getDbm();
@Override
public void onLocationChanged(Location location) {
updatePosition(mHandler, location.getLongitude(), location.getLatitude(), location.getTime());
updatePosition(mNativeHandle, location.getLongitude(), location.getLatitude(), location.getTime());
// Log.i(TAG, "Time: " + location.getTime());
// Log.i(TAG, "经度:" + location.getLongitude());
// Log.i(TAG, "纬度:" + location.getLatitude());

@ -6,10 +6,20 @@ import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.WifiManager;
import android.os.Message;
import android.os.Parcelable;
import android.util.Log;
import java.lang.ref.WeakReference;
public class NetworkChangedReceiver extends BroadcastReceiver {
private WeakReference<MicroPhotoService> mService;
public NetworkChangedReceiver(MicroPhotoService service) {
mService = new WeakReference<>(service);
}
private String getConnectionType(int type) {
String connType = "";
if (type == ConnectivityManager.TYPE_MOBILE) {
@ -56,14 +66,18 @@ public class NetworkChangedReceiver extends BroadcastReceiver {
NetworkInfo info = intent
.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO);
if (info != null) {
//如果当前的网络连接成功并且网络连接可用
if (NetworkInfo.State.CONNECTED == info.getState() && info.isAvailable()) {
if (info.getType() == ConnectivityManager.TYPE_WIFI
|| info.getType() == ConnectivityManager.TYPE_MOBILE) {
Log.i("TAG", getConnectionType(info.getType()) + "连上");
// If connected and available
MicroPhotoService service = mService.get();
if (service != null) {
if (NetworkInfo.State.CONNECTED == info.getState() && info.isAvailable()) {
if (info.getType() == ConnectivityManager.TYPE_WIFI
|| info.getType() == ConnectivityManager.TYPE_MOBILE) {
// Log.i("TAG", getConnectionType(info.getType()) + "连上");
}
} else {
Log.i("TAG", getConnectionType(info.getType()) + "断开");
}
} else {
Log.i("TAG", getConnectionType(info.getType()) + "断开");
}
}
}

@ -0,0 +1,264 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="false"
android:orientation="horizontal"
tools:context=".MainActivity">
<TextView
android:id="@+id/textViewCmdId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:text="CMDID"
app:layout_constraintBottom_toBottomOf="@+id/cmdid"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/cmdid" />
<EditText
android:id="@+id/cmdid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginTop="8dp"
android:ems="10"
android:text="XY-ANDROIDSIM-001"
app:layout_constraintLeft_toRightOf="@+id/textViewCmdId"
app:layout_constraintTop_toTopOf="parent" />
<Spinner
android:id="@+id/protocol"
style="@style/Widget.AppCompat.Spinner.Underlined"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:entries="@array/protocols"
android:spinnerMode="dropdown"
app:layout_constraintLeft_toRightOf="@+id/cmdid"
app:layout_constraintTop_toTopOf="@+id/cmdid" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="Server"
app:layout_constraintBottom_toBottomOf="@+id/server"
app:layout_constraintStart_toStartOf="@id/textViewCmdId"
app:layout_constraintTop_toTopOf="@+id/server" />
<EditText
android:id="@+id/server"
android:layout_width="128dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:ems="10"
android:inputType=""
android:text="47.96.238.157"
app:layout_constraintStart_toStartOf="@+id/cmdid"
app:layout_constraintTop_toBottomOf="@+id/cmdid" />
<EditText
android:id="@+id/port"
android:layout_width="48dp"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="number"
android:text="6891"
app:layout_constraintBottom_toBottomOf="@+id/server"
app:layout_constraintLeft_toRightOf="@+id/server"
app:layout_constraintTop_toTopOf="@+id/server" />
<Spinner
android:id="@+id/networkProtocol"
style="@style/Widget.AppCompat.Spinner.Underlined"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:entries="@array/networkProtocols"
android:spinnerMode="dropdown"
app:layout_constraintLeft_toRightOf="@+id/port"
app:layout_constraintTop_toTopOf="@+id/port" />
<Button
android:id="@+id/startServBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:text="Start"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/port"
/>
<Button
android:id="@+id/stopServBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:enabled="false"
android:text="Stop"
app:layout_constraintStart_toEndOf="@+id/startServBtn"
app:layout_constraintTop_toBottomOf="@+id/port" />
<Button
android:id="@+id/saveCfg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="0dp"
android:text="Save"
app:layout_constraintStart_toEndOf="@+id/stopServBtn"
app:layout_constraintTop_toTopOf="@+id/startServBtn" />
<Button
android:id="@+id/simchange"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="sim卡获取"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/startServBtn" />
<Button
android:id="@+id/simchange2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginTop="8dp"
android:text="切换sim2"
app:layout_constraintStart_toEndOf="@+id/simchange"
app:layout_constraintTop_toBottomOf="@+id/startServBtn" />
<Button
android:id="@+id/takePhotoBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginStart="8dp"
android:text="TK Photo"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/simchange" />
<Button
android:id="@+id/takePhotoBtn2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginTop="8dp"
android:text="TP 2"
app:layout_constraintStart_toEndOf="@+id/takePhotoBtn"
app:layout_constraintTop_toBottomOf="@+id/simchange" />
<Button
android:id="@+id/takePhotoBtn3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginTop="8dp"
android:text="TP 3"
app:layout_constraintStart_toEndOf="@+id/takePhotoBtn2"
app:layout_constraintTop_toBottomOf="@+id/simchange" />
<Button
android:id="@+id/takePhotoBtn4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginTop="8dp"
android:text="TP 4"
app:layout_constraintStart_toEndOf="@+id/takePhotoBtn3"
app:layout_constraintTop_toBottomOf="@+id/simchange" />
<Button
android:id="@+id/gps"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="gps" />
<Button
android:id="@+id/netgps"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="network_gps" />
<Button
android:id="@+id/tcpudp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="网络通信" />
<Button
android:id="@+id/tcpudpsend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="心跳发送" />
<Button
android:id="@+id/video"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="录制视频" />
<Button
android:id="@+id/video2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="录制视频结束" />
<androidx.constraintlayout.helper.widget.Flow
android:layout_width="363dp"
android:layout_height="85dp"
android:layout_marginStart="16dp"
android:layout_marginTop="48dp"
app:constraint_referenced_ids="gps,netgps,tcpudp,tcpudpsend,video,video2"
app:flow_horizontalGap="20dp"
app:flow_wrapMode="chain"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/takePhotoBtn4" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.5"
>
<TextView
android:id="@+id/logs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:background="#2196F3"
android:padding="10dp"
android:scrollbars="vertical"
android:text="Test\n\n\nTest"
android:textColor="@color/black"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</ScrollView>
<SurfaceView
android:id="@+id/surfaceView"
android:layout_width="411dp"
android:layout_height="441dp"
android:layout_marginStart="2dp"
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
tools:layout_editor_absoluteY="288dp" />
</androidx.constraintlayout.widget.ConstraintLayout>

@ -239,6 +239,34 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.5"
>
<TextView
android:id="@+id/logs"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="20dp"
android:text="Test\n\n\nTest"
android:padding="10dp"
android:scrollbars="vertical"
android:textColor="@color/black"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.5"
/>
</ScrollView>
<SurfaceView
android:id="@+id/surfaceView"
android:layout_width="411dp"

@ -5,6 +5,7 @@
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryDark">@color/purple_700</item>
<item name="colorAccent">@color/teal_200</item>
<!-- Customize your theme here. -->
<item name="android:textSize">14sp</item>
</style>
</resources>
Loading…
Cancel
Save