Android Question Does anyone find this B4A Process Chart useful?

Roger Daley

Well-Known Member
Licensed User
Longtime User
Hi All

This is undoubtably the wrong place to post this but I couldn't find the correct place.
Attached is the result of what started as a doodle to clarify a couple of things in my own mind. I thought others may find it useful.

So a question in three parts:
(i) Does anyone find the attachment useful?
(ii) What bits do I have wrong?
(iii) Are there additions/changes that would improve it?
+
(iv) What is the correct place/forum to post this chart?

Regards Roger

PS Public/Private/Dim #7 This may be of interest.

26 Oct 2015:
i Updated file uploaded, minor changes to Resume text. No functional change.
ii Added fourth part to three part question above

21 Oct 2015:
Updated file uploaded, makes start and entry points more evident.
 

Attachments

  • B4AFlow3.pdf
    206.8 KB · Views: 248
Last edited:

Ed Brown

Active Member
Licensed User
Longtime User
Hello @Roger Daley

My three part answer:
(i) Yes. Quite handy. I think newbies to B4A would find this handy too.
(ii) I do not feel as though I'm 'qualified' to answer this, but from what I can see it looks good.
(iii) I spent a few minutes mulling over this. The flow, at first glance, was not immediately obvious to me. What I initially saw were the flow lines going through the various blocks (Sub Process_Globals, Sub Globals, Activity_Create, etc.) and thought it was a drawing error. I then realised that it was done to highlight the entry into Activity_Create from the PROCESS START starting point. It was all clear once I realised this. There are a couple of other entry points almost hidden about 2/3 the way down. The only suggestion I have would be to make the borders for the starting points thicker to make them stand out and will help to make the entry points 2/3 the way down more visible.

Great Job! I'm going to print this on a large sheet of paper and stick it on the wall in front of me.
 
Upvote 0

Roger Daley

Well-Known Member
Licensed User
Longtime User
Hello @Roger Daley

My three part answer:
(i) Yes. Quite handy. I think newbies to B4A would find this handy too.
(ii) I do not feel as though I'm 'qualified' to answer this, but from what I can see it looks good.
(iii) I spent a few minutes mulling over this. The flow, at first glance, was not immediately obvious to me. What I initially saw were the flow lines going through the various blocks (Sub Process_Globals, Sub Globals, Activity_Create, etc.) and thought it was a drawing error. I then realised that it was done to highlight the entry into Activity_Create from the PROCESS START starting point. It was all clear once I realised this. There are a couple of other entry points almost hidden about 2/3 the way down. The only suggestion I have would be to make the borders for the starting points thicker to make them stand out and will help to make the entry points 2/3 the way down more visible.

Great Job! I'm going to print this on a large sheet of paper and stick it on the wall in front of me.

Ed Thanks for the feedback. I will try to highlight the entry points in some way.
Regards Roger
 
Upvote 0

Roger Daley

Well-Known Member
Licensed User
Longtime User
Hello @Roger Daley

My three part answer:
(i) Yes. Quite handy. I think newbies to B4A would find this handy too.
(ii) I do not feel as though I'm 'qualified' to answer this, but from what I can see it looks good.
(iii) I spent a few minutes mulling over this. The flow, at first glance, was not immediately obvious to me. What I initially saw were the flow lines going through the various blocks (Sub Process_Globals, Sub Globals, Activity_Create, etc.) and thought it was a drawing error. I then realised that it was done to highlight the entry into Activity_Create from the PROCESS START starting point. It was all clear once I realised this. There are a couple of other entry points almost hidden about 2/3 the way down. The only suggestion I have would be to make the borders for the starting points thicker to make them stand out and will help to make the entry points 2/3 the way down more visible.

Great Job! I'm going to print this on a large sheet of paper and stick it on the wall in front of me.

Ed,
Update should make Start and Entry points intuitive. [I hope]

Regards
Roger
 
Upvote 0

le_toubib

Active Member
Licensed User
Longtime User
i benefitted A LOT , thanks
to clarify more to myself :
1- activity_create is always followed by activity_resume ?
2- launching the app(module) from a notification : will first destroy the currently active module then : a-reread all the clobals and process globals , folowed by activity_create , followed by activity_resume ??
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Yes

will first destroy the currently active module
Not really. It will send the currect active activity into paused state. It will not be destroyed

a-reread all the clobals and process globals , folowed by activity_create , followed by activity_resume ??
The current activity will be paused (i think with userclosed = false)
Activity_create will be called (firsttime = false)
Activity_resume will be called.
 
Upvote 0

Derek Johnson

Active Member
Licensed User
Longtime User
So a question in three parts:
(i) Does anyone find the attachment useful?
(ii) What bits do I have wrong?
(iii) Are there additions/changes that would improve it?

Roger,

If I was starting with B4A again, I think I would find this very useful. What would probably help a number of users starting out would be to change the title of the post to something that indicates the contents better such as "B4A Process Flow Diagram" or something similar. Then they would find it more easily; at the moment you ahev to be browsing through the forums to find it.

If you edit the original post, you can still change the title of the posting.

Regards

Derek
 
Upvote 0

Roger Daley

Well-Known Member
Licensed User
Longtime User
i benefitted A LOT , thanks
to clarify more to myself :
1- activity_create is always followed by activity_resume ?
2- launching the app(module) from a notification : will first destroy the currently active module then : a-reread all the clobals and process globals , folowed by activity_create , followed by activity_resume ??

le_toubib,
Thanks for the feedback.

Q1. Yes as DonManfred has said
Q2. I am not sure of your question here. There are circumstances where the Activity is killed [closed] on exiting the App, but not when you launch the App.
Ref: Beginners Guide section 9.6

If the App is exited by reconfiguration or the Back Button the activity is destroyed so to relaunch requires Activity_create/Resume
If the App has been pushed into the back ground by the Home Button or by another App, a relaunch by passses Activity_create and goes directly to Resume.


If I have misread your question please let me know my aim is to make the process clearer I appreciate any help I can get.

I see that I need to add some detail to the yellow "Application Resume" box to show starting another App. Next update.

Regards Roger
 
Upvote 0

Roger Daley

Well-Known Member
Licensed User
Longtime User
Roger,

If I was starting with B4A again, I think I would find this very useful. What would probably help a number of users starting out would be to change the title of the post to something that indicates the contents better such as "B4A Process Flow Diagram" or something similar. Then they would find it more easily; at the moment you ahev to be browsing through the forums to find it.

If you edit the original post, you can still change the title of the posting.

Regards

Derek

Derek,

Thanks for the feedback. Title has been updated, hopefully for the better.
There was an implied fourth question in my original post when I said that this was the wrong place to post.
I didn't want to ask "Where should I stick this chart? in case it was poorly received.


Regards
Roger
 
Last edited:
Upvote 0

le_toubib

Active Member
Licensed User
Longtime User
If I have misread your question please let me know my aim is to make the process clearer I appreciate any help I can get.
my question was mainly directed to the following specific scenario..:
An app is formed of a "Main" activity module in addition to a service that occasionally send notifications.. in this service the notification.setactivity is set to "Main" , so that when the user click on the notification , the main module will be launched (starter-globals-create-resume).

this will work as intended if the main module is not currently running , so it will be launched upon clicking on the notification.

but the problem that i have learned will occur if the main module is already currently running in the foreground , in that case it will be closed(?destroyed since all the globals were missing in my case) and then it will be RElaunched from the beginning (starter-global-create-resume) ... which in my app my take up to 4-5 seconds .
(or at least that's my understanding of what s happening :) )
 
Upvote 0

Roger Daley

Well-Known Member
Licensed User
Longtime User
my question was mainly directed to the following specific scenario..:
An app is formed of a "Main" activity module in addition to a service that occasionally send notifications.. in this service the notification.setactivity is set to "Main" , so that when the user click on the notification , the main module will be launched (starter-globals-create-resume).

this will work as intended if the main module is not currently running , so it will be launched upon clicking on the notification.

but the problem that i have learned will occur if the main module is already currently running in the foreground , in that case it will be closed(?destroyed since all the globals were missing in my case) and then it will be RElaunched from the beginning (starter-global-create-resume) ... which in my app my take up to 4-5 seconds .
(or at least that's my understanding of what s happening :) )


le_toubib,

I now see the question, unfortunately I don't have an answer.
DonManfreds answer is probably correct, he is definitely more knowledgeable than me in B4A.
It may be worth starting a new post, it is a bit hidden in this thread. I find it useful to get 2 or 3 answers, the same answer presented in multiple ways makes it easier to understand.

Regards Roger
 
Upvote 0

Derek Johnson

Active Member
Licensed User
Longtime User
my question was mainly directed to the following specific scenario..:
An app is formed of a "Main" activity module in addition to a service that occasionally send notifications.. in this service the notification.setactivity is set to "Main" , so that when the user click on the notification , the main module will be launched (starter-globals-create-resume).

this will work as intended if the main module is not currently running , so it will be launched upon clickinog on the notification.

but the problem that i have learned will occur if the main module is already currently running in the foreground , in that case it will be closed(?destroyed since all the globals were missing in my case) and then it will be RElaunched from the beginning (starter-global-create-resume) ... which in my app my take up to 4-5 seconds .
(or at least that's my understanding of what s happening :) )

I think that there are some more complicated things that can happen when there is more than one activity/process in the application, and also that some of the difficulties were meant to be addressed by the introduction of the Starter Service that came with more recent versions of B4A. There were issues that arose when one activity of an app took up a large amount of resources, and could then potentially get removed from memory while other activities were still running. I would have to refer to Erel's post about the Starter Service to be sure though.

This does not affect the usefulness of the original diagram however
 
Upvote 0
Top