IP-Adresse etc. in der app
This commit is contained in:
parent
208728662d
commit
ff7cc62f6a
17
MobileApp/.idea/deploymentTargetDropDown.xml
generated
Normal file
17
MobileApp/.idea/deploymentTargetDropDown.xml
generated
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="deploymentTargetDropDown">
|
||||||
|
<targetSelectedWithDropDown>
|
||||||
|
<Target>
|
||||||
|
<type value="QUICK_BOOT_TARGET" />
|
||||||
|
<deviceKey>
|
||||||
|
<Key>
|
||||||
|
<type value="VIRTUAL_DEVICE_PATH" />
|
||||||
|
<value value="C:\Users\baran\.android\avd\Nexus_5_API_R.avd" />
|
||||||
|
</Key>
|
||||||
|
</deviceKey>
|
||||||
|
</Target>
|
||||||
|
</targetSelectedWithDropDown>
|
||||||
|
<timeTargetWasSelectedWithDropDown value="2023-01-11T18:53:15.217760700Z" />
|
||||||
|
</component>
|
||||||
|
</project>
|
1
MobileApp/.idea/misc.xml
generated
1
MobileApp/.idea/misc.xml
generated
@ -13,6 +13,7 @@
|
|||||||
<entry key="..\:/Line-Following-Robot/MobileApp/app/src/main/res/layout/activity_main.xml" value="0.16666666666666666" />
|
<entry key="..\:/Line-Following-Robot/MobileApp/app/src/main/res/layout/activity_main.xml" value="0.16666666666666666" />
|
||||||
<entry key="..\:/Line-Following-Robot/MobileApp/app/src/main/res/layout/fragment_automatik.xml" value="0.3333333333333333" />
|
<entry key="..\:/Line-Following-Robot/MobileApp/app/src/main/res/layout/fragment_automatik.xml" value="0.3333333333333333" />
|
||||||
<entry key="..\:/Line-Following-Robot/MobileApp/app/src/main/res/layout/fragment_dashboard.xml" value="0.14666666666666667" />
|
<entry key="..\:/Line-Following-Robot/MobileApp/app/src/main/res/layout/fragment_dashboard.xml" value="0.14666666666666667" />
|
||||||
|
<entry key="..\:/Line-Following-Robot/MobileApp/app/src/main/res/layout/fragment_einstellungen.xml" value="0.25" />
|
||||||
<entry key="..\:/Line-Following-Robot/MobileApp/app/src/main/res/layout/fragment_home.xml" value="0.16666666666666666" />
|
<entry key="..\:/Line-Following-Robot/MobileApp/app/src/main/res/layout/fragment_home.xml" value="0.16666666666666666" />
|
||||||
<entry key="..\:/Line-Following-Robot/MobileApp/app/src/main/res/layout/fragment_manuell.xml" value="0.22" />
|
<entry key="..\:/Line-Following-Robot/MobileApp/app/src/main/res/layout/fragment_manuell.xml" value="0.22" />
|
||||||
<entry key="..\:/Line-Following-Robot/MobileApp/app/src/main/res/layout/fragment_notifications.xml" value="0.16666666666666666" />
|
<entry key="..\:/Line-Following-Robot/MobileApp/app/src/main/res/layout/fragment_notifications.xml" value="0.16666666666666666" />
|
||||||
|
@ -3,6 +3,9 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="com.example.lfrmobileapp">
|
package="com.example.lfrmobileapp">
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||||
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||||
@ -25,4 +28,6 @@
|
|||||||
</activity>
|
</activity>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
@ -1,2 +1,22 @@
|
|||||||
package com.example.lfrmobileapp;public class Communication {
|
package com.example.lfrmobileapp;
|
||||||
}
|
|
||||||
|
import android.accounts.NetworkErrorException;
|
||||||
|
|
||||||
|
import java.io.DataOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.Socket;
|
||||||
|
|
||||||
|
public class Communication {
|
||||||
|
public boolean sendData(String data) {
|
||||||
|
try {
|
||||||
|
Socket socket = new Socket("192.168.0.1", 1755);
|
||||||
|
DataOutputStream DOS = new DataOutputStream(socket.getOutputStream());
|
||||||
|
DOS.writeUTF(data);
|
||||||
|
socket.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -34,4 +34,5 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
NavigationUI.setupWithNavController(binding.navView, navController);
|
NavigationUI.setupWithNavController(binding.navView, navController);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -13,6 +13,7 @@ import androidx.annotation.NonNull;
|
|||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
|
|
||||||
|
import com.example.lfrmobileapp.Communication;
|
||||||
import com.example.lfrmobileapp.databinding.FragmentManuellBinding;
|
import com.example.lfrmobileapp.databinding.FragmentManuellBinding;
|
||||||
|
|
||||||
import io.github.controlwear.virtual.joystick.android.JoystickView;
|
import io.github.controlwear.virtual.joystick.android.JoystickView;
|
||||||
@ -33,10 +34,12 @@ public class HomeFragment extends Fragment {
|
|||||||
homeViewModel.getText().observe(getViewLifecycleOwner(), textView::setText);
|
homeViewModel.getText().observe(getViewLifecycleOwner(), textView::setText);
|
||||||
|
|
||||||
JoystickView joystick = (JoystickView) binding.joystick;
|
JoystickView joystick = (JoystickView) binding.joystick;
|
||||||
|
Communication com = new Communication();
|
||||||
joystick.setOnMoveListener(new JoystickView.OnMoveListener() {
|
joystick.setOnMoveListener(new JoystickView.OnMoveListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onMove(int angle, int strength) {
|
public void onMove(int angle, int strength) {
|
||||||
homeViewModel.setText(Integer.toString(angle), Integer.toString(strength));
|
homeViewModel.setText(Integer.toString(angle), Integer.toString(strength));
|
||||||
|
com.sendData("Vanessa stinkt, Baran nicht");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -24,8 +24,6 @@ public class NotificationsFragment extends Fragment {
|
|||||||
binding = FragmentEinstellungenBinding.inflate(inflater, container, false);
|
binding = FragmentEinstellungenBinding.inflate(inflater, container, false);
|
||||||
View root = binding.getRoot();
|
View root = binding.getRoot();
|
||||||
|
|
||||||
final TextView textView = binding.textNotifications;
|
|
||||||
notificationsViewModel.getText().observe(getViewLifecycleOwner(), textView::setText);
|
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
android:layout_marginEnd="16dp"
|
android:layout_marginEnd="16dp"
|
||||||
android:checked="false"
|
android:checked="false"
|
||||||
android:fontFamily="sans-serif-medium"
|
android:fontFamily="sans-serif-medium"
|
||||||
android:text="Roboter aktivieren "
|
android:text="Roboter losfahren "
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
@ -6,16 +6,28 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".ui.notifications.NotificationsFragment">
|
tools:context=".ui.notifications.NotificationsFragment">
|
||||||
|
|
||||||
<TextView
|
<EditText
|
||||||
android:id="@+id/text_notifications"
|
android:id="@+id/ipAdress"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="269dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="38dp"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginTop="64dp"
|
||||||
android:layout_marginTop="8dp"
|
android:hint="IP-Adresse"
|
||||||
android:layout_marginEnd="8dp"
|
android:digits="0123456789."
|
||||||
android:textAlignment="center"
|
android:textColor="#000000"
|
||||||
android:textSize="20sp"
|
android:inputType="number|numberDecimal"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/port"
|
||||||
|
android:layout_width="269dp"
|
||||||
|
android:layout_height="38dp"
|
||||||
|
android:layout_marginTop="120dp"
|
||||||
|
android:hint="Port"
|
||||||
|
android:digits="0123456789"
|
||||||
|
android:textColor="#000000"
|
||||||
|
android:inputType="number|numberDecimal"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
@ -8,16 +8,15 @@
|
|||||||
|
|
||||||
<io.github.controlwear.virtual.joystick.android.JoystickView
|
<io.github.controlwear.virtual.joystick.android.JoystickView
|
||||||
android:id="@+id/joystick"
|
android:id="@+id/joystick"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="308dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="317dp"
|
||||||
app:JV_backgroundColor="@color/THblue"
|
android:layout_marginTop="12dp"
|
||||||
app:JV_borderColor="#000000"
|
android:background="@mipmap/kreis"
|
||||||
app:JV_borderWidth="2dp"
|
|
||||||
app:JV_buttonColor="#FFFFFF"
|
app:JV_buttonColor="#FFFFFF"
|
||||||
app:JV_buttonSizeRatio="13%"
|
app:JV_buttonSizeRatio="11%"
|
||||||
app:JV_fixedCenter="false"
|
app:JV_fixedCenter="false"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0.0"
|
app:layout_constraintHorizontal_bias="0.481"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
@ -26,7 +25,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textSize="15sp"
|
android:textSize="15sp"
|
||||||
|
BIN
MobileApp/app/src/main/res/layout/fragment_manuell.xml~
Normal file
BIN
MobileApp/app/src/main/res/layout/fragment_manuell.xml~
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user