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://root@127.0.0.1:22");
intent.setData(uri);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
To pass a password, use the putExtra method (on an additional line):
intent.putExtra("com.serverauditor.password", "pass");
3
1
Was this article helpful?
2 out of 3 found this helpful
How to add alias as well?