Tutorials & Examples

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

Custom WebSocket Based Push Framework

The online example is currently disabled due to spam :(

Now that both B4A and B4J support WebSockets it is possible to implement a full push framework solution.
The solution is made of two...
 

Attachments

  • Push_Client.zip
    11.5 KB · Views: 4,901
  • WebSocketPush.apk
    143.7 KB · Views: 3,234
Last edited:

DBUtils - Android databases are now simple!

Attachments

  • DBUtils.zip
    14.4 KB · Views: 6,136
Last edited:

Automatic adjustment of system date and time through GPS (root only)

Attachments

  • GPS DateTime.zip
    10.4 KB · Views: 695
  • Android 6.png
    Android 6.png
    40.7 KB · Views: 821
  • Android 2.3.6.png
    Android 2.3.6.png
    13.9 KB · Views: 849

Simple Code Module to implemente a License file using StringFunctions Encrypt

B4X:
Type=StaticCode
Version=6.48
ModulesStructureVersion=1
B4A=true
@EndOfDesignText@
'******************************************************************************************************
'*...
 

Attachments

  • Licensing.bas
    3.5 KB · Views: 538

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: 771
Last edited:

SQL tutorial

Update 2018:

New video tutorial:


The source code is available here...
 

Attachments

  • SQL.zip
    8.1 KB · Views: 12,621
Last edited:

[Example] Creating a sticky service - long running background tasks

Please see the original post:

About sticky service - long running background tasks...
 

Attachments

  • Services_example.zip
    9 KB · Views: 853
  • Screenshot_2016-11-25-12-23-53.png
    Screenshot_2016-11-25-12-23-53.png
    18.9 KB · Views: 925
  • Screenshot_2016-11-25-12-35-40.png
    Screenshot_2016-11-25-12-35-40.png
    77.4 KB · Views: 972
  • Screenshot_2016-11-25-12-37-41.png
    Screenshot_2016-11-25-12-37-41.png
    46.7 KB · Views: 856
Last edited:

Creating and Packaging a Wear App

This tutorial will show you how to create an app for a Wearable device and how to package it so it auto installs.

What is Android Wear?
For those that do not know, Google has released...
 

Attachments

  • WearTest(handheld).zip
    109.1 KB · Views: 1,103
  • WearTest(wearable).zip
    5.5 KB · Views: 1,051
Last edited:

Android Beam Tutorial

Android Beam is a feature introduced in Android 4 that allows one device to transfer a message to another device by placing the devices back to back. The communication is based on NFC.

The main...
 

Attachments

  • Beam.zip
    8.2 KB · Views: 1,265
Last edited:

How to make games

How to make games

A great idea, but a disappointing result

You woke up one morning with a great idea for a game. You rushed to your phone to convince your best friend to...
 
Last edited:

Shared Code Modules

Last edited:

Auto send KeyCodes.KEYCODE_BACK at runtime

Hi,
How to send / trigger the KeyCodes.KEYCODE_BACK at runtime without user clicking it

tks
 

Tutorial - How to sign apk with non-B4A keystore

Here is my first tutorial for the community!

This tutorial will show you how to sign a B4A generated apk with a non-B4A keystore. I needed a way to do this for myself since I had some apps out...
 
Last edited:

[B4X] Anchors Demonstrated

SS-2016-02-29_15.19.52.png


SS-2016-02-29_15.19.11.png


The anchors feature is simple to use and is...
 

Attachments

  • AnchorsExample.jar
    317.1 KB · Views: 2,163
Last edited:

Android JSON tutorial

JSON format is a a format similar to XML but usually it is shorter and easier to parse.
Many web services now work with JSON. JSON official site: JSON

Using the new JSON library, you can...
 

Attachments

  • JSONExample.zip
    5.2 KB · Views: 6,560
Last edited:

Android Serial tutorial

Attachments

  • SerialExample.zip
    6.3 KB · Views: 11,093
Last edited:

SVN (source control) and Basic4android

Large projects and especially projects maintained by a group of developers usually require a source control system.
Using SVN with Basic4android is quite straightforward with a client tool such as...
 

Testing your app on real devices: pCloudy.com

Hi there

I'm hoping there are other methods of doing this..., if so, let's please share.

Anyway, a client was indicating the app I just sent does not work on their S7 samsung phone. So me, #bang...
 

Attachments

  • pCloudy.png
    pCloudy.png
    97.8 KB · Views: 890
  • googlecrash.png
    googlecrash.png
    18.2 KB · Views: 795
Last edited:

CuteR - with inlne Java Code

Attachments

  • CuteR.zip
    313.2 KB · Views: 620
  • core-3.2.1.zip
    483.9 KB · Views: 834

Simple time calculation based on EditText

On your form you use an EditText to input time. If you want to calculate with this, may be the following example will help:

B4X:
Sub AddTime(OriginalTime As EditText,HoursToAdd As Int,MinutesToAdd...
 
Top