[CONCLUDED] Why don't we get the behaviour we expected ?

lemonisdead

Well-Known Member
Licensed User
Longtime User
Hello,

Please, don't get me bad. I don't want to blame the product. And you would probably think that an old girl has no right to ask about. Or that the result I get is because of programming errors (that's correct I frequently do some and you often provide help guys).

My question is : why can't we be sure at 100% that the behaviour we get is what was described in the documentation ?

Referring to this thread : https://www.b4x.com/android/forum/threads/startactivity-main-from-service.48328/ CallSubDelayed doesn't start an activity as it should

Referring to another thread : https://www.b4x.com/android/forum/threads/i-can-not-display-notifications.48279/ I was not able to display notification I had initialized in an Activity

Referring to other threads of me, I was not able to use SetShowWhenLocked when the user had manually locked the screen and so on...

What I try to do is to understand if the result is because :
- or programming mistakes or misunderstandings of the documentation
- or product's limitations (b4a part) : in that case, is a Java developer more powerful ?
- or Android's evolution

I have not posted the question in the general section because I don't want to give a bad feeling of the product. I only want to share with you guys. And if The Master Jedi (@Erel) has some time to exchange with us, this would be appreciated too.

In my feeling, I now have less risks of providing a Windows app than an Android one. Do you have the same feeling ?

Perhaps I'm too old, perhaps I'm not fun or it is time for me to choose another product. But I would like to understand what happens.
 
Last edited:

lemonisdead

Well-Known Member
Licensed User
Longtime User
Sorry, forgot to mention the fact that some code works on some devices and not other devices too
 

WAZUMBi

Well-Known Member
Licensed User
Longtime User
My feeling here -

B4X is the most amazing and direct tool for Android, Windows, and iOS development.
Noting is perfect and there are bound to be issues with any product.

99% of the time when I have experienced issues with B4X the ultimate problem was with my own syntax, style, or understanding of the code I was attempting to implement.
Sometimes is has taken me hours or even days to overcome a seemingly simple problem.

Bottom line?
If you want to be able to develop the most complete, advanced, and robust applications then you will have to become an expert in Java, C++, Objective-C, and C# at the very least. You will have to use Eclipse or some other direct programming environment.

This aint gonna happen while using B4X.
 

Cableguy

Expert
Licensed User
Longtime User
Sorry, forgot to mention the fact that some code works on some devices and not other devices too
This has to do with OS evolution or Branded OS implementation. In early 2.3, we were able to exploit a bug in the is that allowed GPS to be turned on by code, so no user interaction was needed. We even had a library for it. Then on 2.3.6 (I think) G@@gle "fixed" it and we were no longer able to do it. As stated, B4a is an ever evolving product and as such, some bugs are expected. Most of which can be bypassed using JavaObject or Reflexion..
 

thedesolatesoul

Expert
Licensed User
Longtime User
My question is : why can't we be sure at 100% that the behaviour we get is what was described in the documentation ?

Referring to this thread : https://www.b4x.com/android/forum/threads/startactivity-main-from-service.48328/ CallSubDelayed doesn't start an activity as it should
This is exactly as the documentation describes:
Note that if you call an Activity while the whole application is in the background (no visible activities), the sub will be executed once the target activity is resumed.
 

thedesolatesoul

Expert
Licensed User
Longtime User
Referring to another thread : https://www.b4x.com/android/forum/threads/i-can-not-display-notifications.48279/ I was not able to display notification I had initialized in an Activity
Also for this to work SetInfo must use an Activity name and not a class instance.
Remember there is a difference between Me and Activity.

EDIT:
Further reading about Me:
Me AsObject
For classes: returns a reference to the current instance.
For activities and services: returns a reference to an object that can be used with CallSub, CallSubDelayed and SubExists keywords.
 

lemonisdead

Well-Known Member
Licensed User
Longtime User
Me and Activity
Ahhhhhhh (and bigger).... You've put the finger on my small understanding. I have thought that the context defined by Me was the activity.
Am I wrong if I say that you've explained : Me in that context was the Notification ?
 

thedesolatesoul

Expert
Licensed User
Longtime User
What I try to do is to understand if the result is because :
- or programming mistakes or misunderstandings of the documentation
- or product's limitations (b4a part) : in that case, is a Java developer more powerful ?
- or Android's evolution

I have not posted the question in the general section because I don't want to give a bad feeling of the product. I only want to share with you guys. And if The Master Jedi (@Erel) has some time to exchange with us, this would be appreciated too.

In my feeling, I now have less risks of providing a Windows app than an Android one. Do you have the same feeling ?

Perhaps I'm too old, perhaps I'm not fun or it is time for me to choose another product. But I would like to understand what happens.
The only real product limitations I faced are the issues with extending and raising activity/fragment events. There may be others too.

The reason why Java developers can be more powerful is because of the approach and extensibility of the language(people are talking about things like RxJava, Dagger etc).

If you do feel that there are shortcomings in B4A then it is a good thing to identify it as Erel does listen.
I know the Documentation could be better, but it will probably take effort from some member to do this. klaus has already written many guides and Vader also has a tool for this.
 

thedesolatesoul

Expert
Licensed User
Longtime User
Ahhhhhhh (and bigger).... You've put the finger on my small understanding. I have thought that the context defined by Me was the activity.
Am I wrong if I say that you've explained : Me in that context was the Notification ?
No, Me was the activity instance which is not the same as the activity name.
 

KMatle

Expert
Licensed User
Longtime User
This takes us back to... Understand...

  1. What we (think) our code should do
  2. What it really does and why (not)
  3. Test it on several (real) devices and OS versions
  4. Never trust your code (if not tested ok)
  5. If something doesn't work, in 100% of all cases it's a programming, design or understanding mistake
  6. Reading a documentation doesn't mean one has fully understood it
I know that situations from my work. Often my developers at work are hunting an error in their software and forgot to analyze what the real cause is.
 
Top