Tutorials & Examples

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

User's Guide

Last edited:

For beginners: Playing with views (dynamic)

This simple example shows how to add & access views (buttont, labels, imageviews, scrollviews) to get a nice & good looking layout.

I don't use dip (except at one code line) to have a "fixed &...
 

Attachments

  • PlayWithViews.zip
    71.8 KB · Views: 814

Filter the Contents of a ListaVieW By Sql code

This example shows how to filter the contents of a database and load the results in a listview using an edittext. for each letter entered in edittext the results are shown in the listview. It...
 
Last edited:

ImageDownloader - The simple way to download images

Attachments

  • ImageDownloader.zip
    8.1 KB · Views: 7,356
Last edited:

Basic difference between a Standard ListView and Amir_RecyclerView

During the introduction to Amir_RecyclerView (ARV), it was necessary to understand the basic relationships between data and display.

ListView is a view group that displays a list...
 

Attachments

  • Events_AmirRecyclerView.jpg
    Events_AmirRecyclerView.jpg
    107.7 KB · Views: 628
Last edited:

[B4X] ”The ultimate guide to proper use of animation in UX”

I happened to come across a very well written, and absolutely beautifully illustrated, article on how to best use animation in UX. I thought the forum might appreciate it, so here’s the link...
 

Change DataSet in Amir_RecyclerView

During the basic training in Amir_RecyclerView (ARV), a small test project was created, which may help RV newcomers to familiarize themselves with RecyclerViews.

Topic: "React to...
 

Attachments

  • ARV_Testproject_SimpleRv.zip
    10.2 KB · Views: 468
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: 23,075
  • ScrollViewBigPanel2.jpg
    ScrollViewBigPanel2.jpg
    28.6 KB · Views: 22,146
  • ScrollViewBigPanel.zip
    8.8 KB · Views: 1,348
Last edited:

Starter Service - Consistent & Single Entry Point

One of the challenges that developers of any non-small Android app need to deal with, is the multiple possible entry points.

During development in almost all cases the application will start from...
 
Last edited:

FCM message workflow explained by Google

Solving "Font asset not found" from library

I developed a class (compiled in library) that makes use of Typeface.MATERIALICONS, but when I tried using it there was this error:

HTML:
java.lang.RuntimeException: Font asset not found...
 

[B4X] Sending emails with Gmail REST API

This solution is compatible with B4A, B4J and B4i.

Up until now there were two ways to send emails:

1. Using the default mobile app which required the user to actually send the message...
 

Attachments

  • Gmail.zip
    59.7 KB · Views: 3,085

Device Owner / TaskLock / Kiosk apps 2017

SS-2017-07-18_13.19.46.png


Starting from Android 5 (API 21) there is better support for kiosk applications.
Kiosk applications = applications that...
 

Attachments

  • Kiosk.zip
    8.6 KB · Views: 2,570

User registration using httputils2, php, MySql and mail

When you join a forum you have to define a username and type in your email address and a password. After that you receive an email to finish the registration. Today I want to show the process how...
 
Last edited:

Signature Capturing with jSignature and WebViewExtras

Hi everyone:

After several test, now I can use the jSignature javascript plugin I was using in my web, in my B4A app, in order to update my database from b4a the same way I'm doing in my web. I...
 

Attachments

  • jsignature b4a.png
    jsignature b4a.png
    210.9 KB · Views: 984
  • jsignaturesample.zip
    57 KB · Views: 691

GitLab: Syntax highlighting for B4X files

When using an online repository such as GitLab, you can add a file named ".gitattributes" with the following content:

B4X:
*.bas gitlab-language=vb
*.b4j gitlab-language=vb
*.b4a gitlab-language=vb...
 
Last edited:

A trick for a badly closed application from a KILL TASK

I found it hard to find a solution to a problem that I think someone else could have
if you leave a service running with:

B4X:
#StartCommandReturnValue: android.app.Service.START_STICKY
or
B4X:
...
 

Dialogs library 2017 - Custom dialogs and async methods

Dialogs v4 is an extension to @agraham original dialogs library. It requires B4A v7+.

SS-2017-06-01_16.00.52.png


The main changes are...
 

Attachments

  • DialogsExample.zip
    9.8 KB · Views: 4,347
Last edited:

Read Key/Token from the B4A Manifest

I was busy with a project and wanted to allow users to enter their own Key/Token via the B4A manifest file and then have access to the key/token via B4A code. I did a quick search and could not...
 

Attachments

  • b4aReadManifestKey.zip
    9.6 KB · Views: 469

Getting Started With a Homescreen Launcher

Hey guys!

This forum and Basic4Android has helped my career prospects greatly, so I thought I'd try and do something useful...

As some of you know, I've been working on an Android Launcher or...
 
Top