Tutorials & Examples

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

The result of swiping an app from the recent apps list

One of the new features of Android 4 is the more powerful recent apps list. The user can remove tasks or applications from the list with a swipe gesture.

The result of this action is not fully...
 
Last edited:

Database Design - Introduction

This tutorial describes the steps I took to design the database for the Pre-Algebra Tester app available on Google Play.

This is Part 1 of a potential series that will describe how I...
 

Attachments

  • test_type_A.PNG
    test_type_A.PNG
    4.3 KB · Views: 381
  • test_type_B.PNG
    test_type_B.PNG
    1.3 KB · Views: 367
  • test_A.PNG
    test_A.PNG
    10 KB · Views: 349
  • test_B.PNG
    test_B.PNG
    4.9 KB · Views: 366
  • test_question_A.PNG
    test_question_A.PNG
    5.7 KB · Views: 339
  • test_question_B.PNG
    test_question_B.PNG
    11.6 KB · Views: 334
  • question_A.PNG
    question_A.PNG
    4.1 KB · Views: 377
  • question_B.PNG
    question_B.PNG
    13.1 KB · Views: 337
  • test_result_A.PNG
    test_result_A.PNG
    5.9 KB · Views: 330
  • test_result_B.PNG
    test_result_B.PNG
    2.1 KB · Views: 312
Last edited:

Example of an app with a phone and tablet layouts

This example demonstrates how you can create an app that looks and behaves differently depending whether it runs on a phone or a tablet.

The app layout is simple.
The main screen includes three...
 

Attachments

  • PhoneTabletLayout.zip
    13.1 KB · Views: 3,535

OUYA-specific tweaks

Your apps will run on OUYA just fine, normally.

It has no sensors. This includes microphone (so no voice recognition), gyroscope, compass, accelerometers, orientation, light. It has nada. It...
 

GameView - Create 2D Android games - Part I

Attachments

  • GameViewSmiley.zip
    9.4 KB · Views: 5,179
Last edited:

Short tip for working with voice commands

Forward Word

So, while I'm building my first app, suddenly I came over this example from Erel. Great for my app but, as you may know, even though 75% of the worlds...
 

Attachments

  • muchWow.txt
    326.9 KB · Views: 475

Hangman Tutorial (part 3)

Alright, here is part 3 of the Hangman Tutorial.

In part 2, we added the ability to import our words from an external text file by using File.ReadList to generate a List (which we stored in...
 

Hangman Tutorial (part 2)

Attachments

  • words.txt
    5.4 KB · Views: 458

Don't forget JonPMs live chat for instant help!

Very kind of JonPM to provide us with this, there are nearly always helpful people on this live chat who can help you with your problems instantly!

B4A Chat
 

Static Code Modules

Basic4android v1.2 includes a new type of module which is the static code module.
Adding a static code module is done by choosing Project - Add New Module - Code Module.

Unlike Activities and...
 

Add a Change log as well as Build number to projects

A few weeks ago I posted a thread on a build number implementation for your project in this thread...
 

[Newbie sample] Simple Timer Up & Down, Counter Up & Down.

This is only a simple example for newbie to learn Wheel algorithm.
For fully blown of wheels, see ClsWheel v 1.4 by Klaus.
There is no intention to make it an advance Stopwatch & Timer!
Advance...
 

Attachments

  • TimerCounter.png
    TimerCounter.png
    27.5 KB · Views: 1,037
  • TimerCounter.zip
    49.9 KB · Views: 1,034
  • TimerCounterTD.zip
    50.1 KB · Views: 939
Last edited:

On Intents opening files

Just thought I would post a few things I have learned about intents. Using them does not seem to be particularly intuitive and information is sparse. Here is a link to a thread someone started for...
 
Last edited:

List of known android "Intents" to do stuff

I saw and example here and there for intents, but I noticed it takes a bit of guesswork to figure out what strings to pass sometimes so i'm starting a list of known intents. If you know any...
 

Take pictures with the internal camera

It is recommend to use the new CameraEx class. It provides more functionality.
The new Camera library allows you to take pictures using the back facing camera.

The following steps are...
 

Attachments

  • CameraExample.zip
    5.7 KB · Views: 10,140

Collection of tutorials in PDF format

Edit: This resource is no longer available. Better resources are available here: https://www.b4x.com/etp.html

You can now download a PDF file that contains most of the tutorials. The...
 
Last edited:

Creating a build number for your project's compilation

It has been discussed in other places on wish lists etc that each time we compile our projects under B4A that it would nice to have a BUILD number increment by 1.

Using the CustomBuildAction...
 
Last edited:

Twitter feed reader

This example no longer works as it is based on an old Twitter API.
An updated example is available here...
 

Attachments

  • TwitterDemo.zip
    40.5 KB · Views: 3,830
  • Twitter.apk
    122.9 KB · Views: 1,180

Barebones View Examples with SQLite

I went through a (long) learning curve with regard to using SQLite, and creating Webview, Listview and Scrollview lists. There are a lot of great examples on this forum, but I found it difficult...
 

Attachments

  • DataBase_Barebones_examples.zip
    47.8 KB · Views: 1,410

Holy moley, take the work OUT of creating icons for your app!

Top