Tutorials & Examples

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

Nine patch images tutorial

Android supports a special format of PNG images that can be resized by replicating specific parts of the image.
This images also include padding information.
These images are named nine-patch...
 

Attachments

  • NinePatchExample.zip
    7.4 KB · Views: 2,576

Camera2 - Still images and videos

Camera2 library is based on the Camera2 API introduced in Android 5 (API 21).
It is designed to work together with CamEx2 class.
It is supported by B4A v7.3+. The library will be included as...
 

Attachments

  • CamEx2.zip
    22.4 KB · Views: 844
Last edited:

Different examples with 2 layouts

As an answer to the thread Forms alike, I thought that the examples below would be of general interest.

Attached there are 4 examples with two same layouts but with different managements...
 

Attachments

  • TwoLayoutActivities.zip
    14.1 KB · Views: 2,026
  • TwoPanelActivity.zip
    12.4 KB · Views: 1,678
  • TwoPanelLayouts.zip
    14.5 KB · Views: 1,753
  • TwoActivityLayouts.zip
    8.7 KB · Views: 1,391
Last edited:

B4a projects source code.

Hi everyone,

For the last 10 hours, I browsed every threads in "Share your creations" because I wanted to gather a lot of source code. About 1/6 of the posts actually have source code shared...
 
Last edited:

[B4X] Regular expressions (RegEx) tutorial

Regular expressions are very powerful and make complicate parsing challenges much easier.
This short tutorial will describe the usage of regular expressions in Basic4android.
If you are not...
 
Last edited:

Library compilation - Compile your project to a library

Starting from Basic4android v2.50 you can compile your project, or part of it to a regular library.

Why should I compile a library?
  • Break large projects into several smaller (more...
 

Super-fast alternative to emulator -> x86 Android

Hi all

*EDIT3*

For a much easier to set up and faster Android emulation please now look at this thread:

GeanyMotion...
 
Last edited:

B4Xgoodies_from_walt61 Online

Well,

As JamesGreaves requested,
"So do you not think it would be of value to have even something like @walt61 has created but online?"...
 
Last edited:

Conditional Compilation & Build Configurations

B4A v3.80 adds support for conditional compilation.

From Wikipedia:
In computer programming, conditional compilation is compilation implementing methods which allow the compiler to...
 
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...
 

NFC - Reading and Writing

NFC v2.00 adds support for low level access to the NFC features. This allows reading and writing from NFC tags.

The NFC library provides three features:
- Reading Ndef tags based intent filters...
 

Attachments

  • Project.zip
    15.4 KB · Views: 744
Last edited:

Custom View with Designer Support

Last edited:

Voice Recognition Example

A large button is displayed. When the user presses on the button, the user is asked to say something.
The voice recognition engine converts the audio to text.

Then the text is converted back to...
 

Attachments

  • VoiceRecognition.zip
    5.6 KB · Views: 5,443

OAuth 2.0 / Google web services tutorial

This tutorial is no longer relevant. Google doesn't allow using WebView to access the server response. Updated tutorial...
 

Attachments

  • GmailContacts.zip
    8.1 KB · Views: 905
Last edited:

ScrollView example with a Panel higher than the screen

Attached you find an example with a ScrollView with a Panel higher than the screen.

The layouts are designed in the Designer, not in the code.

There are 2 layout files:
- Main with the...
 

Attachments

  • ScrollViewBigPanel1.jpg
    ScrollViewBigPanel1.jpg
    18.3 KB · Views: 22,879
  • ScrollViewBigPanel2.jpg
    ScrollViewBigPanel2.jpg
    28.6 KB · Views: 21,956
  • ScrollViewBigPanel.zip
    8.8 KB · Views: 1,154
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...
 

[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:

Downloading files using Service module

It is recommended to use HttpUtils2 instead of this code module. HttpUtils2 is more powerful and is easier to work with.

As discussed in the Services tutorial, some tasks are...
 

Attachments

  • DownloadService.zip
    6.9 KB · Views: 6,489

Add shortcuts to your Android application

Attachments

  • Shortcut.zip
    9.5 KB · Views: 1,928
Last edited:

Simple Push Framework

Attachments

  • PushDevice.zip
    8.6 KB · Views: 3,110
  • PushDesktop.zip
    6.3 KB · Views: 2,807
Last edited:
Top