Tutorials & Examples

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

targetSdkVersion 28 (Android 9.0)

Starting from August 2019 for new apps and November 2019 for updates, Google Play requires apps to set targetSdkVersion to 28.

The tutorial was updated with information related to API level 28...
 

[Example] Add OCR features to your Android application

This example demonstrates how you can use an OCR web service to recognize text in camera images.

The program allows you to take a picture and then send it to OCRWebService.

OCRWebService...
 
Last edited:

[B4X][IoT] - Monitor the home temperature with Adafruit IO

Adafruit IO is a cloud service built for IoT solutions. It provides two interfaces: MQTT and REST API. It is very simple to use it with B4X as demonstrated in this example.

It is more than...
 

Attachments

  • B4R_IO_Adafruit.zip
    1.1 KB · Views: 1,456
  • B4J_IO_Adafruit.zip
    2.4 KB · Views: 1,268
  • B4i_IO_Adafruit.zip
    3.6 KB · Views: 1,119
  • B4A_IO_Adafruit.zip
    8.1 KB · Views: 1,898
Last edited:

[B4X] Input dialogs with XUI Views

SS-2019-01-06_17.52.32.png


B4XDialog from XUI Views library can show simple dialogs, template based dialogs and custom dialogs.

The example...
 

Attachments

  • B4A Dialogs.zip
    10.5 KB · Views: 5,857
  • B4i Dialogs.zip
    62.4 KB · Views: 1,621
  • B4J Dialogs.zip
    3.7 KB · Views: 2,123
Last edited:

[B4X] B4XTable - Adding custom navigation buttons

Depends on B4XTable v1.01+

SS-2019-02-06_15.24.42.png


It is very simple to add your own navigation features.

Code:
B4X:
Sub btnNext_Click...
 

Attachments

  • B4XTable With Navigation Buttons.zip
    59.9 KB · Views: 1,511
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: 684
  • jackson-core-2.7.4.jar
    247.1 KB · Views: 657
  • trialcheck.zip
    347.4 KB · Views: 636
Last edited:

Android InApp Purchase Tutorial + Source Code

Hi,

in this tutorial i will show you how to add an in app product to your android app.

There is an official tutorial by @Erel so you should also check that out...
 

Attachments

  • InApp.zip
    3.2 KB · Views: 1,113
Last edited:

Auto restart an Android Application after a Crash

Trial Period using FTP

Here is a method using FTP to create a trial period for your app. Since there is no local file with trial information, the user cannot defeat it by manipulating stored data. Also, FTP calls are...
 
Last edited:

[Advanced] Using a custom view written with Kotlin

SS-2019-03-25_12.35.54.png


Using Kotlin libraries is similar to using Java libraries. The only difference is that we need to add references to two...
 

Attachments

  • CameraVideoButton.zip
    8.3 KB · Views: 938
Last edited:

Setting custom font for whole application without any library

Hi everyone,

After a week I have finally figured it out how to add a custom font for the whole application without any library or extra code.

Here is the solution:
  1. Create a folder...
 
Last edited:

Create PDF with b4a and php

Hallo,

from time to time someone is asking on how to create a pdf with b4a.
I dont know how to do that ONLY with b4a.

Today i spend a few hours to write a b4a-example and a php-script which...
 

Attachments

  • b4aexample_createpdf_1.1.zip
    12.7 KB · Views: 1,723
  • 20140530_082501_356253050101034.pdf
    25.3 KB · Views: 1,715
Last edited:

AdMob Mediation (with InMobi)

AdMob supports ads mediation. This means that the ad can come from different ad networks and not just from Google AdMob network.

It can improve the fill rate and the revenue earned.

upload_2016-9-26_16-13-44.png
...
 

[Tool] Enhance your layouts with the "Layout bounds" developer option

The creation of layouts is very easy with the B4A Designer.

With more complex forms, however, it can happen that the result looks a bit weird. Usually the heights or distances between the...
 

Android Daydream / DreamService tutorial

Android 4.2 includes a new powerful screen saver feature named Daydream.

A "dream" starts when the device is docked or charged and the screen timeouts. By default dreams are non-interactive...
 

Attachments

  • Daydream_Circles.zip
    6.7 KB · Views: 1,264
  • Daydream_Webview.zip
    6.9 KB · Views: 1,252
  • Daydream_library1.0.zip
    4.8 KB · Views: 1,278

[B4X] B4XTable - Editable table and export to CSV

SS-2019-02-18_16.52.26.png


This example shows how to modify the table data. When the user clicks on a cell we show an input dialog and let the user...
 

Attachments

  • B4XTable-Editable.zip
    52.1 KB · Views: 2,719
Last edited:

[B4X] Tip - Modified server response

While analyzing a Crashlytics crash report of a small app of mine I was surprised to see the following error:

Fatal Exception: java.lang.NumberFormatException
For input string...
 

B4XTable - Photos Album

SS-2019-03-03_13.10.22.jpg


In this example the table is used to show the camera roll photos.

Main steps:
1. Get permission to access the external...
 

Attachments

  • B4XTable-Album.zip
    10.7 KB · Views: 1,238
Last edited:

Using RSA in B4A to communicate with PHP/OpenSSL

As you might know, I do a lot of apps which communicate with my Apache servers via httputils and php. For a longer time I was missing some strong encryption. I knew that there was agrahams...
 

Attachments

  • RSAExample.zip
    9.4 KB · Views: 1,173
Last edited:

[B4X] [XUI] CustomListView - lazy loading / virtualization

xCustomListView v1.50 adds an important new event named VisibleRangeChanged. This event is fired whenever the visible range of items changes.

We can use this event to defer the items creation...
 
Last edited:
Top