Tutorials & Examples

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

Edge Case use for B4XPages: Changing Orientation for Many Pages

This is for advanced users only. Please see Erel's important cautions about using this approach below.

This post and examples demonstrate how to extend B4XPages to allow orientation...
 

Attachments

  • ezgif.com-gif-maker.png
    ezgif.com-gif-maker.png
    244.4 KB · Views: 613
  • b4xpages_orientation_example.zip
    203.2 KB · Views: 501
Last edited:

EdditText Label Like SnapChat

VidSpeed1506694593792_1-iloveimg-resized.gif

Hello,

UPDATE

This version includes Multiline Support and Guaranteed functionality. The last version had a lot of bugs, that new example is more mature.


At the moment, I'm...
 
Last edited:

EasyDeviceInfo (with inline Java Code)

It incorporates this Github project via inline java code. The project reports a whole lot of information about your device and write the results to the B4A log:

B4X:
** Activity (main)...
 

Attachments

  • b4aEasyDeviceInfo.zip
    15.5 KB · Views: 986

Easy Sample Translator inside a Code

I share this little code to handle translation within the app

upload_2018-12-28_16-48-19.png


regards
 

Attachments

  • translate.zip
    8.7 KB · Views: 643
Last edited:

Dynamic creating of views "retrieved" from a database (php + MySql)

If you are lazy creating views "by hand" or you simply want a "form" depending on a MySql table take a look at this small app.

Type in the Database and Table Name and the IP-Address of the server...
 

Attachments

  • GetCol.zip
    479 bytes · Views: 1,300
  • MySqlViews.zip
    7 KB · Views: 1,437

Duck Typing and Command Design Pattern Example

I hope I have got this example right. Any positive criticism or improvements will be welcome!
I have made this to try learn and understand how this all works. This could also help others to...
 

Attachments

  • DuckTypingCommandPattern.zip
    10.2 KB · Views: 419

Dropbox SDK V2 - Uploading big files to Dropbox

This Tutorial will show you all needed Code to do Uploads to Dropbox.

Requirement for this tutorial: you need to have your App Dropbox-ready (see Tutorial I - Authentification).

Asuming...
 
Last edited:

Dropbox SDK V2 - Authentification

This Tutorial belongs to the Dropbox SDK V2 - Java Library

See this thread for preparing your app to use this Library.
Especially the Manifest-Entry...
 

Dropbox SDK - get informed about changes in the used Dropbox

Related Libraries:
B4A Dropbox SDK V2
B4J Dropbox SDK V2

You need to know/remember the dropboxId of the account you are actually using/requesting. And the latest cursor.
Use...
 
Last edited:

Drawing lines problem

Attached you find a small test program that shows a known problem in Android when drawing lines with a small slope and with a StrokeWidth of 1.

In some cases the entire line or parts of it are...
 

Attachments

  • DrawLines.zip
    7 KB · Views: 1,159
  • DrawLines1.jpg
    DrawLines1.jpg
    45.2 KB · Views: 1,604
  • DrawLines2.jpg
    DrawLines2.jpg
    41.3 KB · Views: 1,350
Last edited:

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

DownloadManager tutorial

Here i'll post one or two examples showing how to use the DownloadManager library.

DownloadManager simple example.
Here's what must be the most simple way to use DownloadManager...
 

Attachments

  • simple_example.zip
    8.6 KB · Views: 2,116
Last edited:

Downloading files using Service module

It is recommended to use HttpUtils2 instead of this code module. HttpUtils2 is more powerful and is easier to work with.

As discussed in the Services tutorial, some tasks are...
 

Attachments

  • DownloadService.zip
    6.9 KB · Views: 6,482

Downloading and Printing 1 Bit BMP to ESC/POS Printer

Using the feature of resident images of Datecs dpp250. This is the way I found with Erel help to convert a 1 Bit BMP to ESC format, download to the printer, clean printer memory, write printer...
 

Attachments

  • ESCPOSGraphic.zip
    337.2 KB · Views: 1,395

Download list of images with HttpUtils2 and CustomListView

Attachments

  • DownloadList.zip
    13.2 KB · Views: 5,867
Last edited:

Download huge files with HttpUtils2

Attachments

  • LargeFileDownload.zip
    11.5 KB · Views: 2,649
Last edited:

double joystick in b4a with bluetooth output

Last edited:

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
 

DoEvents deprecated and async dialogs (msgbox)

Starting from B4A v7.0 the following warning will appear for DoEvents calls:
DoEvents is deprecated. It can lead to stability issues. Use Sleep(0) instead (if really needed).

The purpose of...
 
Last edited:

Do not start a B4A project before you read the guides

After reading so many threads from new 'member' s , I feel that we have to make humble request to all new members :

Do not start a B4A project before you read the guides....
 
Top