Tutorials & Examples

Android development starts here. Please do not post questions in this sub-forum.

Solving "Font asset not found" from library

I developed a class (compiled in library) that makes use of Typeface.MATERIALICONS, but when I tried using it there was this error:

HTML:
java.lang.RuntimeException: Font asset not found...
 

Sorting algorithms - Teaching with Basic4android

Implementations of sorting algorithms are useful for teaching fundamental concepts such as algorithms analysis, complexity and data structures.

The following code includes implementations of the...
 
Last edited:

Sound Meter

Hello.
the project was prepared using only the libraries in the forum.

live line chart #Johan Schoeman...
 

Attachments

  • Screenshot_20230422-130730.jpg
    Screenshot_20230422-130730.jpg
    5.7 KB · Views: 277
  • sound1.zip
    34.3 KB · Views: 204
  • Screen_Recording_20230422_130822_1.gif
    Screen_Recording_20230422_130822_1.gif
    88.5 KB · Views: 231

Splash screen

This is the code:
B4X:
'Activity module
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules...
 

SQL Fiddle

There is a very useful online tool called SQL Fiddle that allows you to build test tables, populate them with data & run queries on them. This is great if you are trying to figure out how...
 

SQL Order + Where

What am I doing wrong

B4X:
oRst = SQL.ExecQuery2("SELECT * FROM Bustrip ORDER BY sort Asc WHERE bus = ?", Array As String (Main.find))
 

SQL tutorial

Update 2018:

New video tutorial:


The source code is available here...
 

Attachments

  • SQL.zip
    8.1 KB · Views: 11,867
Last edited:

SQL tutorial here

SQLite Database Pragmas

Pragmas: table_info, index_list, index_info, foreign_key_list

The full list of pragmas can be found at: http://www.sqlite.org/pragma.html. Note, the [match] field of the [foreign_key_list] pragma always shows...
 

Attachments

  • DBPragmas.zip
    323.1 KB · Views: 891
Last edited:

SQLite Full Text Search on a Large Database and Display on an xClv

The primary objective of this cross-platform B4XPages SQLite FTS example is to show the syntax used for Full Text Search queries in SQLite. The database consists of close to 400000 records. It is...
 

Attachments

  • SQLiteFullTextSearchForForum.zip
    20.2 KB · Views: 729

SQLite, remote connection

Hello.
I have the following problem: I can not find an example of code written to run a remote connection to a SQLite DB.
I used the DRC to connect to a DB MS-SQL.
I do not understand if the DRC...
 

SQLiteDB

Below you find an application with a SQLite database and a ScrollView based table.
What the program can do:
- Read a database, 'Load' button.
- Edit, modify or delete date sets (single- or...
 

Attachments

  • SQLiteDB1.jpg
    SQLiteDB1.jpg
    48 KB · Views: 13,949
  • SQLiteDB2.jpg
    SQLiteDB2.jpg
    50.7 KB · Views: 2,597
  • SQLiteDB3.jpg
    SQLiteDB3.jpg
    34.4 KB · Views: 20,051
  • SQLiteDB4.jpg
    SQLiteDB4.jpg
    41.4 KB · Views: 2,340
  • SQLiteDB5.jpg
    SQLiteDB5.jpg
    27.4 KB · Views: 2,564
  • SQLiteDB6.jpg
    SQLiteDB6.jpg
    49.7 KB · Views: 9,103
  • SQLiteDB7.jpg
    SQLiteDB7.jpg
    49.4 KB · Views: 2,549
  • SQLiteDB_V1_1.zip
    26.2 KB · Views: 3,941
  • SQLiteDB_2D_V1_5.zip
    28.5 KB · Views: 3,382
Last edited:

SQLiteLight four simple SQLite projects

Some users asked here for a simple SQLite project as an example to make their first steps in SQLite.
The already existing examples seem beeing somewhat complicated for beginners.

These...
 

Attachments

  • SQLiteLight1.jpg
    SQLiteLight1.jpg
    18.6 KB · Views: 6,077
  • SQLiteLight2_1.jpg
    SQLiteLight2_1.jpg
    41.1 KB · Views: 5,884
  • SQLiteLight2_2.jpg
    SQLiteLight2_2.jpg
    20.1 KB · Views: 5,154
  • SQLiteLight2_3.jpg
    SQLiteLight2_3.jpg
    16.4 KB · Views: 5,044
  • SQLiteLight2_4.jpg
    SQLiteLight2_4.jpg
    32.3 KB · Views: 5,423
  • SQLiteLight1.zip
    130.9 KB · Views: 285
  • SQLiteLight2.zip
    204.2 KB · Views: 250
  • SQLiteLight3.zip
    230.8 KB · Views: 239
  • SQLiteLight4.zip
    229 KB · Views: 274
Last edited:

Square Progress Bar

It wraps part of this Github project. Library files are in the /files folder of the B4A project. Copy them to your additional library folder. Posting the zipped B4A project as well as the...
 

Attachments

  • SquareProgressBar.zip
    314 KB · Views: 863
  • src.zip
    10 KB · Views: 628
Last edited:

Standard vs. Enterprise

What is (will be)the difference between the versions, Standard and Enterprise?

Tazer98
 

Starter Service - Consistent & Single Entry Point

One of the challenges that developers of any non-small Android app need to deal with, is the multiple possible entry points.

During development in almost all cases the application will start from...
 
Last edited:

StateListDrawable & States Tester

I made a little demonstrative app as a complete example of how StateListManager is used control combinations of states, and how to change either normal background images or 9patch background...
 

Attachments

  • StateListDrawable.zip
    111.3 KB · Views: 784
Last edited:

StateListDrawable example

StateListDrawable is a drawable objects that holds other drawables. Based on the view's current state a child drawable is selected.
StateListDrawable holds a list of states. States can be...
 

StateManager - Helps managing Android applications settings and state

Edit: StateManager was written in 2011. I don't recommend using it for new projects. Use B4XPages + KVS2 instead.

StateManager is a code module which takes care of handling the application...
 

Attachments

  • StateManager.zip
    11.7 KB · Views: 1,701
Last edited:

Static Code Modules

Basic4android v1.2 includes a new type of module which is the static code module.
Adding a static code module is done by choosing Project - Add New Module - Code Module.

Unlike Activities and...
 
Top