Tutorials & Examples

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

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:

Inline JavaCV/OpenCV

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

B4Acalendar

Probably not the most elegant way to do this calendar but it is working. It displays 42 days and will "grey out" the days of the previous/next month within the calendar month being displayed. The...
 

Attachments

  • B4Acalendar.zip
    31.4 KB · Views: 670
Last edited:

B4J App for Firebase Notificatiion Sending

if you have android app with firebase notf.
this app for easy testing.
 

Attachments

  • FIREBASE_NOTFICATION_SENDER.zip
    26.9 KB · Views: 439
Last edited:

ImageView - Circular, Hexagonal, Triangular, Bubble, Star Imageviews (with inline Java code)

See attached project with inline Java code to create round imageviews. You only need library JavaObject V2.01 to be enabled.
 

Attachments

  • RoundBitmap.zip
    57.1 KB · Views: 2,422
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:

Highlight selection in a standard ListView

I found some code on the internet that works with a standard ListView, an example is attached. I use ListView's all the time with large lists >3000 items and I will find this one useful.

It uses...
 

Attachments

  • ListSelectColor.zip
    7.1 KB · Views: 1,840

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,099

Orientation and accelerometer

The attached program displays the values of the different sensors:



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

Attachments

  • SensorsExample.zip
    7.5 KB · Views: 1,839
Last edited:

MediaPlayer tutorial

Attachments

  • MediaPlayer.zip
    9.5 KB · Views: 6,995

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

MultiDex - Solves the too many methods error

B4A v6.8 adds support for MultiDex compilation.

Enabling MultiDex:
B4X:
'main module
#MultiDex: True

With MultiDex enabled, the compiled classes are split into multiple dex files as needed...
 
Last edited:

Video for b4a

Hi sir and maam I have a problem about our program. We need to put a video clips on it. Is there a tutorial or codes that can use to put a video on B4A Project? Thanks in advance
 

Theme based on version Tutorial

What is this?
As the title suggests, this tutorial shows you how to select an android theme based on what version of Android your app is run on.

Why do I need this?
You don't, but...
 
Last edited:

Create better Play Store listings

Slowly but surely, the official app stores of iTunes, Google Play, and Windows Phone Marketplace have transformed into a digital battlefield. App developers have to fight for recognition or...
 

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:

A THANK YOU.. example in humility



I just wanted to say thank you. I am new to coding, and trying to learn it. There is a lot of useful information if you search and dig for it.. no pain no gain LOL

Also some cool guys I...
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…