B4A Library Tooleap Library - Floating notifications and miniApps




Tooleap Tutorials
Part 1 - Introduction to Tooleap
Part 2 - Introduction to Tooleap Development
Part 3 - Installation of Tooleap library and Application Setup
Part 4 - Creating a Tooleap Activity in B4A
Part 5 - Launching a miniApp
Part 6 - Other considerations
...more later

Tooleap Libraries
- All tooleap libraries are attached to the post including the sdk jar

Requirements
B4A 3.80
Android 2.2+

Samples and Demos
- Attached to this post
- NJDude's Sample: http://www.b4x.com/android/forum/th...cations-and-miniapps.41136/page-2#post-247534
 

Attachments

  • TooleapLibraries-0.9.4.zip
    316.6 KB · Views: 1,257
  • TooleapSample_0.9.4.zip
    9 KB · Views: 866
Last edited:

thedesolatesoul

Expert
Licensed User
Longtime User
Library Docs:

TooleapHelper
Author:
thedesolatesoul
Version: 0.05
  • MSTooleapActivityHelper
    Methods:
    • getCurrentActivityTooleapAppId As Long
      Returns the Tooleap AppID for the current activity
      Return type: long
    • isStartedByTooleap As Boolean
      Returns if a TooleapActivity was started in normal mode or in MiniApp mode
      Return type: boolean
  • MSTooleapManager
    Methods:
    • addMiniApp (miniApp As MSTooleapMiniApp) As Long
      Add a new Mini-App to Tooleap.
      miniApp: is the miniApp to be added
      Return type: long (appID)
    • getAllMiniApps As List
      Get a list containing all of the active Mini-Apps added to the Tooleap Service.
      Return type: List of all active MSTooleapMiniApp
    • getMiniApp (appID As Long) As MSTooleapMiniApp
      Get the Mini-App data associated with the appID
      appID: of the miniApp to be returned
      Return type: MSTooleapMiniApp
    • getMiniAppNotificationBadge (appId As Long) As Int
      Get the current numeric value of the notification badge
      appId: of the MiniApp
      Return type: Int
    • getVisibleAppId As Long
      Get the Mini-App ID of the Mini-App currently visible to the user.
      Return type: long appID
    • removeAllMiniApps
      Remove all the Mini-Apps added to the Tooleap service
    • removeMiniApp (appId As Long)
      Remove an existing Mini-App from Tooleap.
      appId: of miniApp to be removed
    • updateMiniApp (appId As Long, miniApp As MSTooleapMiniApp) As Boolean
      Update the Mini-App.
      You can use this to update the text or notification properties
      appId: of the miniApp to be updated
      miniApp:
      Return type: boolean (whether app was successfully updated or not)
    • updateMiniAppAndNotify (appId As Long, miniApp As MSTooleapMiniApp) As Boolean
      Update the Mini-App and post a notification to be shown.
      appId: of the miniApp to be updated
      miniApp: to be updated
      Return type: boolean (whether app was successfully updated or not)
  • MSTooleapMiniApp
    Fields:
    • CONTEXTUAL_BROWSER As String
    • CONTEXTUAL_HOME_SCREEN As String
    • CONTEXTUAL_MY_APPLICATION As String
    • LISTTYPE_BLACKLIST As Int
    • LISTTYPE_WHITELIST As Int
    • TYPE_HOME_MINIAPP As Int
    • TYPE_NOTIFICATION_MINIAPP As Int
    • TYPE_PERSISTENT_MINIAPP As Int
    • TYPE_POPOUT_MINIAPP As Int
    Methods:
    • Initialize (intent As IntentWrapper, type As Int)
      Create a new TooleapMiniApp
      intent: Intent is in the form of:
      Dim i As Intent
      i.Initialize("","")
      i.SetComponent("com.maximussoft.tooleap/.test")
      type: Can be one of the miniApp types
    • Initialize2 (ActivityName As String, title As String, notification As String)
      Quick method to initialize miniApp
      ActivityName: : Name of activity (in lowercase)
      title: : Title of miniApp
      notification: : Notification text
    • IsInitialized As Boolean
    • SetContextualFilterList (contextual As String, ListType As Int)
      Set the availability of the Mini-App by providing a contextual filter list of applications
      Only pertinent to persistent miniapps
      contextual: : Can be
      CONTEXTUAL_BROWSER An application list of all browser apps on the device
      CONTEXTUAL_HOME_SCREEN The device home screen application
      CONTEXTUAL_MY_APPLICATION The developers application/your apps package name)
    • SetFilterList (pList As List, ListType As Int)
      Set the availability of the Mini-App by providing a filter list of applications
      Only pertinent to persistent miniapps
      filterList: is a list of packagenames
      ListType: can be either LISTTYPE_WHITELIST or LISTTYPE_BLACKLIST
    • allowUserToDismiss (isDismissible As Boolean)
      Set whether this persistent mini app is dismissible (determines the close button availability).
      Only for PersistentMiniApps
      isDismissible:
    • hasFilter As Boolean
      Returns whether the Mini-App has a filter list defined
      Only for PersistentMiniApps
      Return type: boolean whether the miniapp has a whitelist or blacklist filter
    Properties:
    • AppID As Long [read only]
      Gets the AppID for this miniApp
    • ContentIntent As IntentWrapper [read only]
      Returns the content intent which was set during Initialize
    • ContentText As CharSequence [write only]
      The text to be displayed at second line of text in the applications menu.
    • ContentTitle As CharSequence [write only]
      The text to be displayed as the title of the Mini-App.
    • Icon As Bitmap [write only]
      Bitmap representing the icon data.
    • NotificationBadgeNumber As Int [write only]
      The numeric value of the notification badge
    • NotificationText As CharSequence [write only]
      The text to be displayed in the text balloon when the notification first arrives.
    • When As Date [read only]
      The timestamp pertaining to the notification (usually the time the event occurred).
    • bubbleBackgroundColor As Int [write only]
      The Bubble's background color for this Mini-App in ARGB format.
 
Last edited:

vpires

Member
Licensed User
Longtime User
So onNewIntent is finally fixed in 3.8 ? If yes, i'll bug Erel for a version upgrade discount.
 

thedesolatesoul

Expert
Licensed User
Longtime User
Very nice!
Basic sample attached. Play with it :)

So onNewIntent is finally fixed in 3.8 ? If yes, i'll bug Erel for a version upgrade discount.
Yes, it is definitely fixed.
I think member referals can get some discount, I can send you a referal code if you want.
 

Douglas Farias

Expert
Licensed User
Longtime User
hi man
i got this error when i try open your sample
i think this error is because your private sign key
 

Attachments

  • Sem título.png
    Sem título.png
    483.8 KB · Views: 410

RAJAN MBA

Member
Licensed User
Longtime User
Hi,
Thanks for the lib, but why does this lib require Internet permission?
B4X:
<uses-permission android:name="android.permission.INTERNET" />

Edit: Ok.Found the explanation in your blog:
The Tooleap SDK uses the internet permission. The miniApps have a searchbar (Google) bundled with them that requires this permission and allows users to search google from any miniApp. The SDK may also collect some analytics for further optimizations.
 

thedesolatesoul

Expert
Licensed User
Longtime User
How long does it take to get their sdk after signing up ? I thought they would send a link immediately on signup and verification (I found no link on their webpage for direct sdk download)
I think it takes a day depending on how much backlog they have. There seem to be a lot of developers signing up.
 

Tooleap

Member
Licensed User
Longtime User
Hi,
I'm one of the developers of Tooleap. If anyone here has a specific question about Tooleap, you can post it here, and i'll try to help you.

Note that the wrapper was created by thedesolatesoul, so I can only help you with questions specifically about Tooleap.
Many thanks to thedesolatesoul for creating the wrapper and the tutorial! :)

Danny
 
Last edited:

RAJAN MBA

Member
Licensed User
Longtime User
Hi,
I'm one of the developers of Tooleap. If anyone here has a specific question about Tooleap, you can post it here, and i'll try to help you.

Note that the wrapper was created by thedesolatesoul, so I can only help you with questions specifically about Tooleap.
Many thanks to thedesolatesoul for creating the wrapper and the tutorial! :)

Danny
Hi,
Would it be possible to remove the search bar from mini apps ? I don't want to add Internet permission for my planned app.
 
Top