Android Tutorial B4A Beginners Guide

klaus

Expert
Licensed User
Longtime User
A new update of the Beginner's Guide is available, version 1.4.

Typos and improvements amended.
Thank's go to the users having repoted typos or errors.

New chapters:
- 8.7 The Abstract Designer
- 8.8 Adding views by code
- 12.5 GPS (a new GPS program will be added in the next update)
- 13.7 Basic Language / Events
- 13.10 Basic Language / Files
- 18.xx some new FAQ's

Best regards.

 

bluejay

Active Member
Licensed User
Longtime User
Excellent - much appreciated - even mentions the tool menu 'Run AVD Manager' issue that occurs in some installations.:sign0098:

bluejay
 

DavidN

Member
Licensed User
This is very helpful! The PDF bookmarks are cleaner in this release; thank you. Would you consider a few changes in the next edition?
- Add bookmarks to the table of contents and the front page. Sometimes its just helpful to quickly see the actual TOC of a document, instead of the bookmarks.
- Include the the revision number in the file name. This is helpful when sorting through multiple editions of a document. I usually add it as a suffix to the end of the file name.
(I'm a technical writer and these are some ideas I've found helpful.)
If you want any help writing or editing this document, let me know.
 

netchicken

Active Member
Licensed User
Longtime User
Darn, I just skimmed the new manual and realized then when I started learning B4A the first thing I should have done is RTFM first. it would have saved me heaps of time working stuff out.

A great resource!!!
 

Hubert Brandel

Active Member
Licensed User
Longtime User
Thanks a lot, thats what I am waiting for... :sign0060:

Bye the way EREL, what a very nice new homepage and forum style
 

Hubert Brandel

Active Member
Licensed User
Longtime User
Hi,

I think I found an error on page 144 on Version 1.4.

Your text says:
B4X:
Updating data:
UPDATE TableName Set (Col1 = 'Val1', Col2 = Val2) WHERE ID = idVal
SQL1.ExecuteNonQuery("UPDATE TableName Set (Col1 = 'Val1', Col2 = Val2)" WHERE ID = idVal")

but ... " WHERE ID ... seems to be from a other command syntax and
Set (Col1=....,....) gives an SQLlite Syntaxerror by (.

This line will work here:

B4X:
SQL.ExecNonQuery("UPDATE LG Set AbleseDatLG = '', SortAbDatLG = '' WHERE LgNr = " & WinListLG.nActiveLG)

to avoid irritation:

AbleseDatLG = '' and SortAbDatLG = '' => ' ' just an empty string.
"UPDATE LG Set ...' WHERE LgNr = " & WinListLG.nActiveLG ) => "
 

klaus

Expert
Licensed User
Longtime User
Thank you Hubert,

You are right:
B4X:
UPDATE TableName Set (Col1 = 'Val1', Col2 = Val2) WHERE ID = idVal 
SQL1.ExecuteNonQuery("UPDATE TableName Set (Col1 = 'Val1', Col2 = Val2)[COLOR=Red]"[/COLOR] WHERE ID = idVal")
It should be (one " too much):
B4X:
UPDATE TableName Set (Col1 = 'Val1', Col2 = Val2) WHERE ID = idVal 
SQL1.ExecuteNonQuery("UPDATE TableName Set (Col1 = 'Val1', Col2 = Val2) WHERE ID = idVal")
Will be amended in the next update.

Best regards.
 

Hubert Brandel

Active Member
Licensed User
Longtime User
But I got an error because of the ( ) too.
I think the are only for the ExecuteNoneQuery2() ... with the parameters.
 

clx

Member
Licensed User
Longtime User
Thanks again for this Klaus.

Really helpful and useful info in this guide!!
 

quickstraw

New Member
Problem with the first 2 programs

First off, thanks for the Guide. I'm new to programming and am stumbling through, but the guide is starting me off on the right foot.

My question is, on both the FirstProgram and the SecondProgram, when you hit ok for the first time, no results show up. But after that, results of good, wrong or error all work perfectly. Is this how it is suppose to work or is there an error? I can't figure out why it isn't working correctly. I did check my code and it matches the original source code perfectly. Just curious. Thanks!
 

klaus

Expert
Licensed User
Longtime User
My question is, on both the FirstProgram and the SecondProgram, when you hit ok for the first time, no results show up.
That's how the program does work.
Normally you enter a result and then click the OK button.
The program checks if there is a result entered, if no you get the message, and you get this not only the first time. Afterwards, if you click on NEW and just after you click on OK you get also the message.
If you would avoid this behaviour, you could hide the OK button as long as the result EditText view is empty.

Best regards.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…