Tutorials & Examples

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

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

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,971

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...
 

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:

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...
 

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...
 

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

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: 1,067

Drawing a selection window

The following code draws a "selection" window when you move the finger:
B4X:
Sub Globals
    Dim Canvas1 As Canvas
    Dim Rect1 As Rect
    Dim sx, sy As Int
End Sub

Sub Activity_Create(FirstTime...
 

Getting the Contrast Color (for a label, etc)

There are situations where we change the panel colors, like when the user select its own color, and we dont know if the text of the labels will be seen. Commonly we define black or white for text...
 
Last edited:

PC-ANSI encoding on B4A ...

Hi,

normaly B4A use UTF8 encoding, but can create files in ANSI too, but be carefull !
Windows an a Western PC use ANSI codepage 1252, this is in B4A "WINDOWS-1252".
Mostly the encoding...
 

QR Code - how to construct a generator polynomial

The attached project will generate the Reed Solomon generator polynomials for 7, 10, 13, 15, 16, 17, 18, 20, 22, 24, 26, 28, and 30 error correction words that might be required for QR codes as...
 

Attachments

  • ReedSolomonGeneratorPolynomialV1.zip
    163.9 KB · Views: 989
  • ReedSolomonGeneratorPolynomialV2.zip
    8.6 KB · Views: 876
Last edited:

Tick Tock Test Timers Class

Works fine but the timer keeps cutting off in my rather big and complex app.... oh well I'll have to figure that out then.

Still perhaps useful to some.

You send it a number of milliseconds like...
 

Attachments

  • TickTockTest.zip
    8.3 KB · Views: 929
Last edited:

B4a projects source code.

Hi everyone,

For the last 10 hours, I browsed every threads in "Share your creations" because I wanted to gather a lot of source code. About 1/6 of the posts actually have source code shared...
 
Last edited:

LayoutView: The alternative way to load and use your layouts

Introduction

Following the moto design-more-code-less in our encapsulated b4a development speed-wagon, I created a LayoutView class that is also the core of the...
 
Last edited:

Hello world - Installing Android Emulator

XtraViews: DialogView Tutorial (quick and dirty)

[Arguably] Better Ninepatch

Hi guys. I write here hoping to help a few people.

Recently I started a project that makes heavy use of user personalization. I had bad experiences with nine patches in the past, even though I...
 
Top