Tutorials & Examples

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

Colors Game (Simple game source)

Hi all.
i made this game some time ago, its simple, i never used, i found today on my old sources folder and i m here to share with all.

The labels are in portuguese, but is very easy to...
 

Attachments

  • colorsgame.zip
    365.5 KB · Views: 713

7 Segment LED Digital Clock

Attached project simulates a 7 segment LED digital clock. No libs other than the B4A core lib are required.
You can also try this analog clock here

DigitalClock.png
 

Attachments

  • DigitalClock.zip
    58.2 KB · Views: 1,628
Last edited:

Glitching screen - B4A Library source code

I was browsing the forums and came across THIS post, and that gave me an idea for a little funny class/library.

The code attached demonstrates how to use B4A to create libraries using code...
 

Attachments

  • Glitch_Source_Code.zip
    152 KB · Views: 441
Last edited:

[B4X] Backward Compatibility

Backward compatibility = the ability to open projects developed with older version of the IDE in a newer version of the IDE.

Backward compatibility is a critical feature for programming languages...
 
Last edited:

Take a Screenshot with Inline Java Code

I have tested this on an Android 7.0 device only - take a screenshot of your activity. You need to enable the JavaObject library to make use of it.

@JordiCP solved my initial problem here...
 

Attachments

  • b4aTakeScreenshot.zip
    16.3 KB · Views: 921

Producing unsigned apk and sign it with eclipse/adt keystore

Ok, this is my first tutorial so please be kind about my errors :D


Here is problem : You have an app made without B4A. You wantto remake it but you need to sign it with your old...
 

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

Compass: TRUE HEADING & Magnetic Declination.

I am presenting a test project - Compass. Post #1
- displays TRUE HEADING with local magnetic declination.

Tested in parallel with the application AndroiTS GPS Test v.1.48 Free...
 

Attachments

  • Screenshot_2017-11-TrueHeading.png
    Screenshot_2017-11-TrueHeading.png
    60.4 KB · Views: 750
  • TRUE HEADING.zip
    276.2 KB · Views: 675
Last edited:

Text files

Many applications require access to a persistent storage. The two most common storage types are files and databases.
We will cover text files in this tutorial.

The predefined Files object has...
 

Downloading and Printing 1 Bit BMP to ESC/POS Printer

Using the feature of resident images of Datecs dpp250. This is the way I found with Erel help to convert a 1 Bit BMP to ESC format, download to the printer, clean printer memory, write printer...
 

Attachments

  • ESCPOSGraphic.zip
    337.2 KB · Views: 1,395

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

Shaders in libGDX

In this tutorial, I'm going to modify the Perf_Flakes demo of the libGDX library to explain how to use shaders with your objects rendered by lgSpriteBatch. I'm NOT going to explain the basics of...
 

Attachments

  • Perf_Flakes_shader.zip
    95.9 KB · Views: 955

IPInfo - B4A Library source code

Sometimes, we need certain things to be done but there are not APIs available, so what we do? we create our own.

I always emphasize that we need to use our imagination and be resourceful, the...
 

Attachments

  • IPInfo_Lib_Source_Code.zip
    13.8 KB · Views: 556
Last edited:

CustomBottomSheet - B4A Library source code

Since I've seen a lot of downloads on my previous tutorial HERE I've decided to write another nice looking (and hopefully useful) custom view written in 100% B4A, and I also hope you guys...
 

Attachments

  • CustomBottomSheet_SourceCode.zip
    13.9 KB · Views: 1,091

GPU overdraw

Every time your app draws a pixel on the screen, it takes time. Every time your app draws an opaque pixel to replace something that has already been drawn, it wastes time. Drawing a pixel more...
 

Create wave form

You can generate waveform from peaks json file which is generated from mp3 file.
In this source waveforms has drown with canvas.
You can customize everything about waveforms display with this...
 

Attachments

  • s243_1099_sjrdzfn4.zip
    3.3 KB · Views: 349

Notify Builder example

Hi everybody,
I have a minimal code example. I use this code to ask for GPS activation. I was not able to find a working example of NotifyBuilder so I wrote for myself
So here it is!

Mauro
 

Attachments

  • notifybuilder.zip
    11.6 KB · Views: 868

ScrollView example with multiselection and SQL

Here is another ScrollView example with:
- adding a row
- moving a selected row up and down
- mono-selection, clicking on one row selects it, clicking on another row unselects the previous one and...
 

Attachments

  • ScrollViewMultiselect.zip
    9.5 KB · Views: 4,064
  • ScrollViewMultiselect1.jpg
    ScrollViewMultiselect1.jpg
    48.4 KB · Views: 20,620
  • ScrollViewMultiselect2.jpg
    ScrollViewMultiselect2.jpg
    47.9 KB · Views: 20,073

Firebase Realtimedatabase get a chat or content preview (filtering)

Hello,

a another Tutorial in the category how to program a nice chat app.
This Tutorial builds on this.

The Realtimedatabase lib. supports filtering, with this feature you can filter your...
 
Last edited:

Firebase Realtimedatabase user is typing feature

Hello,

A nice feature is to display whether a user is typing or not.
istyping.PNG

Most apps have a bubble added or by WhatsApp is a simple "wrtiting.." on top.

This is the result of this...
 
Last edited:
Top