Create Your First Mini App

A mini app needs an Activity class to display your app content inside the side screen.

To prepare the mini app, lets first create a new activity –

Create a new activity in your project, as you normally would, and extend it to TooleapActivities.Activity, instead of the normal Activity class:

The TooleapActivities.Activity class extends the Android Activity class and acts just like it. You can add content to this Activity just like you would with an Activity, and you can count on the Activity lifecycle being called (onCreate, onResume, onPause etc…). In fact, you can even use your existing app Activities, as detailed in Create a Mini App guide.

Note: In this tutorial we are extending a regular Activity class, but Tooleap supports different types of Activity classes, and even popular third party activity classes such as ActionBarShelock. See the Tooleap Activities guide for more info.

 

Next we’ll add the newly created “MyTooleapActivity” class declaration to your app’s AndroidManifest.xml file:

Note: The android:theme property must be set to Theme.Translucent (or any other translucent theme like Theme.Translucent.NoTitleBar for removing the default grey title bar). To use a custom theme see Create a Mini App guide.

Now that we’ve finished preparing the Tooleap Activity class, we need to display it to the user. Displaying a mini app is much like displaying a regular notification in Android.

First we’ll prepare an intent to launch the mini app:

 

Then we’ll prepare a mini app that will launch the intent and display the activity.

In this example we’ll use a PopOut mini app (you can learn more about other types of mini app in Mini App Types guide).

We’ll give the mini app some properties, such as a title and a notification text to display when the bubble pops out.

You can learn more about customizing your mini app in Customizing Your Mini App guide.

 

Now we are all set to display the mini app with the addMiniApp method:

Note: The addMiniApp method returns a mini app id, that you can later use to manage your mini app. See the Manage Your Mini Apps guide.

 

A sample project is available on Tooleap Sample Project page.

 

Congradulations! You’ve now created your first mini app. Now you can read the API Guide to see the rest of the features, or browse the API Reference to see a list of Tooleap classes and methods.

 

Read the Complete API Guide