Android Tutorial RotatingNeedle

Finally managed to create first tutorial app with B4A, namely the rotating needle. Unfortunately the tutorial omitted to describe how to create and activate the buttons so it took a lot of figuring out that each button had to be initialized followed by Activity.AddView and then the Sub called. Maybe the trick was to force us newbies to learn the hard way so we wouldn't forget. To test our typing skills the entire pdf document is an image to prevent us cheating by cutting and pasting some of the suggested code. School was meant to be hard!! I could not find any of the example code mentioned in the tutorial so here is my attached effort.
 

Attachments

  • RotatingNeedle.zip
    1.2 KB · Views: 570

klaus

Expert
Licensed User
Longtime User
Unfortunately the tutorial omitted to describe how to create and activate the buttons so it took ...
Where did you get the Beginner's Guide from ?
If you downloaded it from the forum, you also got a folder named SourcCode. If you open this folder you find a directory Graphics with a subdirectory called RotatingNeedle, there you have the whole project with source code the layout file (no need to add the views by code) and the images.

Adding views by code is explained in chapter 8.8.

To test our typing skills the entire pdf document is an image to prevent us cheating by cutting and pasting some of the suggested code.
You have all the source code for all projects, so you can copy and paste whatever you want ! The source code examples in the guide are images with the line numbers making it easier to follow the provided source code.
I could not find any of the example code mentioned in the tutorial so here is my attached effort.
Once again, where did you get the guide from ? All code is attached in the forums zip file!

The project you posted doesn't work there are two image files missing. You posted a zip file with only the b4a file, if you want to post a project you must use the IDE menu Files / Export As Zip to make sure that all necessary files are included.

Did your project work ? If yes, where did you get the two image files from?

Best regards.
 

bravotango

Member
Licensed User
Longtime User
Thanks for your help Klaus. I just looked and found the source codes. So I did all that work for nothing. :signOops:

The project works OK so I will compare it with the source code. I got the images from the pdf by using snipping tool.

I got an error trying to upload the project that it exceeded upload allowance so I only uploaded the b4a file.

Bazza
 

bravotango

Member
Licensed User
Longtime User
Well I compared my code with the source code and can now understand why the buttons were left out of the tutorial. It is clear to me now that designer generates the .bal file and also inserts the code for the variables and the click sub routines and initializes all the buttons.

Bazza
 
Last edited:
Top