Tutorials & Examples

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

Library (JAR) interface using inline Java code and "direct calling"

Attached project demonstrates two ways to interface with a JAR file:

1. Using the JavaObject run method "directly"
2. Making use of inline Java code

For method 1 you need to make use of...
 

Attachments

  • JHS_JO_IJC.zip
    70.9 KB · Views: 796

Image - Various ways of Image Manipulation

Examples of image processing

Click on any one of the displayed images to change to an alternate image.

Made use of Jpeg library by @agraham

See...
 

Attachments

  • JHS_IMAGE_SWAP_ARGB_V1.zip
    466.2 KB · Views: 551
  • JHS_IMAGE_COLOR_BALANCE_V1.zip
    481.7 KB · Views: 511
  • JHS_IMAGE_CONTRAST_V1.zip
    466 KB · Views: 501
  • JHS_IMAGE_BITWISE_BLEND.zip
    149.2 KB · Views: 471
  • JHS_DITHERING_V4.zip
    41.5 KB · Views: 440
  • JHS_IMAGE_COLOR_SHADING.zip
    23 KB · Views: 498
  • JHS_IMAGE_COLOR_TINT.zip
    454.3 KB · Views: 501
  • JHS_IMAGE_CONVOLUTION.zip
    445.2 KB · Views: 493
  • JHS_IMAGE_DISTORT_BLUR_V1.zip
    429.2 KB · Views: 490
  • JHS_IMAGE_ERODE_DILATE.zip
    73.9 KB · Views: 487
Last edited:

Device Sensors

The attached project (with inline Java code) will list all the sensors on your device in the project's log.
 

Attachments

  • deviceSensors.zip
    11.2 KB · Views: 752

Sudoku generator and solver

The attached project will generate and solve Sudoku puzzles (9x9). The code to solve the puzzles with was adapted from here (converted to B4A). The code to generate Sudoku puzzles with comes...
 

Attachments

  • src.zip
    4.1 KB · Views: 1,008
  • JHS_Sudoku.zip
    167.3 KB · Views: 1,013

MidiSystem Recording example

This example loads a midi file and records an extra track from either the on board keyboard, or an external USB midi device.

Please be careful when saving files as the recorded track will be...
 

Attachments

  • Piano&FullMidiLib.zip
    19.4 KB · Views: 657
Last edited:

MidiSystem Drum sequencer

This example allows creation of loops on multiple tracks as they are played. Just like a drum sequencer. It demonstrates creating a midi sequence and tracks, and adding events and messages...
 

Attachments

  • DrumSequencer.zip
    30.5 KB · Views: 624

MidiSystem Example PlayOnly USB

This example allows playing a midi file to an external USB device which you can select. It also allows delaying the messages send to the usb device so you can hear them at the same time as the...
 

Attachments

  • PlayOnlyUSB.zip
    16 KB · Views: 643
Last edited:

USB Serial service

Hi all,

My contribute to the community a USB Serial service, you can add more activitys...

If you like this please press "like"

Thanks

camolas
 

Attachments

  • UsbSerial_respose_service.zip
    9.7 KB · Views: 984

TTS service for 2 Activitys

Hi all,

My contribute to the community a TTS service for 2 Activitys, you can add more activitys...

If you like this please press "like"

Thanks

camolas
 

Attachments

  • Two Activites tts service.zip
    10.1 KB · Views: 411

Pebble Example

This is an example of how to build an app and sent intents to your pebble.
 

Attachments

  • PebbleExample.zip
    9.2 KB · Views: 477

Handling intents for images selected via a 'Share' menu

Thanks for your help Erel!!! I greatly appreciate your timely assistance, this active forum, the B4A community, and B4A itself!!! Gregg

Here's the Manifest file that incorporates two Intents...
 

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,376
  • MySqlViews.zip
    7 KB · Views: 1,511

LibGDX Sensor Access

I'm currently messing about with libGDX and will be using the Accelerometer for input. I borrowed some code from the web and B4A'd it. It includes device rotation, orientation, resolution, X, Y, Z...
 

Attachments

  • sensors.zip
    5.2 KB · Views: 656
  • Screenshot_2014-05-08-20-00-15.png
    Screenshot_2014-05-08-20-00-15.png
    168.1 KB · Views: 517
  • axis_device.png
    axis_device.png
    17.2 KB · Views: 517
Last edited:

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: 794
  • JHS_RPN_CALC_V1.zip
    387 KB · Views: 670
  • JHS_RPN_CALC_V3.zip
    389.6 KB · Views: 909
Last edited:

Slide Panel

Here another Slid Panel.
I use the Ultimate List View ( paid from Informatix ) to swipe control, but someone can adapt the gesture library.

In the first time no image will appear in background...
 

Attachments

  • SlidePanelHSP.zip
    17 KB · Views: 667
  • screen_01.png
    screen_01.png
    165.3 KB · Views: 949
  • screen_02.png
    screen_02.png
    172.4 KB · Views: 825
  • screen_03.png
    screen_03.png
    100 KB · Views: 871

QR Code - Reverse Engineering a QR Code

pic1.png


I am leaving this project here for now. The majority of the work has been done to extract the critical information of a QR code - it is reported in the text box to the right of the qr...
 

Attachments

  • JHSQRCODEREADV4.zip
    19.7 KB · Views: 975
  • qrcodev21ehm6.zip
    443.9 KB · Views: 1,015
  • qrcodev4elm5.zip
    206 KB · Views: 947
Last edited:

5 Card Poker Scoring

Hi all.

Here is a BAS module to do 5 card poker scoring. Its some ugly code but it works.

I have promised myself I was going to re-write this code for over a year but cannot seem to find the...
 

Attachments

  • cards.zip
    37.4 KB · Views: 805
  • poker scoring v0.91.zip
    10.2 KB · Views: 540
  • poker scoring v0.92.zip
    10.2 KB · Views: 643
Last edited:

GIF Movie Player

The attached project is an example using the XtraViews library.

If one of the classes in that library is called "MovieView" then let's play some animated GIF movies. :D


Have fun...
 

Attachments

  • GifMoviePlayer_Sample.zip
    59 KB · Views: 1,631
Last edited:

SQL Order + Where

What am I doing wrong

B4X:
oRst = SQL.ExecQuery2("SELECT * FROM Bustrip ORDER BY sort Asc WHERE bus = ?", Array As String (Main.find))
 

Listview

An example of using Listview.
Open and save dialogs.
Screen orientation.
Don't forget to twist.

Done on 7 inch tablet.
B4A 2.3
 

Attachments

  • List2.apk
    130.8 KB · Views: 326
  • List2.zip
    14.9 KB · Views: 470
  • unicode.zip
    3.1 KB · Views: 353
  • beer.zip
    2.1 KB · Views: 399
Top