B4A Library ABFlicB4A library for Flic buttons

biometrics

Active Member
Licensed User
Longtime User
Just got a set of these. Does the Android device the buttons are "grabbed" to need an internet connection when your app starts up?

Does the "grabbed" configuration remain if your reboot your device?
 

biometrics

Active Member
Licensed User
Longtime User
Just got a set of these. Does the Android device the buttons are "grabbed" to need an internet connection when your app starts up?

Does the "grabbed" configuration remain if your reboot your device?

To answer my own question. I've disabled wifi and mobile data and restarted the phone. It takes a while after restarting before the buttons register, but it seems they don't need an internet connection and they do recall their settings.
 

biometrics

Active Member
Licensed User
Longtime User
I have 4 of those devices. In my opinion they are useless. And their cost is not comparable to other similar gadget.
Please share why you say so as we need buttons for a queueing solution and don't want to go ahead with these if there are issues.

What would you recommend?
 

tigrot

Well-Known Member
Licensed User
Longtime User
Hi biometrics, I say so because they have very limited range, you have no feedback if the smartphone is hidden and sometimes they don't send command(or command is not receiver by smartphone). I don't think they have a real use apart from experimental or ludic use. Someone says he can remote power on/off/dimmer light, but to do so you have to stick somewhere and this is not different from a cabled cheap dimmer, apart from draining batteries!
I don't know what you are going to experiment, but for my use(a SOS button) it was scarselly useful and I gave up.
There are bidirectional transceivers but they are usually bigger. Till a remote control is not able to give a feedback from the receiver you can never know what is going on!
 

biometrics

Active Member
Licensed User
Longtime User
And above all you have to install a support(not friendly at all) and they don't allow you to get rid of it till you buy at least 1.000 pieces of flic
In our case the buttons will be within a few meters of an Android media player so the range will be fine.

Please elaborate on your post above.

Currently we have to install their app and register each button. Then in our app you need to "grab" each button. Thereafter you just need to "listen". This seems to work well but I've only been trying them for a few days.
 

biometrics

Active Member
Licensed User
Longtime User
And above all you have to install a support(not friendly at all) and they don't allow you to get rid of it till you buy at least 1.000 pieces of flic
What do you mean by 1,000 units. Do they give you an SDK so that you don't have to use their app.
 

biometrics

Active Member
Licensed User
Longtime User
@alwaysbusy

I've used your library successfully and it's working very well. I do have a problem though ...

Our product consists of several separate .apks. One is used for setting up and configuring the product. In this .apk I use .GrabButton to select the buttons we want to use. I can see the button clicks events with the _Clicked event.

When I then run our main .apk the _Clicked events do not fire. It seems the buttons that were grabbed only fires an event in the .apk where it was called. I confirmed this by doing a grab in our main .apk and then the event fired but only for that one button and not the others that were grabbed in the other .apk.

So it seems that your library records the grabbed buttons against the .apk name and only fires the event if they match.

Is there a way to solve this? We want to do the grabbing in one .apk and the events in another .apk.
 

biometrics

Active Member
Licensed User
Longtime User
After reading the Android tutorial: https://partners.flic.io/partners/developers/android-tutorial

I tried adding intent listener (excuse my Android terminology). I've done this before for HDMI state change and that works well.

So I added this to the manifest:

B4X:
AddReceiverText(FlicListener,
<intent-filter>
    <action android:name="io.flic.FLICLIB_EVENT" />
</intent-filter>)

I added a service module (same as I did with HDMI status monitoriong) with this code:

B4X:
#Region  Service Attributes
   #StartAtBoot: False
#End Region

Sub Process_Globals

End Sub

Sub Service_Create

End Sub

Sub Service_Start (StartingIntent As Intent)
   If StartingIntent.Action = "io.flic.FLICLIB_EVENT" Then
       Log("Flic event")
   End If
End Sub

Sub Service_Destroy

End Sub

I'm only getting the grabbed button, not the others I grabbed in another .apk.

So that's not a solution. Thought I might be able to work around the problem.
 

biometrics

Active Member
Licensed User
Longtime User
Has been a *very* long time since I looked at that (wouldn't even know where my flics are )

I have uploaded the source code of the libraries (B4A and B4J) to my github for whoever wants to use it:

https://github.com/RealAlwaysbusy/ABFlic

My Java experience is a short 3 day course on Linda.com so this is a bit over my head. Would you mind explaining how to compile the code, then I can fiddle with it a bit. I want to see if getButtonByDeviceId might solve the problem.
 

Jmu5667

Well-Known Member
Licensed User
Longtime User
Hi All

Does the flic app have to be installed on the phone for the Lib to work ? We just contacted Flic about using their buttons with some of our apps and they responded with this:


Please find the SDK's here https://github.com/50ButtonsEach/


Regards

John.
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…