Tutorials & Examples

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

[B4X] AsyncStreams Tutorial

New video tutorial:


AsyncStreams allows you to read data from an InputStream and write data to an OutputStream without blocking your program. The reading and writing are done...
 
Last edited:

ScrollView examples summary

Last edited:

[B4X] B4A, B4i, B4J and B4r API documentation - B4X Object Browser

API documentation - B4a, B4i, B4J and B4R (i.e. B4X) Object Browser (which also includes Code Snippet Management)

Hi everyone,

As you may or may not be aware, I have embarked on a...
 

Attachments

  • upload_2014-12-11_22-32-46.png
    upload_2014-12-11_22-32-46.png
    106.1 KB · Views: 2,561
Last edited:

Android Wifi-Direct Tutorial

Android 4+ devices support Wifi Direct (Wifi P2p). Wifi Direct allows you to connect two devices over wireless without an access point. It is similar to Bluetooth with a much extended range and...
 

Attachments

  • WifiDirectExample.zip
    8.7 KB · Views: 16,781

Supporting multiple screens - tips and best practices

This is an old tutorial. I recommend to instead watch the visual designer video tutorial: https://www.b4x.com/etp.html

There are several features in B4A that help you target Android...
 
Last edited:

Android FTP tutorial

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: 5,945
Last edited:

Designer Scripts Tutorial

Background

One of the most common issues that Android developers face is the need to adopt the user interface to devices with different screen sizes.
As described in the visual designer...
 
Last edited:

ScrollView example

The ScrollView is a very useful container which allows you to show many other views on a small screen.
The ScrollView holds an inner panel view which actually contains the other views.
The user...
 

Android "Kiosk mode" tutorial

Attachments

  • Kiosk.zip
    6.7 KB · Views: 5,519
Last edited:

Handle the soft keyboard with the IME library

Android has very good support for custom input method editors (IMEs).
The downside for this powerful feature is that interacting with the soft keyboard can be sometimes quite complicated.

This...
 

Attachments

  • IME.zip
    11.3 KB · Views: 7,954
Last edited:

Read / Write Excel files on Android

The Excel library is a new library that wraps the open source jexcel project and allows you to read or write Excel workbooks. This library supports XLS files. The new xml based format (xslx) is...
 

Attachments

  • ExcelExample.zip
    12.8 KB · Views: 9,554
  • ExcelLibrary.zip
    13.1 KB · Views: 8,826
Last edited:

Google Maps

Attachments

  • GoogleMapsExample.zip
    8.4 KB · Views: 4,281
  • GoogleMaps.zip
    19.4 KB · Views: 4,620
Last edited:

Runtime Permissions (Android 6.0+ Permissions)

1. Edit: In B4XPages the permission result event signature is: Wait For B4XPage_PermissionResult (Permission As String, Result As Boolean)
2. Important to read...
 
Last edited:

Android home screen widgets tutorial - part I

Edit: widgets are handled with receivers now. See the attached example.

This tutorial will explain how to implement your own home screen widgets (also named App Widgets).

It is important...
 

Attachments

  • HomeWidgets.zip
    24.6 KB · Views: 564
Last edited:

Android Network Tutorial

This is an old tutorial. All new implementations of network solutions should be based on AsyncStreams.

The Network library allows you to communicate over TCP/IP with other computers or...
 

Attachments

  • NetworkExample.zip
    23.7 KB · Views: 7,570
Last edited:

Android views animation tutorial

The Animation library allows you to animate views.
These small animations are really nice and can affect the user overall impression of your application.

The attached program demonstrates the...
 

Attachments

  • AnimationExample.zip
    10.6 KB · Views: 6,456
  • Animation.apk
    77.1 KB · Views: 2,767

Embed an Http Server in your Android Application

The HttpServer library is a new library, based on an open source project named Jetty. This library allows you to easily embed an Http server in your application.

Http server means that you...
 

Attachments

  • HttpServerExample.zip
    58.1 KB · Views: 7,334
Last edited:

android.jar / targetSdkVersion / minSdkVersion

There are several versioned components that affect the compilation process and the runtime behavior of our apps.
The purpose of this tutorial is to explain the differences between them and help...
 
Last edited:

Intent Filters - Intercepting SMS messages in the background

Old tutorial. Don't use services. Use receivers.
Broadcast receivers are program components that can handle broadcasted messages. These messages usually notify about a system event.

There...
 
Last edited:
Top