Tutorials & Examples

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

Select,Upload,Display,Delete image from Server

Hello everyone,

First of all, I want thank Erel, DonManfred and KMatle because a lot of the codes for them.

In this example (Select an image from gallery and display it, Resize the image, Save...
 

Attachments

  • php_Files.zip
    2.3 KB · Views: 1,069
  • MyImage.png
    MyImage.png
    56.2 KB · Views: 4,267
  • Screenshot_2017-12-19-13-57-22.jpg
    Screenshot_2017-12-19-13-57-22.jpg
    406.4 KB · Views: 3,559
  • complete.zip
    94 KB · Views: 1,219
Last edited:

Creating 1D and 2D Barcodes using inline Java Code and the ZXING core library

The attached project has 10 classes that create the following 1D and 2D barcodes:

1. QR Code - 2D
2. Datamatrix - 2D
3. Aztec Codes - 2D
4. PDF417 - 2D
5. Code 128
6. EAN8
7. EAN13
8. Code 39
9...
 

Attachments

  • core-3.2.1.zip
    483.9 KB · Views: 1,514
  • b4aBarcodeGenerator.zip
    18.1 KB · Views: 1,356
Last edited:

Another Analog Clock

analogClock.png


See the attached project. It uses a library that wraps a project that you can find here. There are files in the Objects/res/drawable and Objects/res/values folders that this...
 

Attachments

  • AnalogClockB4A.zip
    125.8 KB · Views: 904
Last edited:

Round Button - FunWithRoundButtons

Lib files are in the /files folder
 

Attachments

  • FunWithRoundButtons.zip
    93 KB · Views: 1,083

[B4X] B4XPages B4XPages_SQLiteLight2 cross-platform project

The attached project is a porting of the B4X_SQLiteLight2 project which is included in the B4X SQLLite database booklet.
It uses as much as possible XUI objects and common code.
Tested with...
 
Last edited:

Animation without timer

Hi Guys

I would like to share with you something that most of you maybe allready know but also if there are some people that still dont know that, it could be very helpfull for them.

There are...
 

Attachments

  • animation without timer.zip
    224.4 KB · Views: 1,864
Last edited:

Adapt your layouts using SetLayout

Attachments

  • upload_2015-9-1_1-32-15.png
    upload_2015-9-1_1-32-15.png
    28.7 KB · Views: 438
  • upload_2015-9-1_1-43-32.png
    upload_2015-9-1_1-43-32.png
    205.6 KB · Views: 410
  • upload_2015-9-1_1-44-8.png
    upload_2015-9-1_1-44-8.png
    103.2 KB · Views: 397
  • lm SetLayouts Gen.zip
    15 KB · Views: 554
Last edited:

Searching the nearest Coordinate in a Database

today i was in the requrement to write a search-routine in Database.
given was a table with lat an lon values. Goal was to find the nearest Entry.

Tablename: nw05
Fields: gidx (index), glat...
 

Service.StartForeground API 24+

Hello All.

Just thought I would share some info with you. Most of our services in our apps would use
B4X:
Service.StartForeground(1,main_service.n1)

in the service create sub, where...
 

Upload image to server, PostMultipart and PHP

A small example like loading an image with PostMultipart and PHP, I have been useful, you can adapt it needs.

Code B4A
B4X:
Sub CargaImagen
    Dim j As HttpJob
    Dim img As String =...
 
Last edited:

Send Text File using BlueTooth

I needed to send a text file created by my program to a users PC using Bluetooth.
Not finding anything exactly like this in the B4A forums I searched the web and came across this article...
 

Take a Screenshot with Inline Java Code

I have tested this on an Android 7.0 device only - take a screenshot of your activity. You need to enable the JavaObject library to make use of it.

@JordiCP solved my initial problem here...
 

Attachments

  • b4aTakeScreenshot.zip
    16.3 KB · Views: 934

Shuffle a LIST (MP3 playlist for example)

In this example you can find a short example which shuffles a playlist (mp3´s for ex.).
Here i´m using the alphabet (A to Z)

B4X:
Sub Process_Globals
    'These global variables will be declared...
 

Attachments

  • playlistshuffle.zip
    7.5 KB · Views: 1,017

Arabic Digital Clock

See attached B4A project. It implements a digital clock with Arabic numerals. You can edit the png files in the /files folder of the B4A project with something like GIMP and clean them up / change...
 

Attachments

  • ArabicDigitalClock.zip
    102 KB · Views: 686

Calculator - RPN Calculator

This is an attempt to create a RPN calculator (Reverse Polish Notation - as per HP calculators). You can store (STO) and recall (RCL) values of register X. It will store and retrieve last value of...
 

Attachments

  • JHS_RPN_CALC_V2.zip
    387 KB · Views: 713
  • JHS_RPN_CALC_V1.zip
    387 KB · Views: 606
  • JHS_RPN_CALC_V3.zip
    389.6 KB · Views: 840
Last edited:

Retrieve HTML content from WebView using WebViewExtras library

Hello,
The code example below retrieves HTML content from WebView via three different techniques: 1.) MenuItem 2.) LongClick 3.) PageFinished. The code calls addJavascriptInterface() &...
 

RippleView

The attached project comes from here (I have conducted some open heart surgery on it). It is working perfectly on my 7" tablet but on my Samsung S4 mini, unlike what is the case on my...
 

Attachments

  • b4aRippleView.zip
    38.2 KB · Views: 960
  • JavaCode.zip
    145.6 KB · Views: 845
Last edited:

Simple Compass

Have done this just for the fun of it. Have wrapped this posting. The B4A code is short and sweet:

B4X:
#Region  Project Attributes
    #ApplicationLabel: Compass
    #VersionCode: 1...
 

Attachments

  • TheJavaCode.zip
    37.4 KB · Views: 920
  • b4aCompass.zip
    105.8 KB · Views: 1,241
  • CompassLibFiles.zip
    6.5 KB · Views: 1,247

Vibrating Service - Also with Java code inside B4A project

This is a simple project that makes use of the device's vibrator. You can do the following:
1. Switch the vibrator ON for a specified duration of time (in milliseconds)
2. Switch the vibrator...
 

Attachments

  • JHSVIBRATE.zip
    74.4 KB · Views: 854
Last edited:

Creating a Library with Simple Library Compiler (SLC)

This is for people like me - B4A libraries for Dummies 101 (via SLC). I will attempt to explain it the best I can (there is nothing in this library that one can't do via B4A code. This is purely a...
 

Attachments

  • JHSMATH.zip
    7 KB · Views: 854
  • Screen Shot Second Library.png
    Screen Shot Second Library.png
    15.2 KB · Views: 1,224
  • src.zip
    3.8 KB · Views: 793
  • src (2).zip
    4.5 KB · Views: 776
  • Help.png
    Help.png
    79.8 KB · Views: 1,144
Last edited:
Top