I've got problem for my application. I want to start connectbot from my application via intent, if my activity start i want to connectbot start too. How to intent connectbot application from my activity, please for answer my question. thanks...
The AndroidManifest of ConnectBot has the following intent-filter:
<intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="ssh" /> <data android:scheme="telnet" /> <data android:scheme="local" /> <!-- format: ssh://[email protected]:port/#nickname --> <!-- format: telnet://host:port/#nickname --> <!-- format: local:// --> </intent-filter>
This means you can throw an Intent with the following action to start ConnectBot and open the ConsoleActivity. ConsoleActivity does not do anything with the Uri, so you could use anything starting with "ssh://":
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("ssh://[email protected]:port/#nickname")));
ConnectBot also responds to ACTION_PICK which opens the list of configured connections. ACTION_PICK actually parses the given uri and opens nickname but only if user, host and port are also right.