Android Question Code Snippets

Alex_197

Well-Known Member
Licensed User
Longtime User
Hi all!

Today I installed B4A 12.80 and tried to see how the code snippets work. I opened my exisitng project and typed a keyword code - only 2 lines appears in the list - see a screenshot screen1.

Then I created a new project and tried to type the same keyword code - nothing comes up at all - screenshot screen2. I also attched a zip with this mew project.

What am I doing wrong?
 

Attachments

  • screen1.png
    screen1.png
    104.9 KB · Views: 78
  • screen2.png
    screen2.png
    82.7 KB · Views: 77
  • TestSnippets.zip
    8.7 KB · Views: 36

Alex_197

Well-Known Member
Licensed User
Longtime User
With the test project in post#1, if the OkHttpUtils2 library is selected you will see two code snippets specific for this library.
When you un-select the OkHttpUtils2 library these two code snippets disappear and this is as it should be.
Why display a lot of snippets for libraries you do not use.
I tried it and you're right. If I deselect this lib snippets are not on the list until I add this lib bacl to the project.
 
Upvote 0

Alex_197

Well-Known Member
Licensed User
Longtime User
He didn't see the snippets. Either he did not have the Snippets folder in the B4X folder of his Additional Libraries or he had opened the project with the previous version of B4A.
I didn't see the snippets because I didn't add this lib to my project. I thought that if I just type a keyword code I will see a list of snippets even if I just install the B4A 12.80 and just created a project.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
I tried it and you're right. If I deselect this lib snippets are not on the list until I add this lib bacl to the project.
Ok, attach the two snippet text files relating to OKHttpUtils2.
I don't have time now (but in a few minutes i will be here again, don't despair šŸ˜„ ).
Surely you're not confusing that library's methods with snippets, right?
 
Last edited:
Upvote 0

klaus

Expert
Licensed User
Longtime User
The OKHttpUtils2 library is a b4xlib library and it contains two code snippets which belong to the b4xlib !
You can add your own snippets or from others and save them in the additional libraries B4X\Snippets folder.
B4xlib library developers can add snippets specific to their library by adding a Snippets folder in the b4xlib zip file.
This is the case with the OKHttpUtils2 b4xlib.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
The OKHttpUtils2 library is a b4xlib library and it contains two code snippets which belong to the b4xlib !
You can add your own snippets or from others and save them in the additional libraries B4X\Snippets folder.
B4xlib library developers can add snippets specific to their library by adding a Snippets folder in the b4xlib zip file.
This is the case with the OKHttpUtils2 b4xlib.
Does this make sense. I didn't know it contained snippets.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Does this make sense. I didn't know it contained snippets.
Sure it makes sense.
I have begun to add code snippets into the xChartMini b4xlib, why should users who do not use it see these snippets.
It would only overcrowd the intellisense list.

Where does the OkHttpUtils2.DownloadManyFiles snippet come from ?
I do not see it. This would mean that you added it somewhere on your computer.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Sure it makes sense.
I have begun to add code snippets into the xChartMini b4xlib, why should users who do not use it see these snippets.
It would only overcrowd the intellisense list.

Where does the OkHttpUtils2.DownloadManyFiles snippet come from ?
I do not see it. This would mean that you added it somewhere on your computer.
Yes, I added it to my Snippets folder (I changed the beginning of its name just for this test; it was obvious that the editor didn't analyze the snippet, although... it could do it too even without so much AI, I have half idea how).
 
Upvote 0

Alex_197

Well-Known Member
Licensed User
Longtime User
Sure it makes sense.
I have begun to add code snippets into the xChartMini b4xlib, why should users who do not use it see these snippets.
It would only overcrowd the intellisense list.

Where does the OkHttpUtils2.DownloadManyFiles snippet come from ?
I do not see it. This would mean that you added it somewhere on your computer.
It's from here - see my screenshots.
 

Attachments

  • screen1.png
    screen1.png
    32.4 KB · Views: 36
  • screen2.png
    screen2.png
    5.8 KB · Views: 35
Upvote 0
Top