[Chargeable] RSStandOut 3.0 - Floating Apps

XverhelstX

Well-Known Member
Licensed User
StandOut 3.0


Changes
After a couple of weeks of development and testing, I finally pulled off StandOut 3.0.
The previous versions of StandOut were written in a "hacky" way where we used the application context to pass the ba instance to the StandOut service. This had some major drawbacks and bugs that were unable to be fixed. Now we are using a "legit" way (in the same way the DayDream library was written) where we declare a static instance of the service in the library which we interact with.

What is StandOut?
StandOut is an easy-to-use library that anyone can use to create their own floating apps.

Features
Now there are some great advantages and features in the new version of StandOut 3.0!

  • Provide your own view.
  • Very easy to integrate
  • Window decorators (titlebar, minimize/close buttons, border, resize handle)
  • Windows are moveable and resizable. You can bring-to-front, minimize, and close
  • Minimized windows can be restored (the example APK demos this using the notification panel)
  • Multiple windows!
  • Communication between windows!
  • Create your own animation (Hide, close, show, ...)
  • Your own theme style
  • DropDown Items
  • Tons more events
  • Flag system to enable/disable window features
  • Much easier to use
The way StandOut works is the following:

The library StandOut Service calls method in your B4A Service where you can initialize, change, adapt your window, and pass it back to the native service. The service configures your window and displays it to the user.

Integrate StandOut in your application
An example project is attached in the sample folder which demonstrates the basic functionality of StandOut.

You can also find the sample apk in this thread's attachments.

Here is some basic code which shows how it can easily be integrated in your app:

B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
 
    'Declaration of constants
    Public StandOut As RSStandOut
 
    'Declaration of variabels
    Private mWindow As RSStandOutWindow
    Private mConstants As RSStandOutConstants
    Private mFlags As RSStandOutFlags

End Sub

Sub Service_Create

End Sub

Sub Service_Start (StartingIntent As Intent)
    mWindow.Initialize("Window")
    StandOut.Show(mWindow.UniqueId)
End Sub

Sub Service_Destroy

End Sub

' ! --------------- ! - VIEW EVENTS - ! --------------- !

Sub btnSend_Click
    'checks if the window is shown or hidden
    'Sends data from Window 0 to Window 1, with RequestCode 5 and Bundle: null
    If mWindow.isExistingId(1) Then
        StandOut.SendData(1, 5, Null, 0)
    End If

End Sub



B4X:
' ! --------------- ! - EVENTS - ! --------------- !
'Do NOT call the events below from your app.
'The methods below are called from the library and returns info back to the library.

Sub Window_Initialize (Id As Int, Window As RSStandOutWindow) As RSStandOutLayoutParams
    Dim params As RSStandOutLayoutParams
    params.Initialize4(Id, 400, 300, mConstants.AUTO_POSITION, mConstants.AUTO_POSITION, 100, 100)
    Return params
End Sub

'Final clean up that needs to be done.
'Called after all windows have been closed.
Sub Window_Destroy
    StopService(Me) 
End Sub

'Create a panel and add it to the frame.
Sub Window_CreateAndAttachView (Id As Int, Frame As RSFrameLayout) As Panel
    Dim Content As Panel
    Content.Initialize("Content")
    Frame.AddView(Content, 400, 300)
    Dim btn As Button
    btn.Initialize("btnSend")
    btn.Text = "Send"
    Content.AddView(btn, 0dip, 0dip, Frame.Width, 48dip)
    Return Content
End Sub

'Returns the name of the Window.
Sub Window_AppName As String
    Return "RSStandOut Example"
End Sub

'Returns the icon of the window.
Sub Window_AppIcon As String
    Return "icon"
End Sub


'Return a list of flags
Sub Window_Flags (Id As Int) As List
    Dim flags As List
    flags.Initialize
    flags.Add(mFlags.FLAG_DECORATION_SYSTEM)
    flags.Add(mFlags.FLAG_BODY_MOVE_ENABLE)
    flags.Add(mFlags.FLAG_WINDOW_HIDE_ENABLE)
    flags.Add(mFlags.FLAG_WINDOW_BRING_TO_FRONT_ON_TAP)
    flags.Add(mFlags.FLAG_WINDOW_EDGE_LIMITS_ENABLE)
    flags.Add(mFlags.FLAG_WINDOW_PINCH_RESIZE_ENABLE)
 
    Return flags
End Sub

Sub Window_PersistentNotificationTitle(Id As Int) As String
    Return "RSStandOut Example Running"
End Sub

Sub Window_PersistentNotificationMessage(Id As Int) As String
    Return "Click to add a new RSStandOut example"
End Sub

Sub Window_PersistentNotificationIntent(Id As Int) As Intent
    Return StandOut.getShowIntent(mWindow.UniqueId)
End Sub

Sub Window_HiddenIcon As String
    Return "icon"
End Sub

Sub Window_HiddenNotificationTitle(Id As Int) As String
    Return "RSStandOut Example Hidden"
End Sub

Sub Window_HiddenNotificationMessage(Id As Int) As String
    Return "Click to restore #" & Id
End Sub

Sub Window_HiddenNotificationIntent(Id As Int) As Intent
    Return StandOut.getShowIntent(Id)
End Sub

'Data = bundle (Use JavaObject)
Sub Window_ReceiveData (Id As Int, RequestCode As Int, Data As Object, FromId As Int)
    ToastMessageShow("Data received from id: " & FromId & " with RequestCode: " & RequestCode, False)
End Sub

Sub Window_ShowAnimation (Id As Int) As String
    If (mWindow.isExistingId(Id)) Then
        'restore
        Return "slide_in_left"
    Else
        'show
        Return "fade_in"
    End If
    'Return ""
End Sub

Sub Window_HideAnimation (Id As Int) As String
    Return "slide_out_right"
End Sub

Sub Window_CloseAnimation (Id As Int) As String
    Return "fade_out"
End Sub

Sub Window_DropDownItems (Id As Int) As List
    Dim l As List
    l.Initialize
    Dim item(2) As RSStandOutDropDownItem
    item(0).Initialize("Item", "ic_menu_help", "About", "About")
    item(1).Initialize("Item", "ic_menu_preferences", "Settings", "Settings")
    l.Add(item(0))
    l.Add(item(1))
    Return l

End Sub

Sub Window_ThemeStyle As String
    Return ""
End Sub

Not to forget
  • Did you forgot to add the applicationcontext? (See the manifest editor)
  • Did you copy your res folder from the SO example project?
  • Did you make all files in the res folder read-only?
  • To do


Payment
There were some communication issues in the past where people bought StandOut but communicated through my old mail (which was still in my B4A profile) and didn't receive SO, but this has been sorted out. Please do not contact me at: xtremelyvirtualstudio@gmail.com!

Below are the payment details:
Payment can only be made with PayPal.
After transaction has been made, we will send the library files within 24h after purchase.
If you didn't receive the files within 24h, please contact us at rootsoftllc@gmail.com

The price of StandOut is 25 EUR.
Payment can be made to the following PayPal Address: rootsoftllc@gmail.com


Previous buyers
Previous buyers of StandOut 1.0 and StandOut 2.0 are eligable for a free update.
We will send the new StandOut library to you as soon as possible.
If you haven't received the StandOut within 3 days from today (4/10/14), please contact us at rootsoftllc@gmail.com

Questions
Questions and feedback can be given in this thread. I've subscribed myself to this thread so I can see the notifications and i'll try to be responsive as possible. I'm mainly focusing on my studies at the moment, but I'll do my best to reply on time.

Kind regards,
Tomas
 

Attachments

  • RSStandOut.apk
    174.6 KB · Views: 413
Last edited:

susu

Well-Known Member
Licensed User
Nice! Waiting for new update from you.
 

somed3v3loper

Well-Known Member
Licensed User
Hi Tomas,

More than 24 hours after payment but I have not received SO yet .
Can you please send it as soon as possible .
 

zsugar

Member
Licensed User
I yesterday I paid ti buy library, but I have not received it yet

:(:(:(:(:(.

20 Euro !

Gianfranco
 

DonManfred

Expert
Licensed User
The libraries will be sent within 2 hours.
Sorry for the delay, but i forgot to take my laptop with me to my dorm :rolleyes:.

Dont forget me. I´ve paid on Saturday evening and you wanted to send it on "tomorrow" like you stated in your mail.

Still waiting for Library ;-)

Edit: Just recieved the library-files. Thank you @XverhelstX !
 
Last edited:

zsugar

Member
Licensed User
Hi Tomas,
thank I just received he library:):).

Some question about it.

- 1 Version showed in IDE B4A library RSStandOut version 1.0 and not 3.0 o_O
- 2 is there a method to set Dialog in the example project not Transparent?:rolleyes: Because in the example
it is so

Gianfranco
 

XverhelstX

Well-Known Member
Licensed User
Hi Tomas,
thank I just received he library:):).

Some question about it.

- 1 Version showed in IDE B4A library RSStandOut version 1.0 and not 3.0 o_O
- 2 is there a method to set Dialog in the example project not Transparent?:rolleyes: Because in the example
it is so

Gianfranco

1. Ah thanks for noticing. i will change it in the next version.
2. In the _CreateAndAttachView event, an RSFrameLayout object is passed that you can use to add views on.
You can give this FrameLayout a color like any other view:

B4X:
'Create a panel and add it to the frame.
Sub Window_CreateAndAttachView (Id As Int, Frame As RSFrameLayout) As Panel
    Dim Content As Panel
    Content.Initialize("Content")
    Frame.AddView(Content, 400, 300)
    Frame.Color = Colors.Black 'Not transparent
    Dim btn As Button
    btn.Initialize("btnSend")
    btn.Text = "Send"
    Content.AddView(btn, 0dip, 0dip, Frame.Width, 48dip)
    Return Content
End Sub

Edit: Note if you don't want the decoration window, you can remove the following decoration flag: FLAG_DECORATION_SYSTEM

Tomas
 

Quaki

Member
Licensed User
I was waiting for this lib for a long time
I have got a question about this lib is it possible for this lib ?
- resizeable and dragable window with possibility of making it transparent
- inside the window labels (also transparent) where data recived from serial port will be displayed
- window has to be always on top but with possibility of using the aplication under this window (using the part witch is not covered by the window on top )
example some data recived from serial port displayed over the google maps
Best regards
 

MarcoRome

Expert
Licensed User
Hi one question:

i have button with simple msgbox and when i click ..the app crash. This is code:

B4X:
'Create a panel and add it to the frame.
Sub Window_CreateAndAttachView (Id As Int, Frame As RSFrameLayout) As Panel
    Dim Content As Panel
    Content.Initialize("Content")
    Frame.AddView(Content, 400, 550)
   
    'Creo Bottoni
    Dim btn, btn_salva, btn_condividi, btn_cancella As Button
    btn.Initialize("btnContinue")
    btn_salva.Initialize("btnsalva")
    btn_condividi.Initialize("btncondividi")
    btn_cancella.Initialize("btncancella")
    btn.Text = "Continue"
    btn_salva.Text = "Save"
    btn_condividi.Text = "Share"
    btn_cancella.Text = "Delete"
   
    'Creo Testo
    Dim testo As EditText
    testo.Initialize("testodettato")
    testo.SingleLine = False
   
    'Creo Immagine
    'RecordButton64x64.png
    Dim loadbmp As Bitmap
    loadbmp.Initialize(File.DirAssets,"RecordButton64x64.png")
    Dim registraico As ImageView
    registraico.Initialize("ImageView") 'All SuggarImgView share the same event sub
    's.Color = Colors.Transparent
    registraico.SetBackgroundImage(loadbmp)
 
   
    'Inserisco nella Float Window
    Content.AddView(registraico, 30dip, 0dip, Frame.Width, 70dip)
    Content.AddView(testo, 0dip, 70dip, Frame.Width, 80dip)
    Content.AddView(btn, 0dip, 150dip, Frame.Width, 40dip)
    Content.AddView(btn_salva, 0dip, 185dip, Frame.Width, 40dip) 'cambiato da 190 a 185 vediamo
    Content.AddView(btn_condividi, 0dip, 230dip, Frame.Width, 40dip)
    Content.AddView(btn_cancella, 0dip, 270dip, Frame.Width, 40dip)
    Return Content
End Sub
 
.......
 
'Icona per sharare
Sub btncondividi_Click
    Msgbox("clicco su condividi","MSG")
 
End Sub
 
'Icona per salvare
Sub btncancella_Click
    Msgbox("clicco su cancella","MSG")
 
End Sub
 
Sub Item_Click (tag As Object)
    ToastMessageShow(tag & " clicked", False)
End Sub

Where i wrong ??
Thank's
 

MarcoRome

Expert
Licensed User
Sorry Tomas i forget that this is "service" and so dont call MsgBox.
I resolve in this mode:

Code Service:
B4X:
sub btncondividi_Click
StartActivity(Main)   
CallSubDelayed(Main,"record")
end sub

Code Main:

B4X:
Sub record
    Msgbox("Test Record","MSG")
End Sub

Thank you anyway.
Great Library ;)
 
Top