I recently created a utility that gets a device’s local IP address, their public IP address, the hostname of the device, and the OS of the device. The Python app will run on Android devices, provided you have a Python 3 emulator (like QPython3), iOS users, probably not. The app was designed for desktop computers, including Linux. You can download it through GitHub, on the python-tools repository. The file’s name is ipall.py.
Download the python-tools repository.