Android Tutorial B4A Beginners Guide

This guide is obsolete ! It is no more updated.
Please use the B4X Booklets.


Here is a Beginner's Guide in pdf format.
The source code for the example programs is included.

All suggestions, remarks and typo reports are welcome.

To know what vesion you have, look at the lower right corner of the cover page there is an Edit number.
Latest version Edit 3.3

Best regards.


EDIT 2016.10.26 Edition 3.3
Updated with the new B4A V6.30 features.
A big thank you to widget who sent me a complete review with suggestions and typos.
Almost all suggestions have been added.

EDIT 2015.12.08 Edition 3.2
Updated with the new B4A V5.50 features.

EDIT 2015.10.14 Edition 3.1
Updated with the new B4A V5.20 features.

EDIT 2015.07.26 Edition 3.0
Updated with the new B4A V5.02 features.

EDIT 2014.06.04 Edition 2.9
Updated with the new B4A V3.80 features.
Amended some typos.

EDIT 2014.05.07 Edition 2.8
Updated with the new B4A V3.50 features.
Amended some typos.

EDIT 2014.02.05 Edition 2.7
Updated with the new B4A V3.20 features.

EDIT 2013.10.13 Edition 2.6
Updated with the new B4A V3.00 features.

EDIT 2013.05.19 Edition 2.5
Updated with more recent Android SDKs.
Updated to Basic4Android Version 2.70
Added some code snippets to B4A Code Snippets.

EDIT 2013.01.20 Edition 2.4
Minor update with the changes of B4A Version 2.5

EDIT 2012.12.27 Edition 2.3
Updated to Basic4Android 2.3
Updated some chapters

EDIT 2012.08.30 Edition 2.2
- Updated to B4A 2.02
- Removed chapters Keywords, Views and Collections moved them in a separate guide Keyword_Views.pdf
- Added Chapter 12. Tools
- Chapter 12 Example Programs becomes 13
- Chapter 13 Basic Language becomes 14
- Chapter 14 Basic Graphics / Drawing becomes 15
- Chapter 15 Keywords removed
- Chapter 16 Views removed
- Chapter 17 Collections rmoved
- Chapter 18 VB6 versus B4A becomes 16
- Chapter 19 FAQ's becomes 17
- Chapter 20 Glossary becomes 18
- Added new chapters to FAQ'schapter
- Chapter 17.39 not yet finished

Two new Guides have been added:
- Keyword / Views / Collections these chapters were in the Beginner's Guide before
- B4A Code Snippets, it's a collection of code snippets I took from the forum.

EDIT 2012.04.11 Edition 2.1
- Added chapter 5.3 Screen Orientations
- Added chapter 6.4 Exchanging files with PC
- Added chapter 8.9 Designer Script
- Added chapter 13.5.3 Calling a Sub from another module
- Added chapter 13.11 Lists
- Added chapter 13.12 Maps
- Added chapter 17 Collections
- Chapter 17 becomes 18
- Chapter 18 becomes 19
- Added chapter 19.25 Detect screen orientation
- Added chapter 19.26 Some functions don't work in Activity_Pause
- Added chapter 19.27 Calling internal Calculator
- Added chapter 19.28 Get the Alph / Red / Green / Blue values

EDIT 2012.03.11 Edition 2.0
- Amended some errors
- Updated to B4A version 1.8
New chapter
- Working with different screen sizes / number of layouts

Removed chapters
- SQL moved to the User's Guide
- GPS moved to the User's Guide

EDIT 2012.01.01 Edition 1.6
- Added the Widget tutorials.
- Amended some errors.

EDIT 2011.12.25 Edition 1.5
- Added the GPS Example program with some explanations of the code.
- Added some subchapters inspired by forum questions.

Edit: 2011.11.01 Version 1.4
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

Edit: 2011.08.29 Version 1.3
New chapter:
- 18 FAQ's

Edit: 2011.08.15 Version 1.2
Above chapters have been added.

Edit: 2011.06.12 Version 1.1
Still missing chapters:
Modules
Example Programs
- ScrollView example
- Database example
Basic Language
- String manipulations
- Timers
Graphics
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
Thank you very much Klaus. This guide is a very important resource for Basic4android developers, especially for new developers who need to understand the fundamental concepts.

The guide is also available on SlideShare.com: http://www.slideshare.net/Erel2/beginners-guide
 

Omar

Member
Licensed User
Longtime User
Thank you very much Klaus.

I am certain this will be an excellent reference material for newcomers like me.
 

splatt

Active Member
Licensed User
Longtime User
Klaus,

Just skimmed through the Beginner's Guide. :sign0188:

This looks like a major step forward for new users. When I get time I will look through it in more detail.
 

JMB

Active Member
Licensed User
Longtime User
Excellent work, Klaus!

I'm just wondering where this puts the Wiki, because it seems that there's a lot of duplicate work going on at the moment between the Beginner's Guide and the Wiki.

Should the Beginner's Guide perhaps become the main target of effort? Not sure...

Any thoughts?

JMB
 
Last edited:

fraxinus

Member
Licensed User
Longtime User
Thank you Klaus for an excellent guide for us beginners. Is there a beginners guide for database usage in B4A. as I am still at a loss how to get to grips with it. It might say (Dbutils is simple), but not for us beginners.
Rob
 

klaus

Expert
Licensed User
Longtime User
Hi, thank's for your nice word.

I'm just wondering where this puts the Wiki, because it seems that there's a lot of duplicate work going on at the moment between the Beginner's Guide and the Wiki.

Should the Beginner's Guide perhaps become the main target of effort? Not sure...

Any thoughts?

JMB
In my mind the Beginner's Guide is dedicated for real beginners to make their first steps, and off line. The real basics, simple examples, with more detailed explanations. The Wiki is a good solution for more advanced users.

Is there a beginners guide for database usage in B4A. as I am still at a loss how to get to grips with it. It might say (Dbutils is simple), but not for us beginners.
Not yet, but it's in the pipe line. But no concrete schedule yet.

Best regards.
 

aklisiewicz

Active Member
Licensed User
Longtime User
Nice document swohin maintaining database manipulation will be more than welcomed. I'm tlakin about something that's finisher (not the code fragments which are nice but not related to each other). You need to keep in mind that new users (even if the do know some other language) ) have no idea how the datadase manipulation takes place. Personaly when get to the point to insert a Quary into the strin, I should be fine, but what to do before and after is still a mystery to me.

What I would like to see in eventual doc for datacase handling is a full featured application with some examples on how to deal with most common database tasks:
addin, updating record through the form, deleting record. the I would like to see similar tasks but working on multiple records, then some example on how to mark records for update, deletion etc. finally I would like to see some example of Parent/Child type relationship - screen header and list of records (Invoice/Order) would be perfect example.

BTW:
I briefly looked at the PDF and I have to say I was very pleased. Klaus - you did excelent job, which makes me think I will really stick up to B4A. I want to say my personal - THANK YOU


Art
 
Last edited:

aklisiewicz

Active Member
Licensed User
Longtime User
Klaus - what I like to most about your documents is that you not only providing examples but explaining the concepts, and that is very important. I probably would not spent so much time on IDE itself as 90% of it is really easy to figure out, but I'm starving for more documents like yours. I hope you already have a lifetime job with Erel to prepare quality manuals ;-)

I have red previous PDF guide (not sure who made it) but yours is a whole class better. Congratulations!

PS>
just got to Chapter 11 - Modules. Is is work in progress or that's it?

Cheers - Arthur
 
Last edited:

klaus

Expert
Licensed User
Longtime User
What I would like to see in eventual doc for datacase handling is a full featured application with some examples on how to deal with most common database tasks:
addin, updating record through the form, deleting record..
Did you have a look here ScrollView example with multiselection and SQL, most of your requests are in there.

... the I would like to see similar tasks but working on multiple records, then some example on how to mark records for update, deletion etc.
The Beginner's Guide is dedicated to 'beginners', I'm afraid that these requests are already for advanced users. And probably the main problem is not B4A but the SQL knowledge.
... finally I would like to see some example of Parent/Child type relationship]
What is this ? As you see, this seems obvious to you, but not to everybody, at least not to me.

I briefly looked at the PDF...
Why only briefly and deaply :) ?

For most of your questions, I would suggest you to begin a concrete project and then come up with concrete questions so we know more precicely what you want to do, and then we can give you better advices.

Best regards.
 

aklisiewicz

Active Member
Licensed User
Longtime User
Well 'briefly' because I skipped sections that I'm already familiar with. SQL is SQL, and I'm talking here about the concept and the process. Let me exmaplin (what I think is missing in the manuals).

If I mastered SQL I can feel really comfortable inside any type of SQL query, but not outside of it. My problem with understanding is that I'm not rally sure how the data travels between the screen (ie. TexField) and physical column in a database.
I the software I have used in the psat there was a screen variable to gold the input temporarily, then the input data was send to the database (and this was always handeled by database driver). This way I did not have to worry about checking any type of conditions (concurency checking, record locks, connection lost, etc.). Everything was handled by the driver. At the same time temporary screen variable was very easy to manipulate (hide, make ReddOnly etc.).
When I wanted to display a list full of records I had several choices (i.e)
- build a recordset or view
- fill the queue with the data pulled of the database (again the driver was doing the selection based on my criteria - query)
- then finally I could send the queue contents to the screen
Physically all above was handled for me by the template which automated creating this process by 90%, but If I wanted 100% control I could do this manually the way I described. As you see in this description was no code but rather a concept. I could abviously go more into details if I would write a manual, but this is just to give you and other the idea what part (in my opinion) is missing in the documentation.

Of course another problem is that documents and resources are fragmented and I'm glad that initiative like yours is helping to gather everything in one place. It would help a lot.

---------------------------
As for Parent/Child terminology, I'm finding it funny! You see - it is like for me the terms ACTIVITY, VIEWS etc. are new and confusing, so for you (and some others)
Parent/Child. I'm coming from environment where every developer knows exactly what this term means,..so....
Parent/Child refers to relationships, where Parent (top)record is related to its child record, then then ChildRecords is related to GrandChild etc...
In SQL it refers to Joining tables...

Example: CUSTOMER - ParentRecord customer has orders, so ORDER_HEADER is ChildRecord(to CUSTOMER), then the order has its items so ORDER_ITEM table is a GrandChild to CUTOMER and Child to ORDER-HEADER and so on. This is epecially important when dealing with RI.

Art
 
Last edited:

aklisiewicz

Active Member
Licensed User
Longtime User
no I havent seen this example, so this is what I was talking about when saying the resources are fragmented and not easy to find. Looks like this is what I was looking for. Thank you (soon you become my hero;-)

PS>
just run your App and I can't seem to figure out what the Modif button supposed to do ?
It would be also great to add some recordEdit form to change existing record.

Art
 
Last edited:

PapaLeoZ

Member
Licensed User
Longtime User
Big Thank You

Thank You Klaus... Just want you to know that your efforts are appreciated!
 

aklisiewicz

Active Member
Licensed User
Longtime User
Klaus, your example is very nice, but this is not what I was looking for. I wanted an example which shows simple record manitpulation in sense of: Adding/Changing/Deleting through the FORM. yours does not use any forms to edit data. There is lots of things relatexd to forms...
I would like to see how to pass paramtere to the form, how ti PrimeFields, how to do multiple forms, etc... and most of all (like I mentioned in my other post) Parent/Child type screens...

Thanks - Art
 

klaus

Expert
Licensed User
Longtime User
I wanted an example which shows simple record manitpulation in sense of: Adding/Changing/Deleting through the FORM. yours does not use any forms to edit data. There is lots of things relatexd to forms
This proves that you didn't really look at this program !
In the program you CAN Add, Delete, Modify, Move any entry ! This is all done on the same form. Using other panels to do this is straigt forward.
The example program is not intended as a stand alone finished program it's intended to show what can be done. It's up to you to adapt it to your requirements.
It seems from your posts and very general questions, that you are looking to find different code snippets, pick them up and assembling them in a kind of patchwork, without taking the time to understand what these codes are doing. That's for me the WRONG way, as already said, begin with a project, tell us what really you want to do, how you imagine doing it. I still don't know !!!

Best regards.
 
Top