Android Tutorial B4A Beginners Guide

Discussion in 'Tutorials & Examples' started by klaus, Jun 6, 2011.

  1. Mitchboo

    Mitchboo Member Licensed User

    Hi.

    Encountering an issue with Number1 and Number2 in the first program of the Beginner's guide.

    I followed everything carefully, but it seems Number1 and Number2 do not really behave as global.

    Code:
    Dim Number1, Number2 As Int
    is in Sub Globals as instructed, but when the program kept telling me it was the wrong result, I added a MsgBox in CheckResult
    Code:
    Msgbox("Value", Number1 + Number2)
    And I get 0 (zero).

    If I set the value in a line just before, it does display it. It seems these variables do not keep their value between events.

    What am I missing ?

    TIA
     
  2. klaus

    klaus Expert Licensed User

    I tested it and it works.
    I thought that it should be Msgbox("Value", (Number1 + Number2))
    But even Msgbox("Value", Number1 + Number2) works.
    According to your code the number is displayed in the title !

    Otherwise post you project as a zip file (IDE menu File / Export As Zip) and I'll have a look at it.

    Sorry for answering only now, because today I was HERE.
     
  3. Mitchboo

    Mitchboo Member Licensed User

    Thank you Klaus.

    I just found what was wrong. I had forgotten to call New in Activity_Create :confused:

    PS: You are in a superb area !
     
  4. klaus

    klaus Expert Licensed User

    A new edition of the Beginner's Guide is now available.
    Edition 3.0 2015.07.26
    Updated with the new B4A V5.02 features.
     
  5. appie21

    appie21 Active Member Licensed User

    Many thanks!
     
  6. Fergus Cheng

    Fergus Cheng New Member Licensed User

    that's great. thank you very much
     
  7. klaus

    klaus Expert Licensed User

    A new edition of the Beginner's Guide is now available.
    Edition 3.1 2015.10.13
    Updated with the new B4A V5.20 features.
     
  8. Ferbis

    Ferbis Member Licensed User

    Thank you very much once more for this splendid job. You are the best!!! :)
     
  9. Sergey Kravchenko

    Sergey Kravchenko Active Member Licensed User

    BG 3.1 !
    Thanks a lot!
     
  10. klaus

    klaus Expert Licensed User

    A new edition of the Beginner's Guide is now available.
    Edition 3.2 2015.12.08
    Updated with the new B4A V5.50 features

    Link in my signature.
     
    Last edited: Dec 8, 2015
  11. Sergey Kravchenko

    Sergey Kravchenko Active Member Licensed User

    I suggest in the book in the contents of notes with a marker [new] chapters are changed.
     
  12. klaus

    klaus Expert Licensed User

    In the last update there are only minor changes, mainly images.
     
  13. BitsAndBytes

    BitsAndBytes Active Member Licensed User

    Thank You Very Much!
     
  14. klaus

    klaus Expert Licensed User

    A new edition of the Beginner's Guide is now available.
    Edition 3.3 2016.10.26
    Updated with the new B4A V6.30 features

    Link in my signature.
     
    Sergey Kravchenko, Erel and Ferbis like this.
  15. pjo12345

    pjo12345 Active Member Licensed User

    There is a problem with the formatting in 4.1.1 ;)


    upload_2016-10-26_23-12-18.png
     
  16. klaus

    klaus Expert Licensed User

    Thank you for reporting this, it was due to the Word to pdf conversion.
    A new pdf file is now on the site.
     
  17. MitchBu

    MitchBu Active Member Licensed User

    Page 41 of the Beginner's Guide, it is mentioned :

    The project is available in the SourceCode folder:
    SourceCode\SecondProgram\SecondProgram.b4a


    Could not locate any SourceCode folder in the installation folder. It does not seem there is any archive anymore for download.

    Would appreciate pointers.

    TIA
     
  18. klaus

    klaus Expert Licensed User

    When you download the guide from HERE or from my signature you get a zip file with the guide and the SourceCode folder.
     
  19. MitchBu

    MitchBu Active Member Licensed User

    Superb. Thank you Klaus :)
     
  20. MitchBu

    MitchBu Active Member Licensed User

    Well, it seems I have a knack to find missing things. In the same beginners guide, page 180, the tutorial goes :

    Let us make an example based on the TestLayoutsAnchors project
    (which can be found under the Guide\SourceCode\TestLayoutsAnchors directory):


    And it is nowhere to be found :(

    Search in the forum does not lead to any positive response, and even a Google search site:b4x.com "TestLayoutsAnchors" does not bring any result. I am starting to suspect that project has been abandonned long ago.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice