Calculator Intent
I am reposting this bit of code for those who want a simple way to call the calculator''s intent on any phone. It took me a few hours to find this and thought others may find it helpful.
@Jeremy Tipton · 2018-06-22
BitampCreator - DrawLine, DrawPath , DrawCircle, DrawArc, DrawImageTrapezoid [BAX] [XUI]
BitmapCreator lacks some important instructions on Canvas. Sometimes switching from BitmapCreator to Canvas and vice versa would slow down the code too much, so it would be better to implement them with BitmapCreator. I started writing some divers, if someone finds a way to improve it or add other features put other posts.
@Star-Dust · 2018-06-20
Full Screen Theme
Full Screen Theme
@Erel · 2018-06-07
ErrorResponse in OkHttpResponse of HttpUtils2Service may be JSON
Some server''s API (say cloud storage Yandex.Disk) may generate the error with a code (say, 404), but JSON-encoded
@peacemaker · 2018-06-06
NB6 - removing timestamp from notification
Using Erel''s NB6 library for notifications, I noticed the timestamp appearing on the corner of my notification. I didn''t want this, but couldn''t see a way to suppress it, so I modified the class''s ShowWhen sub
@Dave O · 2018-06-05
Flexible share INTENT
After browsing the forum for a long time I am attaching the code of my INTENT that I can use to share by e-mail, WhatsApp and other applications. It supports subject, text, an attachment and even an email. For me the ideal would be to be able to add a phone and that applications like WhatsApp use this data to communicate directly without having to search for it.
@wildfandango · 2018-05-20
SQLITE automatic primary key generation
SQLITE automatic random primary key generation
@fredo · 2018-05-19
Notifications with inline Java code
Notifications with inline Java code
@Johan Schoeman · 2018-05-12
Set value to single view on specific TabStripViewPager panel
On a TabStripViewPager with more than 1 loaded layout the views defined in Sub Global are only valid for the last loaded panel. Change of values on previous loaded panels require some extra effort. With this code you can access a specific view on any tabstrip control panel by using Erel''s RemovePage function.
@fredo · 2018-05-07
Switch Colors
Set the colours of a Switch
@Erel · 2018-05-07
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
Set maximum progress for Progressbar
Set maximum progress for Progressbar
@Pooya1 · 2018-05-01
Shorten numbers
Example convert 1000 to 1k or 1500 to 1.5k
@Pooya1 · 2018-05-01
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
How to add Custom Views programmatically
How to add Custom Views programmatically
@LucaMs · 2018-04-25
Save/Load text formatted
Save & reload a formatted CSBuilder string
@ilan · 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
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
Show/Hide keyboard without IME
Show/hide keyboard without use of IME
@npsonic · 2018-03-13
Image Viewer
Image Viewer
@Indy · 2018-03-12
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
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
Strikethrough with CSBuilder
Strikethrough with CSBuilder
@fredo · 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