Tutorials & Examples

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

B4LinuxInstall script to use B4X tools in linux

Last edited:

2-Step verification - Sending email through Gmail

This isn't what I would call an actual tutorial, it's more like a very useful tip.

PLEASE NOTE: I'm not claiming that this is the only way to fix the issue, or even the correct way. But...
 
Last edited:

Android multitouch tutorial

Using Agraham's Gestures library we can handle multitouch events.

This is an example of a simple drawing application that supports multitouch...
 

Attachments

  • MultitouchExample.zip
    7.3 KB · Views: 1,158
Last edited:

QR Code - Reverse Engineering a QR Code

pic1.png


I am leaving this project here for now. The majority of the work has been done to extract the critical information of a QR code - it is reported in the text box to the right of the qr...
 

Attachments

  • JHSQRCODEREADV4.zip
    19.7 KB · Views: 1,101
  • qrcodev21ehm6.zip
    443.9 KB · Views: 1,132
  • qrcodev4elm5.zip
    206 KB · Views: 1,063
Last edited:

Update a homescreen widget more frequently than 30 minutes

Normally a homescreen widget can only update itself every 30 minutes. A lower value is not possible in the ConfigureHomeWidget() call.

But what if you want to create something like a clock which...
 

Attachments

  • AHClock.zip
    5.7 KB · Views: 1,874
Last edited:

Google Play: "Designed for tablet screens"

A change is coming up on November 21 on Google Play. The applications considered by Google as not designed for tablets will be marked as designed for phones and, by default, won't appear for...
 

5 Card Poker Scoring

Hi all.

Here is a BAS module to do 5 card poker scoring. Its some ugly code but it works.

I have promised myself I was going to re-write this code for over a year but cannot seem to find the...
 

Attachments

  • cards.zip
    37.4 KB · Views: 913
  • poker scoring v0.91.zip
    10.2 KB · Views: 632
  • poker scoring v0.92.zip
    10.2 KB · Views: 725
Last edited:

Uploading Photo to Facebook

Uploading Photo to Facebook is possible now with B4a and a webview



This is based on Steve05 post here...
 

Attachments

  • Android2Facebook.zip
    115.4 KB · Views: 1,699
Last edited:

Information about Smart Gear components

Hello Everybody,

In a new device SMART GEAR Live have a limitation with SDK, is not allowed put WEBVIEWs in a project.

In a B4A is accepted the WebView BUT in REAL not work...
 

Attachments

  • ErrorSmartGear.jpg
    ErrorSmartGear.jpg
    20.9 KB · Views: 448

GIF Movie Player

The attached project is an example using the XtraViews library.

If one of the classes in that library is called "MovieView" then let's play some animated GIF movies. :D


Have fun...
 

Attachments

  • GifMoviePlayer_Sample.zip
    59 KB · Views: 1,757
Last edited:

SQL Order + Where

What am I doing wrong

B4X:
oRst = SQL.ExecQuery2("SELECT * FROM Bustrip ORDER BY sort Asc WHERE bus = ?", Array As String (Main.find))
 

Custom transitions between activities

This short tutorial will explain how to create custom transitions between activities.

The transitions must be declared in an XML file as described here: Animation Resources | Android...
 

Attachments

  • FlickrViewer_WithActivityAnimation.zip
    11.1 KB · Views: 3,823

When to use activities and why.

Why use Activities?

In B4A as in Android, an activity is like a form in other languages such as Delphi, C++ Builder, VB, etc. Activities can start other activities, use code modules, classes, and...
 

Listview

An example of using Listview.
Open and save dialogs.
Screen orientation.
Don't forget to twist.

Done on 7 inch tablet.
B4A 2.3
 

Attachments

  • List2.apk
    130.8 KB · Views: 429
  • List2.zip
    14.9 KB · Views: 567
  • unicode.zip
    3.1 KB · Views: 433
  • beer.zip
    2.1 KB · Views: 479

How to make a simple splash scree (that you can understand)

This is tutorial of how to make a splash screen in B4A. There are 3 sections. Just copy and past the code. In the designer save the layout as "LayoutMain.bal" and make a "Panel1" in that layout...
 

Connecting to HTTPS (secured) urls

Last edited:

GIF FILE - 3 x ROTATING EARTH

pic1.png


An example of the rotating earth with 3 x image views displaying the same GIF file but each separated by 120 degrees from the other. You will need to download the GIF file from here...
 

Attachments

  • EARTH ROTATING.zip
    8 KB · Views: 951
Last edited:

ImageView

This program displays pics of the same size as the ImageView. Made on an 7 inch tablet.
Program is not ready to go. Need to create folder and place same size pics in folder.
My device info is...
 

Attachments

  • Pic4.zip
    6.7 KB · Views: 565

Clock - 24hr analogue clock

pic1.png


This was done just for fun. It is a 24 hour analogue clock/watch. Have used the GPS Example from @klaus as base for this clock.
JHS CLOCK V1 => a 24 hour clock running clockwise...
 

Attachments

  • JHS CLOCK V1.zip
    173.4 KB · Views: 1,082
  • JHS Clock Panels.zip
    19.6 KB · Views: 857
  • JHS CLOCK TIME TRAVEL.zip
    174.6 KB · Views: 849
Last edited:

Service and Sockets for beginners

I've made a very simple project which periodically connects to a VB6 Server.
The code is well commented with notes for programmers coming from VB6.

In this code I use once ExitApplication. It's...
 

Attachments

  • SocketService_3.zip
    29.7 KB · Views: 933
Last edited:
Top