Tutorials & Examples

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

Compilation time and auto-increment build version

This tutorial demonstrates how the custom build action feature can be used to add a file during compilation with the compilation time and an automatic version number that is incremented with every...
 

Attachments

  • compiletime.jar
    81.9 KB · Views: 935
Last edited:

Compass: TRUE HEADING & Magnetic Declination.

I am presenting a test project - Compass. Post #1
- displays TRUE HEADING with local magnetic declination.

Tested in parallel with the application AndroiTS GPS Test v.1.48 Free...
 

Attachments

  • Screenshot_2017-11-TrueHeading.png
    Screenshot_2017-11-TrueHeading.png
    60.4 KB · Views: 748
  • TRUE HEADING.zip
    276.2 KB · Views: 674
Last edited:

Comparison Operators in Select Case

Just a small request for the wishlist. It would be nice to be able to use Select Case using the 'greater than' and 'less than' operators <>. It makes for cleaner code than 'if' 'else' and 'end if'...
 

Colourful Indicator

It comes from here. The project displays as an example a colourful battery level indicator. Lib files are in the /files folder of the B4A project. The indicator will only update/redraw when...
 

Attachments

  • FitChart.zip
    42.2 KB · Views: 534
Last edited:

Colors Game (Simple game source)

Hi all.
i made this game some time ago, its simple, i never used, i found today on my old sources folder and i m here to share with all.

The labels are in portuguese, but is very easy to...
 

Attachments

  • colorsgame.zip
    365.5 KB · Views: 711

ColorPickerDialog setcolor by default

hello and happy new year !
when I open a ColorPickerDialog I always black as default color is it be possible to put another color, I would like to colors.blue for example, or any other color it...
 

Collision Detection for Tile-based Platform Games

For those interested in creating their own collision detector, here the tutorial I'm currently studying...
 

Collection of tutorials in PDF format

Edit: This resource is no longer available. Better resources are available here: https://www.b4x.com/etp.html

You can now download a PDF file that contains most of the tutorials. The...
 
Last edited:

Collecting tips - Beginners wanted!

I want to collect useful tips for developers who are starting to develop with Basic4android.
I'm deeply familiar with Basic4android and therefore not always aware of difficulties that new users...
 

Code Obfuscation

This tutorial is relevant for B4A and B4J.
During compilation B4A generates Java code which is then compiled with the Java compiler and converted to Dalvik (Android byte code format).
There...
 
Last edited:

code for arduino and android communication .

hi guys . i am new in basic4android programing . im having difficulties on coding(its my first time) b4a.
im making a program that will light a led on/off using arduino and android . can someone...
 

Clv Simple Chat Example (adjustable text size)

Hi All.
Here is a very very simple example of how make a chat using clv.
the text and name is ajustable automatic, you can receive any text and the code will ajust using the correct size.

The...
 

Attachments

  • exampleclv.zip
    301.3 KB · Views: 981

Clock - 24hr analogue clock

pic1.png


This was done just for fun. It is a 24 hour analogue clock/watch. Have used the GPS Example from @klaus as base for this clock.
JHS CLOCK V1 => a 24 hour clock running clockwise...
 

Attachments

  • JHS CLOCK V1.zip
    173.4 KB · Views: 888
  • JHS Clock Panels.zip
    19.6 KB · Views: 653
  • JHS CLOCK TIME TRAVEL.zip
    174.6 KB · Views: 683
Last edited:

Clipboard

Trying to find a way to copy barcode scanner example barcode into Android ClipBoard.
Not having very much luck finding a Basic example.


Embarassing it took me a long time to find this.
And I'm...
 
Last edited:

Client IRC (Internet Relay Chat)

With the IRC Client complete the work started with the IRC Server.

As already explained is a Basic version, to give only an idea of how it works, but it is not complete with all the commands, and...
 

Attachments

  • irc_chat.zip
    18 KB · Views: 713

Classes tutorial

Basic4android v2.00 adds support for classes modules.

Classes definition from Wikipedia:
In object-oriented programming, a class is a construct that is used to create instances of...
 

Attachments

  • Draw.zip
    7.1 KB · Views: 2,346
Last edited:

Class example - Galaxy system emulation

This "galaxy" example simulates planets movements based on the gravity forces.

The purpose of this example is to demonstrate the usage of classes in a graphical program...
 

Attachments

  • Stars.zip
    8 KB · Views: 1,136

Check your app presence on Google Play

Your app has been removed on Google Play.
Sample code for those who have previously installed the application not to use it again.

B4X:
Sub Globals
    Dim job1 As HttpJob
    Dim xui as XUI
End...
 
Last edited:

Check Trial Period using Dropbox (new with admin tool)

Check Trial Period using Dropbox (first version, improved version in Post #2)

Hello,

I have tried to find a solution to solve the control of the trial period of an app using the...
 

Attachments

  • encryptpw.zip
    297.9 KB · Views: 386
  • jackson-core-2.7.4.jar
    247.1 KB · Views: 373
  • trialcheck.zip
    347.4 KB · Views: 360
Last edited:

Check the Network State and Wifi SSID Name with reflection

============= MANIFEST =====================

B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="19"/>
<supports-screens android:largeScreens="true"...
 
Top