With the help of an intent, an Android app developer can open Termius from within his or her app and auto-fill details for a new host entry. It is possible to auto-fill the following details: connection type – ssh or telnet, username, hostname, port and password.
To open Termius and auto-fill connecting details, you will need to:
- create an intent,
- set intent action,
- add intent data to URI,
- start intent.
The intent given below as example passes the following connecting details: ssh as connection type, 'root' as username, '127.0.0.1' as hostname, '22' as port.
Intent intent = new Intent(Intent.ACTION_VIEW);
Uri uri = Uri.parse("ssh://email@example.com:22");
To pass a password, use the putExtra method (on an additional line):