|
Creating a Simple Android Telenav Connect Client using the Adapter
The Android platform offers develoers capabilities to create components and a framework to handle messaging between these components. Intent based programming basically achieves this goal with intents being the messages and Activities being the components. This paradigm hence offers a simple service-oriented application model architecture. The following sample is the recommended apporach for integration with the navigator using Telenav Connect. The adavantages of using the adapter is that it provides validation of the parameters being sent over the Telenav Connect URI. Use the MaiTaiAdapterFactory to create an instance of the adapter. As an Android pp developer you may need to offer navigation based on some interactions from the user on the Android view and hence you could invoke the launchMaiTai() function from the vent handlers for the view.
public SimpleActivity extends Activity implements IMaiTaiAdapterCallback {
private IMaiTaiAdapter adapter;
protected void onCreate(Bundle savedInstanceState) {
...
MaiTaiContext context = new MaiTaiContext(this,this); // android activity context, callback instance
adapter = (MaiTaiAdapter)MaiTaiAdapterFactory.createInstance(context);
....
}
.....
private void launchMaiTai(String action, Map
|
|
Creating a Simple Android Maitai Client without Adapter
The following sample is an alternative way to perform an integration. With this method if a callback is needed then the
application must register as a listener for a new intent and provide the intent via the "cb" parameter.
private void launchMaiTai(String action, Map |
|
Running the Telenav Sample
This section describes the process to getting started with Telenav Connect and integrating the navigation experience within your application.
#Step 1 : Download and install the samples & adapter code.After running the TN Android samples the following menu is displayed.
#Step 2 : Click on "navTo" in this case. The activity screen will require your inputs for the destination.
|


