Tutorials & Examples

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

Developing library with Android Studio

I have moved all my projects from Eclipse to Android Studio, so decided to write how I have done for generating JAR and XML file for Basic4Android.

1. Create new project - File>New Project or if...
 
Last edited:

Highlight selection in a standard ListView

I found some code on the internet that works with a standard ListView, an example is attached. I use ListView's all the time with large lists >3000 items and I will find this one useful.

It uses...
 

Attachments

  • ListSelectColor.zip
    7.1 KB · Views: 1,721

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

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,617
Last edited:

MediaPlayer tutorial

Attachments

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

Custom View with Designer Support

Last edited:

OAuth 2.0 / Google web services tutorial

This tutorial is no longer relevant. Google doesn't allow using WebView to access the server response. Updated tutorial...
 

Attachments

  • GmailContacts.zip
    8.1 KB · Views: 905
Last edited:

MultiDex - Solves the too many methods error

B4A v6.8 adds support for MultiDex compilation.

Enabling MultiDex:
B4X:
'main module
#MultiDex: True

With MultiDex enabled, the compiled classes are split into multiple dex files as needed...
 
Last edited:

Video for b4a

Hi sir and maam :) I have a problem about our program. We need to put a video clips on it. Is there a tutorial or codes that can use to put a video on B4A Project? Thanks in advance :)
 

Theme based on version Tutorial

What is this?
As the title suggests, this tutorial shows you how to select an android theme based on what version of Android your app is run on.

Why do I need this?
You don't, but...
 
Last edited:

Create better Play Store listings

Slowly but surely, the official app stores of iTunes, Google Play, and Windows Phone Marketplace have transformed into a digital battlefield. App developers have to fight for recognition or...
 

Conditional Compilation & Build Configurations

B4A v3.80 adds support for conditional compilation.

From Wikipedia:
In computer programming, conditional compilation is compilation implementing methods which allow the compiler to...
 
Last edited:

A THANK YOU.. example in humility

:)

I just wanted to say thank you. I am new to coding:D, and trying to learn it. There is a lot of useful information if you search and dig for it.. no pain no gain LOL

Also some cool guys I...
 

receive/send SMS while my phone is off

Hi experts,

This looks silly question but is it possible that I can receive/send a SMS while my phone is off using a program on a computer? And if it is possible what program or how to create a...
 

How I wrapped a HTML5, JavaScript & Css based Library...

Hi there..

Eye Candy

To be able to do this, you need a good library that you want to wrap. A library like this will run inside a webview as its purely javascript, so some knowledge of...
 

Attachments

  • JarFileLoader.bas
    2.3 KB · Views: 607
Last edited:

Remote Database Connector (RDC) - Connect to any remote DB

Last edited:

B4A Book Updated to Version 6.50

Android SlidingPanels - Simple way to create sliding layouts

This is an old tutorial. There are now simpler and better ways to achieve this effect.

For example...
 

Attachments

  • SlidingPanels.zip
    6.9 KB · Views: 9,845
Last edited:

GameView - Create 2D Android games - Part II

Attachments

  • Asteroids.zip
    253.3 KB · Views: 4,032
Last edited:

Google Place

This is a simple tutorial on how to search a place using Google Place API and with you keyword.
Hope this can help for those who are confused... Like ME :):):)

First you need an API Key(Browser...
 

Attachments

  • Tut.Google.Places.zip
    7.9 KB · Views: 683
Top