Add functionality to bypass the MasterChooserActivity#233
Add functionality to bypass the MasterChooserActivity#233stonier merged 1 commit intorosjava:indigofrom
Conversation
… provided a different way.
|
This is a nice idea that we've wanted for a while, been using workarounds instead...I'll have a look at it shortly. |
|
Sounds good. Thanks. |
Add functionality to bypass the MasterChooserActivity
|
No problems here. |
|
Thanks for merging in those changes @stonier. Here is the requested wiki write-up To Choose or Not to Choose?There is now an optional way of bypassing the MasterChooser activity in android_core by providing a master URI to the RosActivity constructor. The Master ChooserBundled into android_core is an Activity subclass named MasterChooser. This activity can be used to specify an existing ROS master node or start a new master node on the device. This activity is created and presented in the RosActivity constructor. The view for the MasterChooser contains an EditText field for entering the master node URI as well as a button to connect to the node. There are also some advanced options that can be used when creating a new master node on the device. It is important to note that the MasterChooser needs to be declared in the application's manifest to avoid a crash. This can be done by adding the following line inside the tag. Avoiding the Master ChooserThere are cases where the master node URI can either be hardcoded into the application or it would be best to present a custom view for specifying the master node. This can be accomplished by providing a custom URI in the call to the RosActivity constructor. This will allow the application to use a RosActivity without presenting the MasterChooser. As an example, to bypass the MasterChooser, the following code from the android_tutorial_pubsub MainActivity: would be changed to something similar to: |
|
Awesome, can you add this to the wiki tutorial? |
It may not always be necessary to present the MasterChooserActivity. This change allows the MasterURI to be specified via the RosActivity constructor. If none is provided, it will fallback to presenting the MasterChooser.