This repository documents my last project in Adanced Programming 2 course at Bar-Ilan university. In this project I've implemented an Android app that allows the user to remotely control an aircraft in FlightGear simulator.
- Android device with Android 11.0 x86 OS (The program is likely to work on lower versions as well).
- FlightGear simulator – Download here: https://www.flightgear.org/download/
The program is devided according to MVVM architecture:
- Model: Holds data (client) and logic, sends commands to the flight simulator.
- ViewModel: Acts as the link between the Model and View.
- View: Responsible for the visualization and creating displays for the user
(Click to enlarge)
- Install FlightGear on your machine.
- Open FlightGear, go to "settings", scroll down to "Additional Settings", then write: "--telnet=socket,in,10,127.0.0.1,6400,tcp". If port 6400 is occupied, you can enter any available port x.
- Download FlightSimulatorAndroidApp project.
- Open Android Studio and start an AVD - recommend to start Pixel XL API 30.
- Start FlightGear simulator.
- Build and run the project from Android Studio.
- Enter your machine's IP adrress and port 6400 (or port x you chose before).
- Touch (click) connect.
- You can now control the simulator.
- Install FlightGear on your machine.
- Open FlightGear, go to "settings", scroll down to "Additional Settings", then write: "--telnet=socket,in,10,127.0.0.1,6400,tcp". If port 6400 is occupied, you can enter any available port x.
- From this repository, download the apk flightcontrol-installation.apk from installable-apk directory to your device.
- Install the apk on your device. Note that you will probably need to approve the installation of apps from unauthorized sources as this is an educational program that is unapproved by Play Store.
- Start FlightGear simulator.
- Start Flight Simulator Control App on your device.
- Enter your machine's IP adrress and port 6400 (or port x you chose before).
- Touch connect.
- You can now control the simulator.
Introduction video: https://youtu.be/GOK3DV1zgKs
Slides: FlightControl App Presentation.pptx
Download the apk an locate it (the apk in the screenshot is the flightcontrol-installation.apk before renaming).
Choose "Install" to start installation process.
This app is not recognized in Play Store so touch "INSTALL ANYWAY"
Installing...
Click "Open" to start the app.
It is possible that your device's Anti-Virus will ask to scan the app because it isn't recognized in Play Store. You can choose "DON'T SEND", trust me :)
Now you can start the app:
Enter valid IP address and port number, and press connect.
You can now control the simulated aircraft - Have a nice flight!
- Android Studio
- Notepad++
- FlightGear Simulator
- draw.io ( https://app.diagrams.net/ ) - for the UML
- Samsung Galaxy S20 device.
The program was tested on:
- Pixel XL API 30 emulator (on Android Studio IDE)
- Samsung galaxy S20 device (running android 11)
The throttle slider position in the screenshots looks unpositioned, but it was fixed.
It isn't shown in the video, but if the server disconnects during runtime, the user receives a pop-up error that he\she must answer "OK" and then he\she is returned to the main screen.