Tutorials & Examples

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

DoEvents deprecated and async dialogs (msgbox)

Starting from B4A v7.0 the following warning will appear for DoEvents calls:
DoEvents is deprecated. It can lead to stability issues. Use Sleep(0) instead (if really needed).

The purpose of...
 
Last edited:

Meld: Nice tool for diffing files and directories

This isn't really a tutorial but rather a recommendation for a diff tool. Sometimes you need to compare files, or even directories, and doing it manually is just too painful and difficult. I've...
 
Last edited:

Update your app to take advantage of the larger aspect ratio on new Android flagship devices

To deliver more engaging viewing experiences to their users, many Android OEMs are experimenting with new, super widescreen smartphones. Samsung has just announced a new flagship device, the...
 
Last edited:

XML Parsing with the XmlSax library

Attachments

  • XmlSax.zip
    10 KB · Views: 6,466
Last edited:

[B4X] Tips for B4X developers

After making more than 58k posts in the forum, I decided that it is a good time to build a list of tips and common mistakes. 12 points, in no particular order:

  1. Separate code from...
 
Last edited:

OpenCVforB4A: basic image manipulation: OCVMats,OCVCore and OCVImgProc

(This is the first of a small series of code-based tutorials that I will post regarding OpenCV for B4A. I will try to focus mainly on how to use OpenCV in B4A, tips, best practices...
 

Attachments

  • imageManipulations.zip
    268.8 KB · Views: 1,561

How to send/receive Data SMS

Last edited:

The effect of pressing a button

While I'm new. I can not find a full and detailed example. How to make a beautiful effect for button when I click button. I like using a gradient fill please. I did not use in my work designer...
 
Last edited:

Manifest Editor

Basic4android v1.8 introduces a new tool named Manifest Editor.
Every Android application includes a file named AndroidManifest.xml.
This is an XML file that describes the application for the OS...
 
Last edited:

HttpUtils2 - Web services are now even simpler

Attachments

  • FlickrViewer.zip
    10.7 KB · Views: 9,405
  • HttpUtils2.zip
    8.5 KB · Views: 11,783
Last edited:

Wrapping a small and easy 3rd party library with java

Attachments

  • 1.Original.zip
    179.4 KB · Views: 1,085
  • 2.Find the main source folder.zip
    3.4 KB · Views: 1,000
  • 3. use Rgenerator.zip
    3.1 KB · Views: 1,018
  • 4.Cleanup.zip
    2.9 KB · Views: 948
  • 5.Start of a new Eclipse-project.zip
    13.4 KB · Views: 937
  • 6.Working in Eclipse.zip
    91.7 KB · Views: 988
  • 7.New Wrapper.zip
    20.1 KB · Views: 1,016
  • 9.Resulting Library.zip
    5.2 KB · Views: 936
  • 10.Example CircularButtonEx.zip
    12.1 KB · Views: 952

Tutorial - Online Scoreboard

I noticed this being asked a few times so I thought I'd share the version I've created.

This implementation requires that you have a server with PHP and MySQL. I am by no means a PHP or MySQL...
 
Last edited:

Uncaught Exceptions

By default, when there is an uncaught exception the program will show a message box with the error title and the user will be asked whether they want to continue or not.

There are several...
 

Attachments

  • SendEmailWithCrashLogs.zip
    7.8 KB · Views: 2,154
Last edited:

Accessing third party Jar with #Additionaljar and JavaObject - Picasso

The #AdditionalJar module attribute (introduced in B4A v3.80) allows us to reference external jars.
With the help of JavaObject it is now possible to integrate third party jars without a wrapper...
 

Developing library with Android Studio

I have moved all my projects from Eclipse to Android Studio, so decided to write how I have done for generating JAR and XML file for Basic4Android.

1. Create new project - File>New Project or if...
 
Last edited:

Two activities example

An improved version, based on CallSubDelayed is available here.
This example demonstrates how to work with more than one activity and how to pass information between the activities.
In...
 

Attachments

  • TwoActivities.zip
    6.7 KB · Views: 6,295

Orientation and accelerometer

The attached program displays the values of the different sensors:

sensors.png


It creates a PhoneSensors object for each type of sensor.
As you can...
 

Attachments

  • SensorsExample.zip
    7.5 KB · Views: 2,089
Last edited:

MediaPlayer tutorial

Attachments

  • MediaPlayer.zip
    9.5 KB · Views: 7,199

Custom View with Designer Support

Last edited:

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: 1,159
Last edited:
Top