Tutorials & Examples

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

Orientation and accelerometer

The attached program displays the values of the different sensors:

sensors.png


It creates a PhoneSensors object for each type of sensor.
As you can...
 

Attachments

  • SensorsExample.zip
    7.5 KB · Views: 1,616
Last edited:

Flickr Viewer

Attachments

  • FlickrViewer.zip
    7.2 KB · Views: 1,753

ScrollView example

The ScrollView is a very useful container which allows you to show many other views on a small screen.
The ScrollView holds an inner panel view which actually contains the other views.
The user...
 

Two activities example

An improved version, based on CallSubDelayed is available here.
This example demonstrates how to work with more than one activity and how to pass information between the activities.
In...
 

Attachments

  • TwoActivities.zip
    6.7 KB · Views: 5,952

GPS tutorial

This example shows how to work with the GPS library.

upload_2016-6-23_9-56-49.png


The GPS object is declared in the Starter service. It is easier to put the GPS in a service and not in an Activity as the...
 

Attachments

  • GPS.zip
    8.1 KB · Views: 6,819
Last edited:

MediaPlayer tutorial

Attachments

  • MediaPlayer.zip
    9.5 KB · Views: 6,813

StateListDrawable example

StateListDrawable is a drawable objects that holds other drawables. Based on the view's current state a child drawable is selected.
StateListDrawable holds a list of states. States can be...
 

Getting help for Object and methods

The IDE Intellisense is wonderful for actually writing code but for browsing the available objects to see what is on offer it is a bit tedious so this afternoon I have knocked up this pretty awful...
 

Attachments

  • B4AHelp1.7.zip
    55.6 KB · Views: 448
Last edited:

ListView tutorial

Don't use ListView.
Use xCustomListView - it is more powerful, easier to work with and cross platform.
 
Last edited:

http Form POST

HI,
due i've needed it...here you are:
B4X:
      Dim url As String
      Dim myHttpRequest As HttpRequest
      url = "https://yourURLhere.html"
      Dim str() As Byte
      Dim form As...
 

Currency Converter - Http web services and more

Attachments

  • CurrencyConverter.zip
    9.8 KB · Views: 2,973

Logcat viewing

The Basic4Android IDE contains a mysterious tab entitled "Logcat" in the right hand pane.

This archive contains a help file that will tell you what a Logcat is and also contains a more...
 

Attachments

  • B4ALogViewer1.2.zip
    16.3 KB · Views: 878

Android Process and activities life cycle

New video tutorial:



Lets start simple:
Each B4A program runs in its own process.
A process has one main thread which is also named the UI thread which lives as long as the...
 
Last edited:

Connecting your device to the IDE

Introduction

A program called adb.exe - Android Debug Bridge - is the key component that is used to communicate between programs on your desktop and the emulator or device. adb can be...
 
Last edited:

Guess my number - Visual designer & Events

Hello world - Installing Android Emulator

Installing Basic4android and Android SDK

Last edited:
Top