Android Question Library creation using b4a only

Markos

Active Member
Licensed User
Longtime User
Hi All

My class has say 3 or more methods issued from one object that is to trigger my class events leveraging events from an object from a referenced library. Given these facts do I need to declare a separate callback variable for each method/sub in my class object to correctly trigger and return from each of the 3 class events
 

Markos

Active Member
Licensed User
Longtime User
Your question is not really related to library creation. There is no difference between using the class directly or the class compiled as a library.

You need a single callback variable. Use different event suffixes to distinguish between the events.

Hi Erel

Thanks for the reply. I guess I started with library creation and it evolved into library to class riles and logic.

Thanx again
 
Upvote 0

Markos

Active Member
Licensed User
Longtime User
Hi All

The #Excludefromlibrary does that exclude from the visible methods accessing these subs or is it to metely hide it from user access.

I have subs thst are called by the main subs. What do I do in this instance? Do I exclude or hide them and do I call them with callsub only from yhe visible user subs/methods?
 
Upvote 0

MarcoRome

Expert
Licensed User
Longtime User
Example this is Public
B4X:
Public Sub Initialize ( package_name As String, store As String, token As String, Module As Object, EventName As String )
    valore.Initialize
    Dim job1 As HttpJob
    job1.Initialize("MyJob", Me)
    Log("http://api.mevvy.com/v1/apps/"& store &"/"& package_name & "?token=" & token)
    job1.Download("http://api.mevvy.com/v1/apps/"& store &"/"& package_name & "?token=" & token)
    job1.GetRequest.SetHeader("Accept", "application/json")
    MN = Module
    EN = EventName
End Sub

and of course for the user is visible....

this is Private

B4X:
Private Sub JobDone(job As HttpJob)

    If job.Success Then
        Dim res As String
        res = job.GetString
        Log("Response from server: " & res)
        Select job.JobName
          Case "MyJob"
           Dim incrementa As Int = 0
           Dim incrementa_ico As Int = 0
.....

and of course for the user is INvisible....
 
Upvote 0

Markos

Active Member
Licensed User
Longtime User
Oh man am I embarrassed. I forgot about that. Got so lost in the exclude statement I fogot the basic rules!

Thanx dude!
 
Upvote 0

MarcoRome

Expert
Licensed User
Longtime User
Oh man am I embarrassed. I forgot about that. Got so lost in the exclude statement I fogot the basic rules!

Thanx dude!
Exist also LIKE:
upload_2017-3-14_20-34-34.png


;)
Have nice day
 
Upvote 0
Top