Tutorials & Examples

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

Auto restart an Android Application after a Crash

Trial Period using FTP

Here is a method using FTP to create a trial period for your app. Since there is no local file with trial information, the user cannot defeat it by manipulating stored data. Also, FTP calls are...
 
Last edited:

[Advanced] Using a custom view written with Kotlin



Using Kotlin libraries is similar to using Java libraries. The only difference is that we need to add references to two...
 

Attachments

  • CameraVideoButton.zip
    8.3 KB · Views: 723
Last edited:

Setting custom font for whole application without any library

Hi everyone,

After a week I have finally figured it out how to add a custom font for the whole application without any library or extra code.

Here is the solution:
  1. Create a folder...
 
Last edited:

JRC2 - Home banking coordinates card (open)

Hello, excited to share my humble code, which can be used as a two-factor authentication or a secondary login. For this take as an example the use of the bank coordinates card, which allows you...
 

Attachments

  • b4aexample.zip
    13.8 KB · Views: 434
  • Server TEST.zip
    5.5 KB · Views: 403
  • card.jpg
    116 KB · Views: 463

Create PDF with b4a and php

Hallo,

from time to time someone is asking on how to create a pdf with b4a.
I dont know how to do that ONLY with b4a.

Today i spend a few hours to write a b4a-example and a php-script which...
 

Attachments

  • b4aexample_createpdf_1.1.zip
    12.7 KB · Views: 1,468
  • 20140530_082501_356253050101034.pdf
    25.3 KB · Views: 1,476
Last edited:

Native Ads Unified with MediaView

* This ads are still not available to all developers.

The code of the example are based in this code from @Erel (Thanks!)...
 

Attachments

  • nativeads_mediaview.zip
    8.4 KB · Views: 609

AdMob Mediation (with InMobi)

AdMob supports ads mediation. This means that the ad can come from different ad networks and not just from Google AdMob network.

It can improve the fill rate and the revenue earned.

...
 

[Tool] Enhance your layouts with the "Layout bounds" developer option

The creation of layouts is very easy with the B4A Designer.

With more complex forms, however, it can happen that the result looks a bit weird. Usually the heights or distances between the...
 

Android Daydream / DreamService tutorial

Android 4.2 includes a new powerful screen saver feature named Daydream.

A "dream" starts when the device is docked or charged and the screen timeouts. By default dreams are non-interactive...
 

Attachments

  • Daydream_Circles.zip
    6.7 KB · Views: 1,049
  • Daydream_Webview.zip
    6.9 KB · Views: 1,042
  • Daydream_library1.0.zip
    4.8 KB · Views: 1,033

fuel gauge

Thanks to the excellent work of Klaus and Rotating Needle exemple, I needed a gas gauge



B4X:
#Region  Project Attributes
    #ApplicationLabel: fuel gauge...
 

Attachments

  • fuel gauge.zip
    425.6 KB · Views: 754

[B4X] B4XTable - Editable table and export to CSV



This example shows how to modify the table data. When the user clicks on a cell we show an input dialog and let the user...
 

Attachments

  • B4XTable-Editable.zip
    52.1 KB · Views: 2,302
Last edited:

[B4X] Tip - Modified server response

While analyzing a Crashlytics crash report of a small app of mine I was surprised to see the following error:

Fatal Exception: java.lang.NumberFormatException
For input string...
 

B4XTable - Photos Album



In this example the table is used to show the camera roll photos.

Main steps:
1. Get permission to access the external...
 

Attachments

  • B4XTable-Album.zip
    10.7 KB · Views: 907
Last edited:

Using RSA in B4A to communicate with PHP/OpenSSL

As you might know, I do a lot of apps which communicate with my Apache servers via httputils and php. For a longer time I was missing some strong encryption. I knew that there was agrahams...
 

Attachments

  • RSAExample.zip
    9.4 KB · Views: 969
Last edited:

[B4X] [XUI] CustomListView - lazy loading / virtualization

xCustomListView v1.50 adds an important new event named VisibleRangeChanged. This event is fired whenever the visible range of items changes.

We can use this event to defer the items creation...
 
Last edited:

New B4A book: Android App Development for Electronics Designers

Similar to FloatLabeledEditText

Someone asked me to do something like FloatLabeledEditText.

I made this example. It is not identical, but it is a track or a point of partenzs for those who want to create a similar one
 

Attachments

  • LabelExtended.zip
    9.4 KB · Views: 811

Creating custom Text Selection actions with ACTION_PROCESS_TEXT

Android 6.0 Marshmallow introduced a new floating text selection toolbar, which brings the standard text selection actions, like cut, copy, and pastes, closer to the text you’ve selected...
 

Attachments

  • ACTION_PROCESS_TEXT.zip
    9.1 KB · Views: 625

Cards list with CustomListView



This example uses xCustomListView to implement a list of cards.

As the items layout is created with the designer, it is simple to implement any layout you like. You can also combine...
 

Attachments

  • CardsList.zip
    114.4 KB · Views: 4,227
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…