Tooleap and B4A Part 5: Launching a MiniApp

You can launch your miniApp from another activity or service. To manage your miniApps you will need to use the MSTooleapManager object. This object allows you to add/remove or find your miniApps.

To create and set up a particular miniApp you will need to use the MSTooleapMiniApp object.

Lets see how to create and start an activity in miniApp mode and also to set up its notification object.

We start off by creating an intent to our activity. This is in the format of “<packagename>/.<activityname>”. (There were probably easier ways to do this but I chose this to remain flexible)

 Dim i1 As Intent
i1.Initialize("","")
i1.SetComponent("com.maximussoft.tooleap/.test")

Then we set up our miniApp object:

TooleapMiniApp1.Initialize(i1,TooleapMiniApp1.TYPE_POPOUT_MINIAPP)
TooleapMiniApp1.ContentTitle = "A sample Title"
TooleapMiniApp1.ContentText = "content TExt"
TooleapMiniApp1.NotificationText = "Notification Text!"
TooleapMiniApp1.NotificationBadgeNumber = 3
TooleapMiniApp1.bubbleBackgroundColor = Colors.Transparent

Simple stuff, just setting up the Header/Titles.

Now to actually start the floating notification we need to add the miniApp using the manager.

appID = TooleapManager1.addMiniApp(TooleapMiniApp1)

That is it! That will start a notification, and when you click on the notification, it will launch your activity in miniApp mode.
You can customise the miniApp more using the object, and can manage them using the manager object. You can remove all miniApps or remove particular ones, and list them all etc.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s