Create bitmap from a view
Here is the inline java code, in order to create bitmap from a view. Erel: You can use B4XView.Snapshot from the XUI library to get a snapshot of a view.
@yiankos1 · 2018-05-02
Shorten numbers
Example convert 1000 to 1k or 1500 to 1.5k
@Pooya1 · 2018-05-01
Set maximum progress for Progressbar
Set maximum progress for Progressbar
@Pooya1 · 2018-05-01
Save/Load text formatted
Save & reload a formatted CSBuilder string
@ilan · 2018-04-25
How to add Custom Views programmatically
How to add Custom Views programmatically
@LucaMs · 2018-04-25
Cube-Spline Curve
Here is also an example of Cube-Spline made in B4A. This is just an exercise, but can be used with appropriate modifications for other applications.
@Star-Dust · 2018-04-25
Side Menu Icon with xCustomListView
Side Menu Icon with xCustomListView
@rraswisak · 2018-04-20
Print chinese word in BT Printer
Print chinese word in BT Printer
@diy.diskless · 2018-04-17
Create SQLite field with default date now in milliseconds
Create SQLite field with default date now in milliseconds
@fredo · 2018-04-16
Receive package update
Code to start the app automatically if it was updated
@fredo · 2018-04-12
Show/Hide keyboard without IME
Show/hide keyboard without use of IME
@npsonic · 2018-03-13
Example of #Extends in Service
Starting from B4A v6.50 services support the #Extends attribute. This is useful for libraries that need to extend a service. The previous solution was to communicate with a B4A service with a specific name. This was more cumbersome and limited. The #Extends attribute allows the B4A service to directly extend the library service.
@Erel · 2018-03-13
Version safe themes
Update: If you are using B4A v8.0+ then you should just add: CreateResourceFromFile(Macro, Themes.DarkTheme) ''or Themes.LightTheme Older versions: If you are not explicitly setting the theme in the manifest editor then it will change based on the device version and targetSdkVersion value. Assuming that targetSdkVersion is set to 26 (as soon required by Google) then the theme used by default will be: Device version Android 2.x - Always the old Android 2.x theme Android 4.x - Theme.Holo (dark background) Android 5.x - 6.x - Theme.Material (dark background) Android 7.x+ - Theme.Material.Light.DarkActionBar (light background) This behavior can be problematic. In most cases it is better to explicitly set the theme. The correct way to set it is with manifest code
@Erel · 2018-03-12
Image Viewer
Image Viewer
@Indy · 2018-03-12
Strikethrough with CSBuilder
Strikethrough with CSBuilder
@fredo · 2018-03-11
Password generator Sub
I needed to generate passwords in my app, so I wrote the code below, but calling the sub with strings, like "(6, "NUMBERS")", or "(8, "NUMBERS_UPPERCASE_SYMBOLS")". When I was going to share the code here as a snippet I saw this thread, and then I took the idea of calling the sub with arguments (True, True, False, False), instead of using a string. So, although the library exists, perhaps someone prefers or finds easier to use a Sub, or wants to customize the characters to use (to avoid similar characters, like "I1", "O0", for example).
@Ivan Aldaz · 2018-03-11
CSBuilder with leading margin
CSBuilder with leading margin
@Erel · 2018-03-09
How to add a custom sound from File.DirAssets [Notification Builder]
I want to share with you my solution, using the Notification Builder (Thanks to @barx for this awesome library <3 ), to play a custom sound from your DirAssets folder. I did it because this method use the notification volume for this sound (instead of the Soundpool solution, that use the media volume).
@Carlos Huerta · 2018-02-23
Scrollbar Color
This code uses reflection to change the ScrollView scroll bar color
@Erel · 2018-02-21
Set Status bar colors
A useful sub to set status bar color and foreground color, at runtime
@Emme Developer · 2018-02-19
CRC CCITT (xFFFF) Calculation
CRC CCITT (0xFFFF) calculation on https://www.lammertbies.nl/comm/info/crc-calculation.html
@Victor Pavlov · 2018-02-16
Custom Toast Message
You can customize the toast message text with CSBuilder: https://www.b4x.com/android/forum/threads/76226/#content This code allows you to also change the background color and the toast position
@Erel · 2018-02-11
Check and install Google Play Services
This code will check that an updated version of Google Play Services is installed on the device. If not then it will try to help the user install it.
@Erel · 2018-02-05
Sending email via SMTP with POP before SMTP
The emailing (via SMTP) trouble is solved: to avoid server auth error before using SMTP server we have to check email, say by POP3. This class is tested during 3 days on popular app with around 70-80 emails from an app to the chosen GMAIL box to self. No sending errors now. Before there were 2-3 sending errors per day.
@peacemaker · 2018-01-22
Get Firebase config parameters from google-services.json
Code to get configuration parameters from google-services.json
@fredo · 2018-01-17
SetNavigationBarColor - Change code of Navigation Bar by Code
I use this function to change color of the Navigation Bar (SDK > 21 = Android 5+) in some screens of my app that use Theme.Holo.Light.
@asales · 2018-01-16
Designer Colours
These are the colours used in the designer which has a very nice drop down pickable list together with names.
@PhiloSophical · 2018-01-08
Binary2String
String to Binary and Binary to String.
@ilan · 2018-01-05
Change Pitch of Wave File Playback using SoundPool
Change Pitch of Wave File Playback using SoundPool
@Danamo · 2017-12-29
Change EditText Colors
Change EditText Colors
@Erel · 2017-12-26