Tutorials & Examples

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

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: 348
  • List2.zip
    14.9 KB · Views: 490
  • unicode.zip
    3.1 KB · Views: 365
  • beer.zip
    2.1 KB · Views: 410

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



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: 872
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: 493

Clock - 24hr analogue clock



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: 992
  • JHS Clock Panels.zip
    19.6 KB · Views: 753
  • JHS CLOCK TIME TRAVEL.zip
    174.6 KB · Views: 765
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: 837
Last edited:

Random Numbers, Timer, ExitApplication

Random Numbers.
Timer.
ExitApplication.
 

Attachments

  • RandomNumbers.zip
    7 KB · Views: 835

Service Module Example

Service Module using CallSub.

A very simple example. I thought you had to use CallSub from an Activity, but had it backwards.
 

Attachments

  • ServiceModule3.zip
    7.2 KB · Views: 809

Translucent Status bar / Navigation keys

NOTE: there may be a way to achieve this already in B4A that I'm not aware of.

This little tutorial will show you how to create an app with translucent status bar And/Or navigation keys...
 

Save all Edittexts & corresponding labels on a view to a file (JSON) and reload them

If you build an app which uses a larger form you might have realized this by pairs of labels and edittexts. The label ist used for the description (f.e. "Name") and the edittext will contain the...
 

Tinyurl shortening

Here's a quick little example of how to shorten your urls using tinyurl.com.

Thanks to TDS, who provided the solution.
 

Attachments

  • TinyUrlSample.zip
    7.7 KB · Views: 372
Last edited:

How to get track change data

ie: If you want to make a music control widget

First you need to add a broadcast listener to the manifest

AddReceiverText(thenameofyourservice,
<intent-filter>
<action...
 

Otsu Thresholding - binarization of images

This project demonstrates grayscaling of a multi colored image and then the binarization (i.e black or white pixels only) of the grayscaled image. The binarization is based on Otsu Thresholding as...
 

Attachments

  • JHS_OTSU_V2.zip
    61.2 KB · Views: 966
Last edited:

Image - Dithering 8 bit Grayscale images

This project demonstrates dithering of 8 bit grayscale images as explained at www.fiji.sc/Dithering. Methods included are the following:

Floyd-Steinberg
Atkinson
Jarvis-Judice-Ninke
Stucki...
 

Attachments

  • JHS_DITHERING_V4.zip
    41.5 KB · Views: 757
Last edited:

Image - 17 different ways of Converting RGB Images to Grayscale

This project demonstrates the conversion of RGB images to various options of Grayscale images. It is based on the tutorial at http://www.tannerhelland.com/3643/

Click on any one of the...
 

Attachments

  • JHSGRAYSCALE_V2.zip
    455.9 KB · Views: 1,246
Last edited:

Image - Enhancing Image Contrast by means of Histogram Equalization and Histogram Stretching



This project demonstrates contrast enhancement of low contrast Grayscale images based on Histogram Equalization as explained at...
 

Attachments

  • JHS_HIST_EQUAL_V2.zip
    482.8 KB · Views: 1,072
  • JHS_HIST_STRETCH.zip
    482.6 KB · Views: 950
Last edited:

App to log GPS information, display map and send by eMail

Hello,
This app is a sample to get GPS info, save into file, load list of tracks, show in map,
assign a photo and send map and log info in CSV format by email.
Also there is some code about saving...
 

Attachments

  • GPSlogSample .zip
    249 KB · Views: 1,865

Lets play with vertical lables!

We'll do this using the Canvas object.

I'm just learning but pretending that I can teach it

Download the provided CanvasTest.zip and open it.

What I've done here is to create a panel and...
 

Attachments

  • CanvasTest.zip
    7.5 KB · Views: 590

Samsung Galaxy Nexus layout

I have a new toy

The attached AbstractLayout.txt file includes the layouts of the Samsung Galaxy Nexus, the first Android 4.0 device.
You should copy it to Basic4android installation folder...
 

Attachments

  • AbstractLayouts.txt
    773 bytes · Views: 840
Cookies are required to use this site. You must accept them to continue using the site. Learn more…