Android Code Snippet Super-others: my 42 common usage subs

Common subs are usually placed into a code module.
I decided to check all my projects that have "others.bas" code module, and i have found... 185 unique files. And much more common subs, but 42 pcs of them can be useful for community.
Mostly the names are self-explaning, most are from the forum.


B4X:
Sub Internet_Connected As Boolean
Sub Folder As String
Sub bugreport (Text As String, AttPath As String, AttFileName As String, subj As String)
Sub SuperSendEmail (SendTo As List, SendBody As String, SendSubject As String, SendAtt As Map)    'sends the exact email message, not other text messaging app
Sub CreateFileProviderUri (Dir As String, FileName As String) As Object
Sub BitmapToBitmapDrawable (bitmap As Bitmap) As BitmapDrawable
Sub FontAwesomeToBitmap (Text As String, FontSize As Float) As B4XBitmap
Sub Get_DeviceID As String
Sub Notif(Content As String, Insistent As Boolean, Sound As Boolean, TargetActivity As Object)  'create the notification
Sub FillImageToView(bmp As B4XBitmap, ImageView As B4XView)
Sub HasFeature(feature As String) As Boolean
Sub SavePicture (dir As String, fn As String, bmp As B4XBitmap)
Sub JSON_FilterJsonMap (SQL1 As SQL, Table As String, SourceMap As Map) As Map    'remove new keys (fields that non-existent in SQL table) before updating the table
Sub JSON_CreateTableAuto(SQL1 As SQL, TableName As String, RowsListOfMaps As List)    'automatic SQLite table creation from JSON's array
Sub JSON_GetObjFromPath(obj As Object, path As String) As Object
Sub maxTextHeight(v As Label) As Float
Sub maxTextSize(v As View, str As String) As Float
Sub isFromMarket As Boolean
Sub GetSignatureHash As String    'helps to compare the app signature with your own SHA-1 like "99:9A:F9:66:CE:AA:BE:E3:D3:2E:AA:AE:CF:C8:AA:18:C4:73:DA:42" from "Private Sign key" B4A settings dialog
Sub Get_Hash(Text As String, algorithm As String) As String  'algorithm = MD5 is often used
Sub AddToLog (Text As String)
Sub GetPathFromContentResult(UriString As String) As String
Sub CopyFolder(Source As String, targetFolder As String)
Sub GetFileName(fullpath As String) As String
Sub GetPath(Path As String) As String    ' Depends on: GetFilename
Sub SetAutoSizeBasedOnText(v As View)
Sub CheckForGooglePlayServices As Boolean
Sub Get_Language As String
Sub Show_HomeScreen
Sub GetWeekNumber(ticks As Long) As Int    'depends on GetThursdayOfWeekInTicks
Sub GetThursdayOfWeekInTicks(ticks As Long) As Long
Sub setLabelSingleLine(viewArg As View, singleLineArg As Boolean)
Sub Disable_Horizontal_ScrollBar (v As View)
Sub Disable_V_ScrollBar (v As View)
Sub Enable_V_ScrollBar (v As View)
Sub CreateScaledBitmap(Original As Bitmap, Width As Int, Height As Int, Filter As Boolean) As Bitmap
Sub GetStringFromSQL (req As String) As String    'return "", if no data
Sub WebViewAssetFile (FileName As String) As String
Sub DistanceCalc (p1 As Location, p2 As Location) As Long 'This sub calculates the distance and course between two Lat/Lon coordinates by code (not by GPS lib).
Sub Next_Point(FirstPoint As Location, Dist As Float, Az As Float) As Location    'geo-point located at a distance along the azimuth degree
Sub SortMapKeys (m As Map, SortAsc As Boolean)
Sub Kill_Call
 

Attachments

  • 0.1.zip
    19.9 KB · Views: 642
Last edited:
Top