B4A: Rapid Android App Development using BASIC By Wyken Seagrave Published by Penny Press Ltd, 176 Greendale Road, Coventry, CV5 8AY, United Kingdom
[email protected]
Edition History May 2015 June 2015 April 2016 July 2016
First Edition for Version 4.3 Revised for Version 5.02 Other editions produced Revised for Version 5.80 Revised for Version 6.00
ISBN 9781871281224 (ebook) 9781512296259 (paperback)
Table of Contents Index
Table of Contents Table of Contents Foreword by Erel Uziel Preface Introduction Who this Book is For For the Beginner For the Professional How this Book is Organized Conventions Used in this Book Code Specifying Menus Specifying Functional Arguments Acronyms Resources Free Upgrades Newsletter We’d Like to Hear from You About the Author Acknowledgements Part 1: Basics 1.1 Getting Started Versions Version of B4A Version of Android Two Versions What You Need to Run B4A Installing the Trial Version Download B4A Trial Install and Run the Trial What you see Your First App Debugging Legacy vs Rapid Debugger Breakpoints Save the program B4A-Bridge Install the B4A-Bridge app on your device Run B4A-Bridge on your device Notes on Wireless Connection Connect the IDE to the device B4A-Bridge Status Bar Remote Compilation Mode
Table of Contents
B4A Designer Stopping B4A-Bridge Compiling your new app Remote Compilation Approve the app on your device Breakpoint Debug Window Popup Variable Evaluation Continuing the Run Logging Events Rotating the Device More about Debugging Your Second App: Using the Designer The View and Layout Concepts Running the Designer Connect the Designer to your device. Add a button Configure your button Generate Members Adding Code for the Button Add code to button Load the Layout Run your app Your Third App Stopping B4A-Bridge More about Designer 1.2 The Integrated Development Environment Icons File Menu Edit Menu Designer Project Menu Modules Package Options Compile Options Tools Menu IDE Options Sub-Menu Debug Menu Windows Menu Help Menu Toolbar Module Tabs Closing a Module Popup Module Tab Menu Code area Subroutine Dropdown List Zoom Control
iii
iv
Code Revision Color Coding Regions Code header Commenting and uncommenting code Indentation Autocomplete Autocomplete event subroutines Comments as Documentation Block Completion Context Menu Highlighting occurrences of words Structure Matching Windows Area Window Tabs Libraries Manager Files Manager Modules Window Logs Window Find All References (F7) Quick Search The Warning Engine Ignoring Warnings The warnings The IDE Meta File 1.3 Docking Window Menus Module Menu Window Menu Floating Tab Groups Horizontal Tab Group Vertical Tab Group Docking Dragging Windows Docking a Module Docking Windows Moving a Tab Group Docking Windows Auto Hide Visual Designer Restoring All Windows 1.4 Upgrade to Full Version About Full Versions B4A Standard Version
Table of Contents
Table of Contents
B4A Enterprise Version B4A Site License Academic Licenses Purchase Registering B4A Java JDK and Android SDK Installation Check if the Java JDK is already installed Install the 32 bit Java JDK Install the Android SDK and a platform Install the SDK Manager Run SDK Manager Install required SDKs Install and configure B4A Download and install B4A Open B4A License Configure Paths Javac.exe Android.jar Additional Libraries Shared Modules Folder Updating to a new version Part 2: Creating Your App 2.1 The Project Modules Main Module Starter Service Attributes Project Attributes #ApplicationLabel: #CanInstallToExternalStorage: #CustomBuildAction: Step, Command, Arguments #DebuggerDisableOptimizations: Value #ExcludeClasses: Value List #SupportedOrientations: Value #VersionCode: Value #VersionName: Name #AdditionalRes: Location, Package (optional) #DebuggerForceFullDeployment: #DebuggerForceStandardAssets: #SignKeyFile: #SignKeyPassword: Library compilation attributes Project Icon Package name Unique name Allowed Characters
v
vi
Google Play URL Caution: Name cannot be changed The Manifest Manifest Editor Escaping end of string characters Manifest commands Conditional Manifest Commands More information 2.2. Designing Your App Fulfilling Wants and Needs Android Versions Popularity of Android Versions The Android Screen Status Bar Navigation Bar Notifications App Design Step by Step Basic Design Principles Title Bar Action Bar Menu Tabbed Views Sliding Pages Navigation Drawer Animating your App Advertising Android Themes More Advice Managing Settings Editing Settings Saving and Retrieving Settings Screens and Layouts The Designer Multiple activities Returning from an Activity Overlays Menu Overlay Layout as Overlay How to Detect the Display Size LayoutValues Detecting Device Orientation Allowed Screen Orientation Adding views by code Example dips DipToCurrent(Length as Int) Percentage of Activity
Table of Contents
Table of Contents
Does the device have a keyboard? App or Widget ? Managing Permissions Before Android 23 Runtime Permissions 2.3 Communicating with your User Modal Dialogs Msgbox Msgbox2 InputList InputMultiList InputMap Handling Long Lists Dialogs Library Handling Modal Dialogs when your App Pauses ToastMessageShow Alarms Notifications ProgressDialog ProgressBar 2.4 The Visual Designer Layouts Docking Windows File Menu New Open Save (Ctrl+S) Save As Remove Layout AddView Menu WYSIWYG Designer Menu Connect (F2) Disconnect (Shift+F2) Tools Menu Generate Members Change grid Send To UI Cloud (F6) Windows Menu Properties Window Variants Window Files Window Script Windows Views Tree Reset The Abstract Designer Match Chosen Variant View Controls
vii
viii
Table of Contents
Context menus Selecting views Designer Scripts Adding views in code 2.5 Designer Scripts Reference Background Designer Scripts and Activity Code Running Scripts Key Concepts Pixel Resolution dpi : dots per inch Screen Size dip Text Size Standard Screen Scale Dock and Fill Strategy Designer Scripting Basics Selecting Variants Script Language Variables %x and %y Properties Within Scripts Warning: Set Internal Properties before External Text Properties Other Properties Methods Other Keywords Activity Methods Activity.RerunDesignerScript (LayoutFile As String, Width As Int, Height As Int) AutoScale: Layouts for Different Sized Devices How AutoScale works How to See the Effect of AutoScale How to See the Effect of AutoScale on Text Size How to Use AutoScale AutoScaleRate(rate) AutoScaleAll AutoScale(View) Different Layouts for Portrait and Landscape Scaling strategy Editing Views in a program 2.6 Compiling, Debugging & Testing Compiling Android Version Build Configuration Defining a Build Configuration
Table of Contents
Build Configuration List Conditional Compilation Compilation Modes Debug Mode Release Mode Release (obfuscated) Conditional Compilation Command Line Compiler Running from Batch Files Debugging #ExcludeFromDebugger Attribute Restart (F11) Rapid debugging Limitations of the Rapid Debugger How the Rapid Debugger Works Editing Code using the Rapid Debugger Legacy Debugging Breakpoints Breakpoint Limitations Debugger Control Debug Window Call Stack Variables List Watches Hovering Logging Compiling for Android 5.0 Lollipop Material Design Testing your App Connecting the Debugger to a Device or Emulator Debugging Communication Channels Opening the Channel B4A-Bridge USB Debugging Connecting the Device via USB Android Debug Bridge Debugging with USB The Emulator or Android Virtual Device (AVD) Manager Introduction How B4A interacts with Emulated Devices Using the Android Virtual Device Manager Missing Tabs Android Virtual Devices (AVDs) Creating an AVD AVD Name (Required) Device (Required) Target (Required)
ix
x
Table of Contents
CPU / ABI (Required) Keyboard Skin (Required) Front / Back Camera Memory Options Internal Storage SD Card Emulation Options Creating a Device Definition Running a Virtual Device and scaling for Real Size Emulation No Scaling Scale display to real size Interacting with your Virtual Device PC Keyboard Shortcuts Mac Keyboard Shortcuts Exchanging files with the PC Troubleshoot Connection Problems 2.7 Graphics and Drawing Drawing Methods Setting Backgrounds of Views and the Activity View Drawables Bitmaps Drawables Background Property ColorDrawable GradientDrawable BitmapDrawable Example Code StateListDrawable NinePatchDrawable Canvas Object Initializing a Canvas Drawing onto a Canvas Importing a Bitmap file into Canvas Copying a Drawable onto a Canvas Making the Canvas Draw Itself Restricting the Drawing Area Most common Canvas functions DrawBitmap (Bitmap1 As Bitmap, SrcRect As Rect, DestRect As Rect) DrawBitmapRotated (Bitmap1 As Bitmap, SrcRect As Rect, DestRect As Rect, Degrees As Float) DrawCircle (x As Float, y As Float, Radius As Float, Color As Int, Filled As Boolean, StrokeWidth As Float) DrawColor (Color As Int) DrawLine (x1 As Float, y1 As Float, x2 As Float, y2 As Float, Color As Int, StrokeWidth As Float) DrawRect (Rect1 As Rect, Color As Int, Filled As Boolean, StrokeWidth As Float)
Table of Contents
DrawRectRotated (Rect1 As Rect, Color As Int, Filled As Boolean, StrokeWidth As Float, Degrees As Float) DrawText (Text As String, x As Float, y As Float, Typeface1 As Typeface, TextSize As Float, Color As Int, Align1 As Align) DrawTextRotated (Text As String, x As Float, y As Float, Typeface1 As Typeface, TextSize As Float, Color As Int, Align1 As Align, Degree As Float) Example Program More Complex Examples Animating Bitmaps Diagrams / Charts Charts Framework Out of Memory Errors 2.8 Databases Storing Data Database fundamentals Database Table Record Field Primary Key Field Type Relational Data Database Files KeyValueStore Class Encrypting Databases Showing Tables to the User Database Administration DBMS Tools SQLiteBrowser SQLiteSpy DBMS Apps SQL Object Reference SQL Library Declare SQL Object Initialize SQL Object DBUtils DBUtils Fundamentals Preliminary SQL Steps DBUtils Field Types DBUtils Functions Sample DBUtils Program SQLite SQL SQLite More Information on SQLite Sample SQLite Program Manifest Typing
xi
xii
SQLiteExceptions SQL Library SQLite Commands Database Creation Table creation Dropping a Table Adding records Updating records Retrieving data Deleting data Rename a table Add a field Using SQLite to Convert Ticks to Strings Implementing a Database Relationship 2.9 Modules Process When Does Android Kill a Process? Creating or Adding Modules Shared Modules Module Attributes #AdditionalJar #ExcludeFromLibrary Visibility and Lifetime of Variables and Subs Public Variables Private Variables Variables within Other Subs Visibility of Subroutines Activity Global Variables Class_Globals Local variables in Subs Sub Process_Globals Modules Containing Process_Globals Process_Globals Variables Initialization of Process_Globals Lifetimes of Process_Globals Variables Process_Globals in Starter Service Restriction of Process_Globals Variables Rotating Device How to Access Process_Globals Variables Activity Module The Activity Concept Activity Module Activity Attributes Variables within an Activity Activity Life Cycle Activity Events Sub Activity_Create (FirstTime As Boolean)
Table of Contents
Table of Contents
Sub Activity_Resume Sub Activity_Pause (UserClosed As Boolean) StartActivity (Activity As Object) Activity.Finish vs ExitApplication Creating a Menu Activities vs Windows Forms Multiple Activity Modules Class module What is a Class? Benefits of Classes Example Sub Class_Globals Public vs Private Variables Public vs Private Subs Classes vs Types Classes vs Code Modules Adding a class module Class structures Polymorphism Self reference Classes and Activity Object Activities that Extend Classes Limitations of Classes Code module Service Module Why use a Service Alternative to an Activity Android’s View of Services How to Start a Service Service Code Service Attributes SubRoutines When to Use a Service Notifications Accessing other modules Sample Projects Using Services 2.10 Publishing and Monetizing Your App User Help Branding and Marketing Setting Your Project Parameters Package Name Project Attributes Setting Icons Google Play Store Icon Launcher Icon [Project > Choose Icon] Action Bar Icons
xiii
xiv
Creating Icons Sources of Icons Implementing MipMap Notification Icon Recommendations Icon Sizes Installing Icons Generating Your APK APK File Keys and Certificates Signing Debugging Certificates Signing for Distribution Creating or Loading a Private Key The KeyStore Compiling the APK SHA1 Certificate Fingerprint Monetising Your App Ways of Monetizing Your App Libraries Supporting Advertising AdMob AdBuddiz AdiQuity TapForTap AppLovin Selling Your App In-App Billing Licensing Registering as a Google Play Developer Register as a Google Play Developer Merchant Account Prepare Your App’s Google Play Page User Support Google Play Developer Console Upload your App to Google Play Distributing Apps elsewhere Preparing the User’s Device Amazon Appstore By Email Downloading from a website Other App Publishers 2.11 Getting More Help Anywhere Software Forum Chat Room Video Tutorials On-Line Tutorials Facebook
Table of Contents
Table of Contents
Twitter Linked In On-line Documentation PDF Guides Library Browsers B4a Object Browser B4AHelp Part 3: Language and Core Objects 3.1 B4A’s Language BASIC B4A Lexical Rules Statement Separator Comments Splitting Long Lines Variables Constants Types Primitive Types Hex Literals Non-Primitive Types Core Types Reference to Non-Primitives Type Conversion Rank Creating Your Own Types Objects Initialization of Objects Declaring Variables Dim Statement No Option Explicit Editor Warnings of Undeclared Variables Allocating Values Type Checking Use of Unassigned Variables Pass by Value Pass by Reference Naming of Variables Hungarian Notation Arrays Dimensions Declaring an Array Default Type Cannot Change Dimensions Saving and Retrieving Data Filling an array using the Array keyword Length of an Array
xv
xvi
Arrays of Objects Array Dimensions are Fixed Lists Maps Type variables Declaring Types Recursive Types Casting Visibility of Variables Expressions and Operators Mathematical expressions Relational Operators Logical Operators Regular Expressions Conditional statements If – Then If-Then-End If If-Then-Else-End If Select – Case Loop structures For – Next For-Each Do-While Do-Until Exit a Loop Differences between B4A and Visual Basic Subs Declaring a Sub Naming Calling a Sub Parameters Returned value Creating Tooltips for Subs Events Core Object Events Reacting to an Event Example Shared Event Handler View Events Commonest View Events Error Handling Runtime Errors Exceptions Uncaught Runtime Exceptions Try-Catch When to use a Try-Catch String manipulation
Table of Contents
Table of Contents
xvii
Mutable Strings The String functions Number formatting Keywords Abs (Number As Double) As Double ACos (Value As Double) As Double ACosD (Value As Double) As Double Array Asc (Char As Char) As Int ASin (Value As Double) As Double ASinD (Value As Double) As Double ATan (Value As Double) As Double ATan2 (Y As Double, X As Double) As Double ATan2D (Y As Double, X As Double) As Double ATanD (Value As Double) As Double BytesToString (Data() As Byte, StartOffset As Int, Length As Int, CharSet As String) As String CallSub (Component As Object, Sub As String) As String CallSub2 (Component As Object, Sub As String, Argument As Object) As String CallSub3 (Component As Object, Sub As String, Argument1 As Object, Argument2 As Object) As String CallSubDelayed (Component As Object, Sub As String) CallSubDelayed2 (Component As Object, Sub As String, Argument As Object) CallSubDelayed3 (Component As Object, Sub As String, Argument1 As Object, Argument2 As Object) CancelScheduledService (Service As Object) Catch cE As Double Ceil (Number As Double) As Double CharsToString (Chars() As Char, StartOffset As Int, Length As Int) As String Chr (UnicodeValue As Int) As Char ConfigureHomeWidget (LayoutFile As String, EventName As String, UpdateIntervalMinutes As Int, WidgetName As String) As RemoteViews Continue Cos (Radians As Double) As Double CosD (Degrees As Double) As Double cPI As Double CreateMap() As Map CRLF As String Density As Float Dim
xviii
Table of Contents
DipToCurrent (Length As Int) As Int DoEvents Exit ExitApplication False As Boolean File As File Floor (Number As Double) As Double For For Each GetDeviceLayoutValues As LayoutValues GetType (object As Object) As String If InputList (Items As List, Title As String, CheckedItem As Int) As Int InputMap (Items As Map, Title As String) InputMultiList (Items As List, Title As String) As List Is IsBackgroundTaskRunning (ContainerObject As Object, TaskId As Int) As Boolean IsDevTool (ToolName As String) As Boolean IsNumber (Text As String) As Boolean IsPaused (Component As Object) As Boolean LastException As Exception LoadBitmap (Dir As String, FileName As String) As Bitmap LoadBitmapSample (Dir As String, FileName As String, MaxWidth As Int, MaxHeight As Int) As Bitmap Log (Message As String) Logarithm (Number As Double, Base As Double) As Double Matcher Matcher Methods Max (Number1 As Double, Number2 As Double) As Double Me As Object Min (Number1 As Double, Number2 As Double) As Double Msgbox (Message As String, Title As String) Msgbox2 (Message As String, Title As String, Positive As String, Cancel As String, Negative As String, Icon As Bitmap) As Int Not (Value As Boolean) As Boolean Null As Object NumberFormat (Number As Double, MinimumIntegers As Int, MaximumFractions As Int) As String NumberFormat2 (Number As Double, MinimumIntegers As Int, MaximumFractions As Int, MinimumFractions As Int, GroupingUsed As Boolean) As String
Table of Contents
PerXToCurrent (Percentage As Float) As Int PerYToCurrent (Percentage As Float) As Int Power (Base As Double, Exponent As Double) As Double ProgressDialogHide ProgressDialogShow (Text As String) ProgressDialogShow2 (Text As String, Cancelable As Boolean) QUOTE As String Regex As Regex Regex Options Regex Methods Return Rnd (Min As Int, Max As Int) As Int RndSeed (Seed As Long) Round (Number As Double) As Long Round2 (Number As Double, DecimalPlaces As Int) As Double Select Sender As Object Sin (Radians As Double) As Double SinD (Degrees As Double) As Double Sqrt (Value As Double) As Double StartActivity (Activity As Object) StartService (Service As Object) StartServiceAt (Service As Object, Time As Long, DuringSleep As Boolean) StartServiceAtExact (Service As Object, Time As Long, DuringSleep As Boolean) StopService (Service As Object) Sub SubExists (Object As Object, Sub As String) As Boolean TAB As String Tan (Radians As Double) As Double TanD (Degrees As Double) As Double ToastMessageShow (Message As String, LongDuration As Boolean) True As Boolean Try Type Until While 3.2 VB6 versus B4A Controls vs. Views Dim ReDim
xix
xx
Boolean Operations Not Using Integers as Boolean Global Const Repeating Structures For…Next Loops, If-Then, Select Case Exit ElseIf/EndIf Colors Subroutines Declaring a Sub Calling a sub Functions Exit Sub DoEvents Format InputBox Loop MsgBox Random Numbers Rnd RndSeed Randomize Round Val() SetFocus Divide by Zero Shell Timer TabIndex Setting Label Transparency Constants String “Members” Left$ and Right$ Len Replace Case Trim Instr Error Trapping VB6 B4A “Immediate Window” vs. “Logs” Tab 3.3 Core Objects List of Core Objects General
Table of Contents
Table of Contents
Constants Drawing Objects File Objects Views Activity Views within an Activity Activity Events ActionBarHomeClick Click KeyPress and KeyUp Events LongClick PermissionResult (Permission As String, Result As Boolean) Touch (Action As Int, X As Float, Y As Float) Activity Members ACTION_DOWN As Int ACTION_MOVE As Int ACTION_UP As Int AddMenuItem (Title As String, EventName As String) AddMenuItem2 (Title As String, EventName As String, Bitmap1 As Bitmap) AddMenuItem3 (Title As String, EventName As String, Bitmap1 As Bitmap, AddToActionBar As Boolean) AddView (View1 As View, Left As Int, Top As Int, Width As Int, Height As Int) Background As Drawable CloseMenu Color As Int [write only] DisableAccessibility (Disable As Boolean) Finish GetAllViewsRecursive As IterableList GetStartingIntent As Intent GetView (Index As Int) As View Height As Int Initialize (EventName As String) Invalidate Invalidate2 (Rect1 As Rect) Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int) IsInitialized As Boolean Left As Int LoadLayout (Layout As String) As LayoutValues NumberOfViews As Int [read only] OpenMenu RemoveAllViews RemoveViewAt (Index As Int)
xxi
xxii
Table of Contents
RequestFocus As Boolean RerunDesignerScript (Layout As String, Width As Int, Height As Int) SendToBack SetActivityResult (Result As Int, Data As Intent) SetBackgroundImage (Bitmap1 As Bitmap) SetLayout (Left As Int, Top As Int, Width As Int, Height As Int) Tag As Object Title As CharSequence TitleColor As Int Top As Int Width As Int Application Application Members LabelName As String PackageName As String VersionCode As Int VersionName As String Bit Bitwise Operations Members: And (N1 As Int, N2 As Int) As Int InputStreamToBytes (In As Inputstream) As Byte() Not (N As Int) As Int Or (N1 As Int, N2 As Int) As Int ParseInt (Value As String, Radix As Int) As Int ShiftLeft (N As Int, Shift As Int) As Int ShiftRight (N As Int, Shift As Int) As Int ToBinaryString (N As Int) As String ToHexString (N As Int) As String ToOctalString (N As Int) As String UnsignedShiftRight (N As Int, Shift As Int) As Int Xor (N1 As Int, N2 As Int) As Int Constants Colors DialogResponse Gravity KeyCodes Typeface DateTime Members: Add (Ticks As Long, Years As Int, Months As Int, Days As Int) As Long Date (Ticks As Long) As String
Table of Contents
DateFormat As String DateParse (Date As String) As Long DateTimeParse (Date As String, Time As String) As Long DeviceDefaultDateFormat As String [read only] DeviceDefaultTimeFormat As String [read only] GetDayOfMonth (Ticks As Long) As Int GetDayOfWeek (Ticks As Long) As Int GetDayOfYear (Ticks As Long) As Int GetHour (Ticks As Long) As Int GetMinute (Ticks As Long) As Int GetMonth (Ticks As Long) As Int GetSecond (Ticks As Long) As Int GetTimeZoneOffsetAt (Date As Long) As Double GetYear (Ticks As Long) As Int ListenToExternalTimeChanges Now As Long [read only] SetTimeZone (OffsetHours As Double) TicksPerDay As Long TicksPerHour As Long TicksPerMinute As Long TicksPerSecond As Long Time (Ticks As Long) As String TimeFormat As String TimeParse (Time As String) As Long TimeZoneOffset As Double [read only] Drawing Objects Bitmap BitmapDrawable Canvas ColorDrawable GradientDrawable Path Rect StateListDrawable Exception Members: IsInitialized As Boolean Message As String [read only] File Object Filenames Adding Files to your Project Folder locations on Device
xxiii
xxiv
Text encoding File InputStream OutputStream TextReader TextWriter Intent Members: Action As String ACTION_APPWIDGET_UPDATE As String ACTION_CALL As String ACTION_EDIT As String ACTION_MAIN As String ACTION_PICK As String ACTION_SEND As String ACTION_VIEW As String AddCategory (Category As String) ExtrasToString As String Flags As Int GetData As String GetExtra (Key As String) As Object HasExtra (Key As String) As Boolean Initialize (Action As String, URI As String) Initialize2 (URI As String, Flags As Int) IsInitialized As Boolean PutExtra (Name As String, Value As Object) SetComponent (Component As String) SetType (Type As String) WrapAsIntentChooser (Title As String) LayoutValues Members: ApproximateScreenSize As Double [read only] Height As Int Scale As Float toString As String Width As Int List How to use a List Members: Map How to use a Map Members:
Table of Contents
Table of Contents
MediaPlayer Event: Complete Members: Duration As Int [read only] Initialize Initialize2 (EventName As String) IsPlaying As Boolean Load (Dir As String, FileName As String) Looping As Boolean Pause Play Position As Int Release SetVolume (Right As Float, Left As Float) Stop Notification Permissions: Members: AutoCancel As Boolean [write only] Cancel (Id As Int) Icon As String [write only] Initialize Insistent As Boolean [write only] IsInitialized As Boolean Light As Boolean [write only] Notify (Id As Int) Number As Int OnGoingEvent As Boolean [write only] SetInfo (Title As String, Body As String, Activity As Object) SetInfo2 (Title As String, Body As String, Tag As String, Activity As Object) Sound As Boolean [write only] Vibrate As Boolean [write only] Regex As Regex Matcher Object More about Regex Options Members: CASE_INSENSITIVE IsMatch (Pattern As String, Text As String) As Boolean IsMatch2 (Pattern As String, Options As Int, Text As String) As Boolean Matcher (Pattern As String, Text As String) As Matcher
xxv
xxvi
Table of Contents
Matcher2 (Pattern As String, Options As Int, Text As String) As Matcher MULTILINE Split (Pattern As String, Text As String) As String() Split2 RemoteViews Events: Members: HandleWidgetEvents (StartingIntent As Intent) As Boolean SetImage (ImageViewName As String, Image As Bitmap) SetProgress (ProgressBarName As String, Progress As Int) SetText (ViewName As String, Text As String) SetTextColor (ViewName As String, Color As Int) SetTextSize (ViewName As String, Size As Float) SetVisible (ViewName As String, Visible As Boolean) UpdateWidget Service Members: StartForeground (Id As Int, Notification1 As Notification) StopForeground (Id As Int) String Immutable Strings Mutable Strings Number formatting Smart Strings Members: CharAt (Index As Int) As Char CompareTo (Other As String) As Int Contains (SearchFor As String) As Boolean EndsWith (Suffix As String) As Boolean EqualsIgnoreCase (other As String) As Boolean GetBytes (Charset As String) As Byte() IndexOf (SearchFor As String) As Int IndexOf2 (SearchFor As String, Index As Int) As Int LastIndexOf (SearchFor As String) As Int LastIndexOf2 (SearchFor As String, Index As Int) As Int Length As Int Replace (Target As String, Replacement As String) As String StartsWith (Prefix As String) As Boolean SubString (BeginIndex As Int) As String SubString2 (BeginIndex As Int, EndIndex As Int) As String ToLowerCase As String
Table of Contents
ToUpperCase As String Trim As String StringBuilder Members: Append (Text As String) As StringBuilder Initialize Insert (Offset As Int, Text As String) As StringBuilder IsInitialized As Boolean Length As Int [read only] Remove (StartOffset As Int, EndOffset As Int) As StringBuilder ToString As String Timer Event: Tick Example: Members: Enabled As Boolean Initialize (EventName As String, Interval As Long) Interval As Long IsInitialized As Boolean Views AutoCompleteEditText Button CheckBox CustomView EditText HorizontalScrollView ImageView Label ListView Panel ProgressBar RadioButton ScrollView SeekBar Spinner TabHost ToggleButton View WebView 3.4 Inline Code Returning Data to B4A Part 4: Libraries 4.1 Libraries Introduction
xxvii
xxviii
What is a library? Types of Libraries Core Library Standard Libraries Additional Official Libraries Additional User Libraries Additional libraries folder Telling the IDE where to find Additional Libraries Error message “Are you missing a library reference?” Referencing Libraries Using Libraries Updating Additional Libraries Using Inline Code to access Libraries Creating Libraries Benefits of creating Libraries Preparing Your Library Main Activity Excluded Library specific attributes Project attributes Module Attributes Classes Attributes How to Compile a Library Output No Home Screen Widget Libraries How to publish your library 4.2 Standard Libraries included with Full Version Introduction List of Standard Libraries Accessibility Library List of types: Accessiblity Members: GetUserFontScale As Float SetContentDescription (View1 As View, Content As CharSequence) SetNextFocusDown (ThisView As View, NextView As View) SetNextFocusLeft (ThisView As View, NextView As View) SetNextFocusRight (ThisView As View, NextView As View) SetNextFocusUp (ThisView As View, NextView As View) Administrator Library On-line Link List of types: AdminManager Animation Library Animation List of types: Audio Library
Table of Contents
Table of Contents
List of types: AudioRecordApp Beeper JetPlayer MediaPlayerStream SoundPool VideoRecordApp VideoView B4XEncryption Library B4XCipher Camera Library List of types: Camera ContentResolver Library List of types: ContentResolver ContentValues Uri DateUtils Library Period Daydream Library List of types: Daydream GameView Library Tutorial List of types: BitmapData GameView GPS Library List of types: GPS GPSSatellite Location HTTP (Legacy) Library List of types: HttpClient HttpRequest HttpResponse HttpUtils2 (Legacy) Library HttpJob IME Library List of types: IME JavaObject Library JavaObject JSON Library About JSON
xxix
xxx
List of types: JSONGenerator JSONParser LiveWallpaper Library List of types: LWEngine LWManager Network Library List of types: ServerSocket Socket UDPPacket UDPSocket NotificationListener Library StatusBarNotification NFC Library About NFC List of types: NdefRecord NFC OkHttp Library List of types: OkHttpClient OkHttpRequest OkHttpResponse OkHttpUtils2 Library HttpJob Phone Library CallItem CallLog Contact Contacts Contacts2 ContentChooser Email LogCat PackageManager Phone PhoneAccelerometer PhoneCalls PhoneEvents PhoneId PhoneIntents PhoneOrientation PhoneSensors PhoneSms PhoneVibrate
Table of Contents
Table of Contents
PhoneWakeState RingtoneManager Sms SmsInterceptor SmsMessages VoiceRecognition PreferenceActivity Library PreferenceActivity Limitations List of types: PreferenceCategory PreferenceManager PreferenceScreen RandomAccessFile Library List of types: AsyncStreams CompressedStreams CountingInputStream CountingOutputStream RandomAccessFile Reflection Library Notes List of types: Reflector Serial Library List of types: BluetoothAdmin Serial Sip Library List of types: Sip SipAudioCall SQL Library List of types: Cursor SQL StringUtils Library List of types: StringUtils TTS Library TTS USB Library List of types: MtpDevice UsbAccessory UsbDevice UsbDeviceConnection UsbEndpoint
xxxi
xxxii
UsbInterface UsbManager UsbRequest ViewsEx Library RatingBar Switch XmlSax Library XML Sax List of types: Attributes SaxParser 4.3 Additional Libraries and Modules Introduction Finding Additional Libraries Additional libraries folder Telling the IDE where to find additional libraries List of Additional Libraries Additional Official Libraries Adiquity AdMob AnotherDatePicker class AsyncStreamsText Analytics Audio Bluetooth Low Energy Camera CameraEx CustomeListView DBUtils DropBox Sync Excel Facebook User Authentication Firebase RemoteConfig GamePad Google Maps Google Play Services HttpServer JSch JTidy KeyValueStore Licensing Net OAuth PayPal SearchView SMB
Table of Contents
Table of Contents
xxxiii
Speak Button SQLCipher StateManager StdActionBar Library TableView Tap for Tap USB Host USBSerial XMLBuilder YouTube Additional User Libraries Introduction To obtain or update a user library Which ones does a project need? How to use a library List of libraries Additional User Libraries Downloading User Libraries How to create a library How to Share your Library License Dialogs Library Source Notes ColorDialog ColorDialogHSV ColorPickerDialog CustomDialog CustomDialog2 DateDialog FileDialog InputDialog NumberDialog TimeDialog TabHostExtras Library getTabContentViewPadding (tabHost1 As TabHost) As RectWrapper getTabEnabled (tabHost1 As TabHost, index As Int) As Boolean getTabHeight (tabHost1 As TabHost) As Int getTabHostPadding (tabHost1 As TabHost) As RectWrapper getTabTextSize (tabHost1 As TabHost) As Float getTabVisibility (tabHost1 As TabHost, index As Int) As Boolean setTabContentViewPadding (tabHost1 As TabHost, left As Int, top As Int, right As Int, bottom As Int) setTabEnabled (tabHost1 As TabHost, enabled As Boolean) setTabEnabled2 (tabHost1 As TabHost, enabled As Boolean, index As Int) setTabGradientDrawable (tabHost1 As TabHost, orientation As String, color1 As Int, color2 As Int, cornerRadius As Float)
xxxiv
Table of Contents
setTabGradientDrawable2 (tabHost1 As TabHost, orientation As String, color1 As Int, color2 As Int, cornerRadius As Float()) setTabHeight (tabHost1 As TabHost, tabHeight As Int) setTabHostPadding (tabHost1 As TabHost, left As Int, top As Int, right As Int, bottom As Int) setTabTextColor (tabHost1 As TabHost, Color As Int) setTabTextColorStateList (tabHost1 As TabHost, ColorStateListName As String) setTabTextSize (tabHost1 As TabHost, TextSize As Float) setTabTitle (tabHost1 As TabHost, Title As String, TabIndex As Int) setTabVisibility (tabHost1 As TabHost, visible As Boolean) setTabVisibility2 (tabHost1 As TabHost, visible As Boolean, index As Int) Toggle Library Part 5: External Tools and Services 5.1 Firebase Services What is Firebase? Integrating Firebase Services into B4A More about Google APIs for Android Supported Firebase Services in B4A FirebaseAnalytics: Analytics & crash reports Notifications / Push messages AdMob Advertisements Authentication with Facebook or Google Accounts Firebase RemoteConfig More Information Google API Project 5.2 Maven Repositories Apache Maven Project Maven Repositories Maven artifacts Android SDK and maven repositories Tools Benefits 5.3 AAR Library Support Introduction Including AAR libraries in B4A Apps Example 1 Example 2 Index
Index The page numbers in the index refer to the printed and the PDF versions of this book. Readers of the Kindle and EPUB versions should use their search facility to find the actual text. #AdditionalJar, 232 Acronyms, 39 #AdditionalRes Location, Package, 113 Action, 375 #ApplicationLabel, 111 Action Bar, 122 #CanInstallToExternalStorage, 111 Action Bar Icon, 124 #CustomBuildAction Step, Command, Action Bar Icons, 258 Arguments, 111 Action Bar in Holo Theme, 122 #DebuggerDisableOptimizations Value, Action Bar Split, 124 112 Action Bar Title, 124 #DebuggerForceFullDeployment, 114 ACTION_APPWIDGET_UPDATE, 375 #DebuggerForceStandardAssets, 114 ACTION_CALL, 375 #ExcludeClasses Value List, 112 ACTION_DOWN, 337 #ExcludeFromDebugger Attribute, 176 ACTION_EDIT, 375 #ExcludeFromLibrary, 233 ACTION_MAIN, 375 #Extends ClassOrActivity, 239 ACTION_MOVE, 337 #FullScreen Value, 239 ACTION_PICK, 375 #IncludeTitle Value, 239 ACTION_SEND, 375 #SignKeyFile, 114 ACTION_UP, 337 #SignKeyPassword, 114 ACTION_VIEW, 375 #SupportedOrientations Value, 113 ActionBarHomeClick, 336 #VersionCode Value, 113 Activities that Extend Classes, 252 #VersionName Name, 113 Activities vs Windows Forms, 246 %x and %y, 131, 164 Activity, 335 “External” Storage, 363 Activity Attributes, 239 “Immediate Window” vs. “Logs” Tab, 332 Activity Attributes Region, 82 “Internal” Storage, 363 Activity Concept, 238 AAR Library Support, 598 Activity Events, 241, 336 About Full Versions, 102 Activity Global Variables, 236 About JSON, 490 Activity Life Cycle, 240 About NFC, 499 Activity Members, 337 About the Author, 41 Activity Methods, 166 Abs, 305 Activity Module, 235, 238 Abstract Designer, 157 Activity Properties, 146 Academic Licenses, 102 Activity.Finish vs ExitApplication, 245 Accessibility Library, 455 Activity.RerunDesignerScript, 166 Accessiblity, 455 ADB Client, 187 Accessing other modules, 255 ADB Daemon, 187 Accuracy, 479 ADB Server, 187 AccuracyValid, 479 AdBuddiz, 264 Acknowledgements, 42 Add, 348, 379, 434 ACos, 305 Add a button, 59 ACosD, 305 Add a field, 229
36
Add code to button, 65 Add Elements, 377 Add Files, 88 Add Only Normalized Variants, 152 AddActivityText, 116 AddAll, 379, 434 AddAllAt, 379 AddApplicationText, 116 AddCatchAllState, 361 AddCategory, 375 AddCheckBox, 533, 534 AddEditText, 533, 534 AddHandleActionEvent, 487 AddHeightChangedEvent, 488 Adding a class module, 249 Adding Code for the Button, 64 Adding Entry, 382 Adding Files to your Project, 363 Adding Other Variants, 152 Adding records, 227 Adding views by code, 130 Adding views in code, 161 Additional Libraries, 108 Additional Libraries and Modules, 573 Additional libraries folder, 449, 573 Additional Official Libraries, 449, 573 Additional User Libraries, 449, 578, 579 AdditionalLibs$, 113 AddList, 533, 534 AddManifestText, 116 AddMenuItem, 337 AddMenuItem2, 337 AddMenuItem3, 338 AddNonQueryToBatch, 556 AddPermission, 116 AddPreferenceCategory, 533, 535 AddPreferenceScreen, 533, 535 AddReceiverText, 116 AddReplacement, 117 Address, 529, 550, 567 AddServiceText, 117 AddSingleLine, 420 AddSingleLine2, 420 AddState, 361 AddState2, 361 AddTab, 437 AddTab2, 437
Index
AddTabWithIcon, 438 AddTabWithIcon2, 438 AddToMediaStore, 527 AddTwoLines, 420 AddTwoLines2, 420 AddTwoLinesAndBitmap, 420 AddTwoLinesAndBitmap2, 421 AddView, 338, 424, 584, 585 AddView Menu, 142 Adiquity, 574 AdiQuity, 264 Administrator Library, 456 AdminManager, 456 AdMob, 264, 574 AdMob Advertisements, 595 Advertising, 126 AirplaneModeChanged, 518 Alarms, 138 Allocating Values, 278 Allowed Characters, 115 Allowed Screen Orientation, 129 Alternative to an Activity, 253 Altitude, 479 AltitudeValid, 479 Amazon Appstore, 266 Analytics, 574 Anchors, 148 And, 342 Android 5 Device Compatibility, 126 Android Character Sets, 365 Android Debug Bridge, 187 Android Screen, 121 Android SDK and maven repositories, 597 Android Themes, 126 Android Version, 171 Android Versions, 119 Android Virtual Devices, 189 Android.jar, 108 Android’s View of Services, 253 AndroidSDK$, 113 Animating Bitmaps, 211 Animating your App, 126 Animation, 457 Animation Library, 457 AnotherDatePicker class, 574 AnswerCall, 553 Anywhere Software, 268
Index
Apache Maven Project, 597 APK File, 261 App Design Step by Step, 121 App or Widget ?, 131 Append, 397 Appending to a Map, 383 Application, 341 Application Members, 341 AppLovin, 264 Approve the app on your device, 54 ApproximateScreenSize, 377 ARGB, 343, 581, 582, 583 Array, 305 Array Dimensions are Fixed, 283 Arrays, 281 Arrays of Objects, 283 Asc, 306 ASCII, 366 ASin, 306 ASinD, 306 AsyncStreams, 535 AsyncStreamsText, 574 ATan, 306 ATan2, 306 ATan2D, 306 ATanD, 306 Attachments, 512 Attributes, 111, 567, 571 Audio, 574 Audio Library, 459 AudioRecordApp, 460 Authentication with Facebook or Google Accounts, 595 Auto Hide, 100 AutoCancel, 387 Autocomplete, 83 Autocomplete event subroutines, 84 Autocomplete Properties and Methods, 84 AutoCompleteEditText, 400 AutoFocus, 470 Automatic Conversion of String to Number, 393 AutoRegistration, 552 AutoScale, 168 AutoScale Layouts for Different Sized Devices, 166 AutoScaleAll, 168
37
AutoScaleRate, 167 AVD Name, 190 Azimuth, 478 B4A, 272, 332 B4A 5.80 and later, 575 B4A Designer, 50 B4A Enterprise Version, 102 B4a Object Browser, 269 B4A Site License, 102 B4A Standard Version, 102 B4A’s Language, 272 B4A-Bridge, 48, 185 B4A-Bridge Status Bar, 50 B4AHelp, 270 B4XCipher, 469 B4XEncryption Library, 468 Back, 444 Background, 162, 338, 401, 404, 406, 410, 413, 415, 416, 421, 424, 426, 428, 430, 432, 434, 438, 440, 442, 444, 467, 476 Background Property, 200 Backward Compatible, 120 BASIC, 272 Basic Design Principles, 121 BatteryChanged, 518 BCC, 512 Bearing, 479 BearingTo, 479 BearingValid, 479 Beep, 461 Beeper, 461 Before Android 23, 132 Before B4A 5.80, 575 BeginTransaction, 556 Benefits, 597 Benefits of Classes, 247 Benefits of creating Libraries, 452 Better Uncaught Runtime Exception Handling, 302 Bit, 341 Bitmap, 350, 352, 415, 475 BitmapData, 475 BitmapDrawable, 200, 351 Bitmaps, 199 BitmapsData, 476 Bitwise Operations, 342 Black, 344
38
Block Completion, 86 Blue, 344, 581 Bluetooth Low Energy, 574 BluetoothAdmin, 548 Body, 512, 529 Bookmark Substitute, 91 Boolean, 273 Boolean Operations, 326 Bottom, 360 BOTTOM, 345 Branding and Marketing, 257 Breakpoint, 54 Breakpoint Limitations, 178 Breakpoints, 48, 177 BringToFront, 401, 404, 406, 410, 413, 415, 416, 421, 424, 426, 428, 430, 432, 434, 438, 440, 442, 444, 467, 476 Buffer, 570 Build Configuration, 171 Build Configuration List, 172 BulkTransfer, 566 Button, 404 By Email, 266 Byte, 273 Byte Order Marks, 366 BytesAvailable, 371, 539 BytesToString, 306 CachedName, 506 Call, 517 Call Stack, 179 CallEnded, 552 CallError, 552 CallEstablished, 552 Calling, 552 Calling a sub, 327 Calling a Sub, 295 Calling a Sub from another module, 295 CallItem, 506 CallLog, 507 CallRinging, 552 CallSub, 306 CallSub2, 307 CallSub3, 307 CallSubDelayed, 307 CallSubDelayed2, 307 CallSubDelayed3, 307 CallType, 506
Index
Camera, 469, 574 Camera Library, 469 CameraEx, 574 Cancel, 387 CANCEL, 344 CancelAutoFocus, 470 CancelDiscovery, 549 CancelScheduledService, 307 Cannot Change Dimensions, 282 Canvas, 352, 474, 492 Canvas Object, 203 CaptureBitmap, 445 Case, 331 CASE_INSENSITIVE, 321, 389 Casting, 285 Catch, 307 Caution Name cannot be changed, 115 CC, 512 cE, 308 Ceil, 308 CENTER, 345 CENTER_HORIZONTAL, 345 CENTER_VERTICAL, 345 CenterX, 360 CenterY, 360 Change an Element, 378 Change grid, 144 Changing Text Appearance, 419 Char, 274 CharAt, 395 CharsToString, 308 Charts Framework, 211 Chat Room, 268 Check if a Map contains an entry, 383 Check if the Java JDK is already installed, 102 CheckBox, 406 CheckChanged, 300 Checked, 406, 428, 440 CheckedChange, 428 Checking to see if the driver is already installed, 186 Checking Version-Dependent Compatibility, 120 ChosenName, 586 Chr, 308 Class Circle module, 250
Index
Class module, 247 Class Square module, 250 Class structures, 249 Class_Globals, 236, 485, 504 Classes and Activity Object, 252 Classes Attributes, 452 Classes vs Code Modules, 249 Classes vs Types, 249 Clear, 379, 383, 421, 434 Clear a List, 378 Clear all items from the map, 383 ClearAll, 498, 533 ClearNotification, 498 ClearQueue, 462 Click, 299, 336, 404, 415, 416, 423, 437, 442 ClipPath, 352 Close, 371, 372, 374, 494, 495, 497, 535, 539, 540, 552, 554, 556, 564, 565 CloseFile, 462 CloseMenu, 338 CloseSynchronous, 566 Closing a Module, 80 Code, 38, 80 Code area, 80 Code header, 82 Code module, 252 CodeModule, 235 Color, 338, 401, 404, 406, 410, 413, 415, 417, 421, 424, 426, 428, 430, 432, 434, 438, 440, 442, 445, 467, 476 ColorDialog, 581 ColorDialogHSV, 582 ColorDrawable, 200, 358 ColorPickerDialog, 583 Colors, 327, 343 ColumnCount, 554 Combine, 367 Command Line Compiler, 174 Commenting and uncommenting code, 82 Comments, 85, 272, 273 Common Properties, 148 Commonest View Events, 299 Communicating with your User, 134 CompareTo, 395 Comparison of Process_Globals and Globals Variables, 240
39
Compilation Modes, 172 Compile Options, 71 Compiler Warning, 120 Compiling, 171 Compiling for Android 5.0 Lollipop, 181 Compiling the APK, 263 Compiling your new app, 53 Compiling, Debugging & Testing, 171 Complete, 464, 485, 504 CompressBytes, 538 CompressedStreams, 536 Conditional Compilation, 172, 174 Conditional Manifest Commands, 118 Conditional statements, 288 Configure Paths, 107 Configure the Device, 185 Configure your button, 61 ConfigureHomeWidget, 308 Connect, 143, 495, 550 Connect the Designer to your device., 59 Connect the IDE to the device, 49 Connect2, 550 Connect3, 550 Connected, 495 Connecting the Debugger to a Device or Emulator, 184 Connecting the Device via USB, 185 ConnectInsecure, 550 Connection Status, 143 ConnectivityChanged, 518 Constants, 273, 330, 334, 343 Contact, 508 Contacts, 509 Contacts2, 510 Contains, 395 ContainsKey, 383 ContentChooser, 511 ContentEncoding, 483, 502 ContentLength, 483, 502 ContentResolver, 471 ContentResolver Library, 470 ContentType, 483, 502 ContentValues, 472 Context Menu, 86 Context menus, 160 Continue, 292, 309 ContinueListening, 566
40
Continuing the Run, 56 Controlling Outlining, 81 Controls vs. Views, 326 ControlTransfer, 566 Conventions Used in this Book, 38 Convert Array to List, 378 ConvertToMinutes, 479 ConvertToSeconds, 479 Copy, 367 Copy2, 367 CopyDBFromAssets, 219 Copying a Drawable onto a Canvas, 205 Core Library, 449 Core Object Events, 296 Core Objects, 334 Core Types, 274 CornerRadius, 359 Cos, 309 CosD, 309 Count, 539, 540 Count Records, 228 CountingInputStream, 538 CountingOutputStream, 539 cPI, 309 CPU ABI, 190 CreateEvent, 489 CreateEventFromUI, 489 CreateIntent, 533, 535 CreateMap, 309 CreateNew, 347 CreateObject, 543 CreateObject2, 543 CreateResource, 117 CreateResourceFromFile, 117 CreateTable, 219 Creating a Device Definition, 193 Creating a Menu, 246 Creating a New Key, 262 Creating an AVD, 189 Creating Icons, 258 Creating Libraries, 451 Creating or Adding Modules, 231 Creating or Loading a Private Key, 261 Creating the Page, 243 Creating Tooltips for Subs, 296 Creating Your Own Types, 275 CRLF, 309
Index
CurrentOffsetX, 492 CurrentOffsetY, 492 CurrentPosition, 540 CurrentTab, 438 CurrentUserIdChanged, 462 Cursor, 226, 554 CustomDialog, 584 CustomDialog2, 585 CustomeListView, 574 CustomView, 407 Cyan, 344 DarkGray, 344 Data, 495 Database, 214 Database Creation, 226 Database Administration, 217 Database Files, 216 Database fundamentals, 214 Databases, 214 Date, 348, 507, 529 DateDialog, 585 DateFormat, 348 DateParse, 348 DateTicks, 585 DateTime, 347 DateTimeParse, 348 DateUtils Library, 473 Daydream, 474 Daydream Library, 474 DayOfMonth, 586 Days, 474 DBMS Apps, 217 DBMS Tools, 217 DBUtils, 218, 574 DBUtils Field Types, 219 DBUtils Functions, 219 DBUtils Fundamentals, 218 Debug Menu, 77 Debug Menu Offers More Control, 178 Debug Mode, 173 Debug Window, 55, 179 Debugger Control, 178 Debugging, 47, 176 Debugging Certificates, 261 Debugging Communication Channels, 184 Debugging over a USB Connection, 187 Debugging with USB, 188
Index
Decimal, 589 DecimalChar, 589 Declare SQL Object, 217 Declaring a Sub, 295, 327 Declaring an Array, 281 Declaring Types, 284 Declaring Variables, 277 DecodeBase64, 559 DecodeUrl, 559 DecompressBytes, 538 Decrypt, 469 DEFAULT, 347 Default Modules, 110 Default Type, 281 Default Uncaught Runtime Exception Handling, 301 DEFAULT_BOLD, 347 Defaults, 239 Defining a Build Configuration, 171 Delete, 367, 471, 475 DeleteRecord, 219 DeleteRingtone, 528 Deleting data, 229 Deleting Watches, 180 Density, 309 Description, 565 Designer, 70, 128 Designer Scripting Basics, 164 Designer Scripts, 161 Designer Scripts and Activity Code, 162 Designer Scripts Reference, 162 Designing Your App, 119 DestRect, 475 Detailed explanation of how If-Then-ElseEnd If works, 288 Detecting Device Orientation, 129 Device, 190 DeviceClass, 565 DeviceDefaultDateFormat, 348 DeviceDefaultTimeFormat, 348 DeviceFound, 548 DeviceId, 565 DeviceName, 565 DeviceStorageLow, 519 DeviceStorageOk, 519 DeviceSubclass, 565 Diagrams Charts, 211
41
DialogResponse, 344 Dialogs Library, 137, 579 Differences between B4A and Visual Basic, 289, 291, 292, 294 Different Layouts for Portrait and Landscape, 168 Digits, 589 Dim, 310, 326 Dim Statement, 277 Dimensions, 281 dip, 163 dips, 130 DipToCurrent, 131, 310 DirAssets, 368 DirDefaultExternal, 368 Direction, 567 DirInternal, 368 DirInternalCache, 368 DirRootExternal, 368 Disable, 456, 549 DisableAccessibility, 339 Disconnect, 143, 550 Discovering the API of the current device, 121 DiscoveryStarted DiscoveryFinished, 548 DismissDropDown, 401 DisplayName, 508, 552 DistanceTo, 479 Distributing Apps elsewhere, 266 Divide by Zero, 330 Do not add too many variants, 152 Dock and Fill Strategy, 164 Docking, 94, 96 Docking a Module, 96 Docking Windows, 98, 99, 142 Does the device have a keyboard?, 131 DoEvents, 310, 328 Double, 274 Do-Until, 294 Do-While, 293 Do-While may not be executed, 293 Down, 404 Download, 486, 505 Download and install B4A, 107 Download B4A Trial, 45 Download2, 486, 505 Downloading from a website, 266
42
Downloading User Libraries, 579 dpi dots per inch, 163 Dragging Windows, 96 Drawable, 150 Drawables, 200 DrawBitmap, 207, 353 DrawBitmapFlipped, 353 DrawBitmapRotated, 207, 354 DrawCircle, 207, 354 DrawColor, 208, 354 DrawDrawable, 354 DrawDrawableRotate, 355 Drawing Methods, 199 Drawing Objects, 334, 350 Drawing onto a Canvas, 204 DrawLine, 208, 355 DrawOval, 355 DrawOvalRotated, 355 DrawPath, 356 DrawPoint, 356 DrawRect, 208, 356 DrawRectRotated, 208, 356 DrawText, 208, 357 DrawTextRotated, 208, 357 DreamStarted, 474 DreamStopped, 474 DropBox Sync, 575 DropdownBackgroundColor, 435 DropdownTextColor, 435 Dropping a Table, 227 DropTable, 219 Duration, 385, 458, 464, 467, 507 Edit Menu, 68 Editing Code using the Rapid Debugger, 177 Editing Settings, 127 Editing the Manifest, 120 Editing Views in a program, 169 Editor Warnings of Undeclared Variables, 277 EditText, 410 Elevation, 424, 478 ElseIfEndIf, 327 Email, 512 EMAIL_CUSTOM, 508 EMAIL_HOME, 508 EMAIL_MOBILE, 508
Index
EMAIL_OTHER, 508 EMAIL_WORK, 508 Emulation Options, 192 Emulator or Android Virtual Device Manager, 188 Enable, 456, 549 Enabled, 399, 401, 404, 406, 410, 413, 415, 417, 421, 424, 426, 428, 430, 432, 435, 438, 440, 442, 445, 456, 467, 476 EncodeBase64, 559 EncodeUrl, 559 Encrypt, 469 Encrypting Databases, 216 EndCall, 553 EndElement, 572 End-of-Line Character, 366 EndpointCount, 568 EndpointNumber, 567 EndsWith, 395 EndTransaction, 556 EngineDestroyed, 493 EnterPressed, 401, 410 EqualsIgnoreCase, 395 Error, 535 Error converting Floating Point numbers to Strings, 275 Error converting String to Int, 275 Error Handling, 301 Error message “Are you missing a library reference?”, 450 Error Trapping, 332 ErrorMessage, 486, 505 Escaping end of string characters, 116 Escaping XLM HTML, 394 Event, 428, 434, 440, 460 Event AnimationEnd, 457 Event Complete, 385, 467 Event Connected, 495, 550 Event LogCatData, 513 Event MessageReceived, 529 Event NewConnection, 494 Event NewData, 566 Event PacketArrived, 497 Event PickerResult, 527 Event Ready, 562 Event RecordComplete, 466 Event Result, 512, 531
Index
Event SensorChanged, 522 Event Tick, 398 Example, 130, 169, 218, 247, 297, 307, 309, 399, 433, 487, 543, 562 Example 1, 598 Example 2, 598 Example Code, 201 Example of a UI Cloud screen, 145 Example Program, 208 Example Project, 203 Examples, 112, 312 Examples of Java Regex Constructs, 287 Excel, 575 Exception, 362 Exceptions, 301 Exchanging files with the PC, 197 ExecNonQuery, 557 ExecNonQuery2, 557 ExecNonQueryBatch, 557 ExecQueries and ExecNonQueries, 225 ExecQuery, 557 ExecQuery2, 557 ExecQueryAsync, 229, 557 ExecQuerySingleResult, 558 ExecQuerySingleResult2, 558 Execute, 481, 500 ExecuteCredentials, 481, 500 ExecuteHtml, 220 ExecuteJSON, 220 ExecuteListView, 220 ExecuteMap, 221 ExecuteMemoryTable, 221 ExecuteSpinner, 222 Exists, 368 Exit, 292, 310, 327 Exit a Loop, 294 Exit Sub, 328 ExitApplication, 311 Explanation of Sub’s name, 65 Expressions and Operators, 285 ExternalReadable, 368 ExternalWritable, 368 ExtrasToString, 375 Facebook, 269 False, 311 FastScroll, 587 FastScrollEnabled, 421
43
Field, 214 Field Type, 215 File, 192, 311, 367 File Menu, 68, 142 File Object, 362 File Objects, 335 File.DirAssets, 363 File.DirDefaultExternal, 364 File.DirInternal, 363 File.DirInternalCache, 363 File.DirRootExternal, 364 FileDialog, 586 FileFilter, 587 Filenames, 362 FilePath, 587 Files Manager, 88 Files Window, 155 FILL, 345 Filling an array using the Array keyword, 282 Filtering, 228 Find, 317 Find All References, 90 FindByMail, 509, 510 FindByName, 509, 511 Finding Additional Libraries, 573 Finding Your Folder Locations, 364 Finish, 339, 474 Firebase RemoteConfig, 575, 596 Firebase Services, 594 FirebaseAnalytics Analytics & crash reports, 595 FirstTime parameter, 242 Fixing Order in a Map, 383 Flags, 375 Flip, 475 FLIP_BOTH, 475 FLIP_HORIZONTALLY, 475 FLIP_NONE, 475 FLIP_VERTICALLY, 475 Float, 274 Floating, 94 Floor, 311 Flush, 371, 374, 540 FocusChanged, 401, 410 FocusDone, 469 Folder locations on Device, 363
44
For, 311 For – Next, 291 For Each, 311 For the Beginner, 37 For the Professional, 37 For…Next, 327 ForceDoneButton, 401, 410 For-Each, 292 Foreword by Erel Uziel, 36 Format, 328 Formatting Date and Time, 394 Formatting Numbers, 393 Forum, 268 Forward, 445 Free Upgrades, 41 FromParts, 473 Front Back Camera, 191 Fulfilling Wants and Needs, 119 FullScreen, 474 FullScroll, 413, 430 FullWallpaperHeight, 492 FullWallpaperWidth, 492 Functions, 328 GamePad, 575 GameView, 476 GameView Library, 475 General, 334 Generate Members, 62, 143 Generating Exceptions, 394 Generating Your APK, 261 Get, 379, 383 Get the size of a List, 378 GetAccessories, 568 GetActiveNotifications, 498 GetActivity, 543 GetActivityBA, 543 GetAll, 507, 510, 511, 530, 534 GetAllSince, 530 GetAllViewsRecursive, 339, 424 GetApplicationIcon, 513 GetApplicationIntent, 513 GetApplicationLabel, 513 GetArray, 543 GetAsTextType, 499 GetAsUriType, 499 GetAsynchronously, 483, 502 GetB4AClass, 544
Index
GetBetweenDates, 530 GetBitmap, 486, 505 GetBlob, 554 GetBlob2, 554 GetBoolean, 534 GetById, 508, 510, 511 GetByPersonId, 530 GetBytes, 395 GetByThreadId, 530 GetByType, 530 GetColumnName, 554 GetContactsAsync, 511 GetContactsByQuery, 511 GetContext, 544 GetData, 375 GetDataState, 514 GetDayOfMonth, 348 GetDayOfWeek, 349 GetDayOfYear, 349 GetDBVersion, 222 GetDefault, 384, 528 GetDeviceId, 520 GetDeviceLayoutValues, 312 GetDevices, 568 GetDouble, 554 GetDouble2, 555 GetEmails, 508 GetEnd, 317 GetEndpoint, 568 GetExtra, 375 GetField, 489, 544 GetField2, 544 GetFieldInfo, 544 GetFieldJO, 489 GetHeaders, 483, 503 GetHour, 349 GetHtmlIntent, 512 GetInputStream, 483, 486, 503, 505 GetInstalledPackages, 513 GetInt, 555 GetInt2, 555 GetIntent, 512 GetInterface, 565 GetItem, 421, 435 GetKeyAt, 384 GetLine1Number, 520 GetLong, 555
Index
GetLong2, 555 GetMaxVolume, 514 GetMethod, 544 GetMinute, 349 GetMonth, 349 GetMostCurrent, 544 GetMyIP, 494 GetMyWifiIP, 494 GetName, 571 GetNdefRecords, 499 GetNetworkOperatorName, 514 GetNetworkType, 514 GetPairedDevices, 550 GetPaletteAt, 583 GetPayload, 499 GetPhones, 508 GetPhoneType, 514 GetPhoto, 508 GetPixel, 350 GetProcessBA, 544 GetProxy, 544 GetPublicField, 545 GetRawDescriptors, 567 GetRequest, 486, 505 GetResourceDrawable, 514 GetRingerMode, 515 GetSecond, 349 GetSettings, 515 GetSimOperator, 515 GetSimSerialNumber, 520 GetSince, 508 GetStart, 317 GetStartingIntent, 339 GetStaticField, 545 GetString, 484, 486, 503, 505, 534, 555 GetString2, 486, 505, 555 GetSubscriberId, 520 getTabContentViewPadding, 591 getTabEnabled, 591 getTabHeight, 591 getTabHostPadding, 591 getTabTextSize, 591 getTabVisibility, 591 GetText, 368 GetTimeZoneOffsetAt, 349 Getting More Help, 268
45
Getting More Help with Regular Expressions, 288 Getting Started, 44 GetType, 312 GetUnreadMessages, 530 GetUpdatedKeys, 534 GetUserFontScale, 455 GetValue, 571 GetValue2, 571 GetValueAt, 384 GetVersionCode, 514 GetVersionName, 514 GetView, 339, 424 GetVolume, 515 GetYear, 349 Global Const, 327 Google API Project, 596 Google Maps, 575 Google Play Developer Console, 266 Google Play Services, 575 Google Play Store Icon, 257 Google Play URL, 115 GPS, 477 GPS Library, 477 GPSEnabled, 478 GPSSatellite, 478 GpsStatus, 477 GradientDrawable, 200, 359 Graphics and Drawing, 199 Gravity, 344, 352, 401, 404, 406, 410, 415, 417, 428, 440 Gray, 344 Green, 344, 581 Group, 317 GroupCount, 318 HandleAction, 487 HandleIntent, 498 HandleWidgetEvents, 390 Handling Long Lists, 137 Handling Modal Dialogs when your App Pauses, 138 HasAccessoryPermission, 568 HasExtra, 375 HasPermission, 568 HDPI, 260
46
Height, 339, 351, 377, 401, 405, 406, 410, 413, 415, 417, 421, 424, 426, 428, 430, 432, 435, 438, 440, 442, 445, 467, 476 HeightChanged, 487 Help Menu, 78 Hex Literals, 274 HideKeyboard, 488, 515 Highlighting occurrences of words, 87 Hint, 401, 411, 588 HintColor, 401, 411, 588 Holo Theme, 182 Horizontal Tab Group, 95 HorizontalScrollView, 413 Host, 495 HostAddress, 496 Hour, 590 Hours, 474 Hovering, 180 Hovering over Collapsed Code, 81 How AutoScale works, 167 How B4A interacts with Emulated Devices, 188 How the Rapid Debugger Works, 177 How this Book is Organized, 37 How to Access Process_Globals Variables, 238 How to Compile a Library, 453 How to create a library, 579 How to Detect the Display Size, 129 How to manage files, 197 How to publish your library, 453 How to See the Effect of AutoScale, 167 How to See the Effect of AutoScale on Text Size, 167 How to Share your Library, 579 How to Start a Service, 253 How to upgrade, 189 How to use a library, 579 How to use a List, 377 How to use a Map, 382 How to Use AutoScale, 167 How variants are shown in Abstract Designer, 152 HTTP Library, 480 HttpClient, 480 HttpJob, 485, 504 HttpRequest, 481
Index
HttpResponse, 482 HttpServer, 576 HttpUtils2 Library, 484 Hue, 582 Hungarian Notation, 280 Icon, 387 Icon Sizes, 259 Icons, 67, 124 Id, 498, 507, 509, 529 IDE Meta File, 93 IDE Options Sub-Menu, 76 If, 312 If – Then, 288 If you already have JDK 64 Bit, 103 If-Then-Else-End If, 288 If-Then-End If, 288 Ignoring Warnings, 92 ImageView, 414 IME, 487 IME Library, 487 Immutable Strings, 391 Implementing a Database Relationship, 229 Implementing MipMap, 259 Importing a Bitmap file into Canvas, 205 In the main module, 251 In-App Billing, 264 Include Quotation Marks, 392 Including AAR libraries in B4A Apps, 598 Indentation, 82 Indeterminate, 426 Index, 599 IndexOf, 379, 395, 435 IndexOf2, 396 Initialization of Objects, 276 Initialization of Process_Globals, 237 Initialize SQL Object, 218 Initialize2, 351, 358, 359, 372, 374, 376, 379, 385, 430, 461, 470, 479, 491, 496, 523, 529, 540, 552 Initialize3, 351, 540 InitializeAcceptAll, 481, 501 InitializeAlpha, 458 InitializeArray, 489 InitializeContext, 489 InitializeDelete, 482, 501 InitializeFromBytesArray, 371
Index
InitializeGet, 482, 501 InitializeHead, 482, 501 InitializeMutable, 351 InitializeNewInstance, 490 InitializePost, 482, 501 InitializePost2, 482, 501 InitializePrefix, 536 InitializePut, 482, 501 InitializePut2, 482, 502 InitializeRotate, 458 InitializeRotateCenter, 458 InitializeSample, 351 InitializeScale, 458 InitializeScaleCenter, 458 InitializeStatic, 490 InitializeToBytesArray, 372 InitializeTranslate, 459 InitializeWithPhoneState, 520 Initializing a Canvas, 203 Initializing a Recursive Type, 285 Inline Code, 447 Input, 588 INPUT_TYPE_DECIMAL_NUMBERS, 402, 411, 588 INPUT_TYPE_NONE, 402, 411, 588 INPUT_TYPE_NUMBERS, 402, 411, 588 INPUT_TYPE_PHONE, 402, 411, 588 INPUT_TYPE_TEXT, 402, 411, 588 InputBox, 328 InputDialog, 587 InputList, 135, 312 InputMap, 136, 313 InputMultiList, 135, 314 InputStream, 370, 565 InputStream.io.InputStream, 495, 551 InputStreamToBytes, 342 InputType, 402, 411, 588 Insert, 397, 471 InsertAsync, 471 InsertAt, 379 InsertMaps, 223 Insistent, 387 Install and configure B4A, 106 Install and Run the Trial, 45 Install from APK, 187 Install required SDKs, 104 Install the 32 bit Java JDK, 103
47
Install the Android SDK and a platform, 103 Install the B4A-Bridge app on your device, 48 Install the SDK Manager, 103 Install the USB Driver, 186 Installation, 103 Installing .NET Framework, 45 Installing DBUtils, 218 Installing from the APK, 120 Installing Icons, 260 Installing the Trial Version, 45 Instr, 332 Int, 274 Integrating Firebase Services into B4A, 594 Intent, 375 Interacting with your Virtual Device, 195 Interactive, 474 InterfaceClass, 568 InterfaceCount, 565 InterfaceProtocol, 568 InterfaceSubclass, 568 Internal Storage, 192 Interval, 399, 567 Introduction, 37, 188, 449, 454, 573, 578, 598 Invalidate, 339, 402, 405, 406, 411, 413, 415, 417, 421, 424, 427, 428, 430, 432, 435, 439, 440, 442, 445, 467, 476 Invalidate2, 339, 402, 405, 406, 411, 413, 415, 417, 421, 424, 427, 429, 430, 432, 435, 439, 440, 442, 445, 467, 476 Invalidate3, 339, 402, 405, 407, 411, 414, 416, 417, 422, 425, 427, 429, 431, 432, 435, 439, 441, 442, 445, 467, 476 InvokeMethod, 545 Is, 315 Is24Hours, 590 IsAirplaneModeOn, 515 IsBackgroundTaskRunning, 315 IsDevTool, 315 IsDirectory, 368 IsEnabled, 549, 551 IsHardwareAccelerated, 476 IsInCall, 553
48
IsInitialized, 318, 340, 347, 351, 352, 359, 360, 361, 362, 371, 372, 373, 374, 376, 379, 384, 387, 397, 400, 402, 405, 407, 412, 414, 416, 417, 422, 425, 427, 429, 431, 432, 435, 439, 441, 443, 445, 459, 462, 464, 467, 473, 474, 476, 478, 480, 481, 486, 490, 491, 492,494, 495, 496, 497, 498, 499, 501, 505, 512, 536, 539, 540, 549, 551, 553, 555, 558, 563, 564, 566, 567, 568, 570, 571 IsMatch, 321, 389 IsMatch2, 321, 390 IsMuted, 553 IsNdefIntent, 499 IsNetworkRoaming, 515 IsNull, 545 IsNumber, 315 IsPaused, 315 IsPlaying, 385, 464, 468 IsPreview, 492 IsSipSupported, 553 IsSupported, 531 IsVisible, 492 IsVoipSupported, 553 ItemClick, 401, 420, 434 ItemLongClick, 420 Iterate a List, 378 Iteration, 382 Java JDK and Android SDK Installation, 102 Javac.exe, 108 JavaObject, 489 JavaObject Library, 488 JavaScriptEnabled, 445 JetPlayer, 461 JobName, 486, 505 JSch, 576 JSON Library, 490 JSONGenerator, 491 JSONParser, 491 JTidy, 576 KeepAlive, 526 Key Concepts, 162 Keyboard, 191 KeyboardPopUp, 587 KeyCodes, 345 KeyPress, 300
Index
KeyPress and KeyUp, 242 KeyPress and KeyUp Events, 336 Keys, 384 Keys and Certificates, 261 KeyStore, 262 Keystore Explorer, 263 KeyValueStore, 576 KeyValueStore Class, 216 Keywords, 305 Label, 416 LabelName, 341 Language, 531 LastException, 315 LastIndexOf, 396 LastIndexOf2, 396 LastModified, 369 LastTimeContacted, 509 Latitude, 480 Launcher Icon, 257 Layout, 128 Layouts, 141 LayoutValues, 129, 376 Left, 340, 361, 402, 405, 407, 412, 414, 416, 417, 422, 425, 427, 429, 431, 432, 435, 439, 441, 443, 445, 468, 476 LEFT, 345 Left$ and Right$, 331 Legacy Debugging, 177 Legacy vs Rapid Debugger, 48 Len, 331 Length, 396, 397, 496 Length of an Array, 283 Lexical Rules, 272 Libraries, 449 Libraries Manager, 87 Libraries Supporting Advertising, 263 Library and Tutorial, 264 Library Browsers, 269 Library compilation attributes, 114 Library specific attributes, 452 License, 107, 579 Licensing, 265, 577 Lifetimes of Process_Globals Variables, 237 Light, 387 LightGray, 344 Limitations of Classes, 252
Index
Limitations of the Rapid Debugger, 176 LineTo, 360 Linked In, 269 List, 377 List of Additional Libraries, 573 List of Core Objects, 334 List of libraries, 579 List of Standard Libraries, 454 List of types, 455, 456, 457, 459, 469, 471, 474, 475, 477, 480, 487, 491, 492, 493, 499, 500, 532, 535, 542, 548, 551, 554, 559, 564, 571, 581 Listen, 494, 531, 551 Listen2, 551 ListenInsecure, 551 ListenToExternalTimeChanges, 349 ListFiles, 369 Lists, 283 ListView, 418, 419 LiveWallpaper Library, 492 Load, 385, 464 Load the Layout, 65 LoadBitmap, 316 LoadBitmapSample, 316 LoadCSV, 559 LoadCSV2, 560 LoadFile, 462 LoadFromAssets, 347 LoadHtml, 445 LoadLayout, 340, 425 LoadUrl, 446 LoadVideo, 468 Local Variables, 240 Local variables in Subs, 236 Location, 479 Location of Database, 219 LocationChanged, 477 LocationSettingsIntent, 478 LockScreen, 456 Log, 316 Logarithm, 316 LogCat, 513 LogCatStart, 513 LogCatStop, 513 Logging, 181 Logging Events, 56 Logical Operators, 286
49
Logs Window, 90 Long, 274 LongClick, 299, 336, 404, 415, 416, 423, 437, 442 Longitude, 480 Loop, 328 Loop structures, 291 Looping, 385, 464 Loops, If-Then, Select Case, 327 LWEngine, 492 LWManager, 493 Mac Keyboard Shortcuts, 196 Magenta, 344 Main Activity Excluded, 452 Main Module, 110 Main Properties, 147 MakeCall, 553 MakeDir, 369 Making the Canvas Draw Itself, 206 Managing Permissions, 132 Managing Settings, 127 Manifest, 115 Manifest commands, 116 Manifest Editor, 115 Manifest Typing, 225 Manufacturer, 515, 565 Map, 381 Maps, 284 Match, 318 Match Chosen Variant, 159 Matcher, 316, 321, 390 Matcher Groups, 316 Matcher Methods, 317 Matcher Object, 389 Matcher2, 321, 390 Material Design, 181 Material Themes in WYSIWYG Designer, 182 Mathematical expressions, 285 Maven artifacts, 597 Maven Repositories, 597 Max, 318, 432 Max and Min Values, 228 MaximumTimeToLock, 457 MaxPacketSize, 567 MaxTracks, 462 MaxValue, 523
50
MDPI, 260 Me, 318 Meaningful names, 272 MeasureMultilineTextHeight, 560 MeasureStringHeight, 358 MeasureStringWidth, 358 MediaControllerEnabled, 468 MediaPlayer, 385 MediaPlayerStream, 463 Member, 517 Memory Options, 191 Menu, 125 Menu Overlay, 128 Merchant Account, 265 Message, 362 Methods, 166 Min, 318 Minute, 590 Minutes, 474 Missing Tabs, 189 Modal Dialogs, 134 Model, 515, 565 Module Attributes, 232, 452 Module Menu, 94 Module Tabs, 79 Modules, 70, 110, 231 Modules Containing Process_Globals, 237 Modules Window, 89 Monetising Your App, 263 Monitor dpi, 195 MONOSPACE, 347 Month, 586 Months, 474 More about Debugging, 57 More about Designer, 66 More about Google APIs for Android, 595 More about Regex, 389 More Advice, 126 More Complex Examples, 210 More information, 118 More Information, 246, 596 More Information on SQLite, 225 Most common Canvas functions, 207 Moving a Tab Group, 99 Msgbox, 134, 318 MsgBox, 329 Msgbox2, 134, 318
Index
MtpDevice, 564 Multiline, 312 MULTILINE, 321, 390 Multi-line String, 392 Multiple activities, 128 Multiple Activity Modules, 246 Multiple Variants, 151 Mutable Strings, 303, 392 myClass module, 235 Name, 509, 551, 570 Naming, 295 Naming of Variables, 280 Navigate Backward Forward, 91 Navigation Bar, 121 Navigation Drawer, 126 Navigation Tree, 122 NdefRecord, 499 NEGATIVE, 344 Net, 577 Network Library, 493 New, 142 New Variant, 151 NewData, 535 Newer Method, 576 Newsletter, 41 NextArray, 491 NextObject, 491 NextValue, 492 NFC, 499 NFC Library, 499 NinePatchDrawable, 203 NMEA, 478 No Home Screen Widget Libraries, 453 No Option Explicit, 277 No Scaling, 195 NO_GRAVITY, 345 Non-integer Iterators, 291 Non-Primitive Types, 274 NonQueryComplete, 556 Normalized Variants, 152 Not, 319, 326, 342 Note that SQLite is Different, 215 Notes, 107, 118, 509, 542, 580 Notes on Starter Service, 110 Notes on Wireless Connection, 49 Notification, 386, 498 Notification Icon Recommendations, 259
Index
NotificationListener Library, 497 Notifications, 121, 138, 255 Notifications Push messages, 595 Notify, 387 Now, 349 Null, 319 Number, 387, 507, 589 Number formatting, 304, 392 NumberDialog, 589 NumberFormat, 319 NumberFormat2, 319 NumberOfViews, 340, 425 OAuth, 577 Objects, 275 Offset, 496 OffsetChanged, 493 OkHttp Library, 500 OkHttpClient, 500 OkHttpRequest, 501 OkHttpResponse, 502 OkHttpUtils2 Library, 503 Older Method, 575 OnGoingEvent, 388 On-line Documentation, 269 On-line Link, 456 On-Line Tutorials, 269 Open, 142, 564 Open B4A, 107 OpenAccessory, 568 OpenBrowser, 520 OpenDevice, 568 Opening the Channel, 184 OpenInput, 369 OpenMenu, 340 OpenOutput, 369 Options, 389 Or, 342 Ordering, 228 Other Activity Attributes, 239 Other App Publishers, 266 Other Examples, 281 Other Keywords, 166 Other Properties, 166 Out of Memory Errors, 212 OutboundProxy, 553 Output, 453 OutputQueueSize, 536
51
OutputStream, 371, 565 OutputStream.io.OutputStream, 495, 551 Overflow, 124 Overlays, 128 OverrideUrl, 444 Package name, 114 Package Name, 257 Package Options, 71 PackageAdded, 519 PackageManager, 513 PackageName, 341, 499 PackageRemoved, 519 PageFinished, 444 Palette, 583 Panel, 414, 423, 431, 474 Parameterize the Command, 228 Parameters, 295 Parent, 443 Parents, 572 Parse, 473, 572 Parse2, 572 ParseId, 473 ParseInt, 342 Part 1 Basics, 43 Part 2 Creating Your App, 109 Part 3 Language and Core Objects, 271 Part 4 Libraries, 448 Part 5 External Tools and Services, 593 PartialLock, 526 Pass by Reference, 279 Pass by Value, 278 Password, 486, 505 PASSWORD_QUALITY_ALPHABETIC, 457 PASSWORD_QUALITY_ALPHANUMERI C, 457 PASSWORD_QUALITY_NUMERIC, 457 PASSWORD_QUALITY_UNSPECIFIED, 457 PasswordMode, 402, 412, 588 PasswordSufficient, 457 Path, 360 Pause, 385, 462, 464, 468 PayPal, 577 PC Keyboard Shortcuts, 196 PDF Guides, 269 PeerUri, 554
52
Percentage of Activity, 131 Period, 473 Permission android.permission.INTERNET, 497 PermissionResult, 336 Permissions, 387, 444, 463, 469, 477, 480, 494, 495, 499, 500, 507, 509, 510, 513, 517, 520, 524, 525, 526, 527, 529, 530, 548, 550, 552 PersonId, 529 PerXToCurrent, 131, 319 PerYToCurrent, 320 Phone, 514 Phone Library, 506 PHONE_CUSTOM, 509 PHONE_FAX_HOME, 509 PHONE_FAX_WORK, 509 PHONE_HOME, 509 PHONE_MOBILE, 509 PHONE_OTHER, 509 PHONE_PAGER, 509 PHONE_WORK, 509 PhoneAccelerometer, 517 PhoneCalls, 517 PhoneEvents, 518 PhoneId, 520 PhoneIntents, 520 PhoneNumber, 509 PhoneOrientation, 521 PhoneSensors, 521 PhoneSms, 524 PhoneStateChanged, 519 PhoneVibrate, 525 PhoneWakeState, 525 PictureTaken, 469 Pitch, 563 Pixel, 162 Placeholder Calculations, 393 Play, 385, 462, 464, 465, 468, 528 Play Store Compatibility Check, 120 PlayAudio, 521 PlayVideo, 521 Polymorphism, 250 Popularity of Android Versions, 119 Popup Module Tab Menu, 80 Popup Variable Evaluation, 55 Port, 496, 497, 553
Index
Position, 386, 468, 555 POSITIVE, 344 PostBytes, 486, 505 PostFile, 486, 505 PostString, 486, 505 Power, 320 Preface, 37 PreferenceActivity Library, 532 PreferenceActivity Limitations, 532 PreferenceCategory, 532 PreferenceManager, 533 PreferenceScreen, 534 Preliminary SQL Steps, 218 Prepare Your App’s Google Play Page, 265 Preparing the User’s Device, 266 Preparing Your Library, 452 Prescribed Resolutions, 260 Preview, 469 Primary Key, 215 Primitive Types, 273 Private Variables, 233 Prn, 478 Problems Opening the Channel, 184 Process, 231 Process_Globals, 110 Process_Globals in Starter Service, 237 Process_Globals Variables, 237 Processing the SQL, 228 Product, 515 ProductId, 566 ProfileName, 553 Progress, 427 ProgressBar, 139, 426 ProgressDialog, 139 ProgressDialogHide, 320 ProgressDialogShow, 320 ProgressDialogShow2, 320 Project attributes, 452 Project Attributes, 111, 257 Project Attributes Region, 82 Project Icon, 114 Project Menu, 70 Prompt, 435, 531 Properties Help area, 150 Properties list, 146 Properties Window, 146 Properties Within Scripts, 165
Index
Protocol, 553 Public Variables, 233 Public vs Private Subs, 249 Public vs Private Variables, 248 Publishing and Monetizing Your App, 257 Purchase, 102 Put, 384 PutBoolean, 473 PutByte, 473 PutBytes, 473 PutDouble, 473 PutExtra, 376 PutFloat, 473 PutInteger, 473 PutLong, 473 PutNull, 473 PutShort, 473 PutString, 473 Query, 471 QueryAsync, 472 QueryComplete, 556 QueryIntentActivities, 514 Queue, 570 QueuedSegmentsCountChanged, 462 QueueSegment, 462 Quick Search, 90 QUOTE, 320 RadioButton, 428 RAM, 191 Random Numbers, 329 RandomAccessFile, 540 RandomAccessFile Library, 535 Randomize, 329 Rank, 275 Rapid debugging, 176 RatingBar, 570 Reacting to an Event, 296 Read, 373, 529 ReadAll, 373 ReadBytes, 371, 539, 541 ReadDouble, 541 ReadEncryptedObject, 541 ReadFloat, 541 Reading and Writing Excel Files, 366 ReadInt, 541 ReadLine, 373 ReadList, 369, 373
53
ReadLong, 541 ReadMap, 370 ReadMap2, 370 ReadObject, 541 ReadShort, 541 ReadSignedByte, 541 ReadString, 370 ReadUnsignedByte, 541 Ready, 373, 469 Record, 214, 461, 466 RecordComplete, 460 Rect, 360, 492 Recursive Types, 284 Red, 344, 581 ReDim, 326 Reference, 309 Reference SQL Library, 217 Reference to Non-Primitives, 274 Referencing Libraries, 450 Reflection Library, 542 Reflector, 542 Refresh, 492 RefreshAll, 492 Regex, 320, 388 Regex Methods, 321 Regex Options, 321 Regions, 81 Register, 553 Register as a Google Play Developer, 265 Registering, 552 Registering as a Google Play Developer, 265 Registering B4A, 102 RegistrationDone, 552 RegistrationFailed, 552 Regular Expressions, 287 Relational Data, 215 Relational Operators, 286 Release, 173, 386, 461, 462, 464, 465, 470, 484, 486, 503, 505, 563 Release Mode, 173 ReleaseKeepAlive, 526 ReleasePartialLock, 526 Remote Compilation, 54 Remote Compilation Mode, 50 RemoteViews, 390 Remove, 89, 384, 397, 473
54
Remove an entry, 383 Remove Elements, 378 Remove Layout, 142 RemoveAllViews, 340, 425 RemoveAt, 379, 422, 435 RemoveClip, 358 RemoveHeaders, 482, 502 RemovePermission, 118 RemoveView, 403, 405, 407, 412, 414, 416, 417, 422, 425, 427, 429, 431, 432, 436, 439, 441, 443, 446, 468, 476 RemoveViewAt, 340, 425 Rename a table, 229 Renaming of Variables, 173 REPEAT_RESTART, 459 REPEAT_REVERSE, 459 RepeatCount, 459 Repeating Structures, 327 RepeatMode, 459 Replace, 331, 396 RequestAccessoryPermission, 568 RequestFocus, 340, 403, 405, 407, 412, 414, 416, 417, 422, 425, 427, 429, 431, 433, 436, 439, 441, 443, 446, 468, 476 RequestNewPassword, 457 RequestPermission, 569 RerunDesignerScript, 340 Reset, 157 ResetPalette, 583 ResetPassword, 457 Resolution, 162 ResolveHost, 495 Resources, 41 Response, 582, 583, 584, 585, 586, 587, 588, 589, 590 Response Codes, 580 ResponseError, 481, 500 ResponseSuccess, 481, 500 Restart, 176 Restoring All Windows, 101 Restricting the Drawing Area, 207 Restriction of Process_Globals Variables, 238 Restrictions, 307 Resume, 465 Retrieve Elements, 378 Retrieve Entry, 382
Index
Retrieving data, 228 Return, 321 Returned value, 296 Returning Data to B4A, 447 Returning from an Activity, 128 Revision Color Coding, 81 RGB, 344, 582, 584 Right, 361 RIGHT, 345 RINGER_NORMAL, 515 RINGER_SILENT, 515 RINGER_VIBRATE, 515 RingtoneManager, 526 Rnd, 321, 329 RndSeed, 321, 329 Rotate, 475 Rotating Device, 238 Rotating the Device, 57 Rotating the Emulator, 154 Round, 321, 329 Round2, 321 RowCount, 556 Run B4A-Bridge on your device, 48 Run SDK Manager, 104 Run your app, 65 RunMethod, 490, 545 RunMethod2, 545 RunMethod3, 545 RunMethod4, 545 RunMethodJO, 490 Running a Virtual Device and scaling for Real Size Emulation, 194 Running from Batch Files, 174 Running Scripts, 162 Running the Designer, 58 RunPublicmethod, 546 RunStaticMethod, 546 Runtime Errors, 301 Runtime Permissions, 132 Sample DBUtils Program, 224 Sample Projects Using Services, 256 Sample SQLite Program, 225 SANS_SERIF, 347 Saturation, 583 Save, 142 Save the program, 48 Save to and Load from a File, 383
Index
Save to and Load from Files, 378 SaveCSV, 560 SaveCSV2, 561 Saving and Retrieving Data, 282 Saving and Retrieving Settings, 127 Saving Data, 244 Saving Permanent Data, 244 Saving Temporary Data, 244 Sax, 571 SaxParser, 572 Scale, 163, 377 Scale display to real size, 195 Scaling strategy, 168 Screen Size, 163, 195 ScreenBright, 475 ScreenHeight, 492 ScreenOff, 519 ScreenOn, 519 Screens and Layouts, 128 ScreenWidth, 493 Script General, 156 Script Language, 164 Script Toolbar, 156 Script Variant, 156 Script Windows, 155 ScrollingBackgroundColor, 422, 587 ScrollPosition, 414, 431 ScrollToNow, 414, 431 ScrollView, 429 SD Card, 192, 364 SDK Extras, 105 SdkVersion, 515 SearchView, 577 Seconds, 474 SeekBar, 431 Select, 322 Select – Case, 289 SelectAll, 403, 412 SelectedIndex, 436 SelectedItem, 436 Selecting Variants, 164 Selecting views, 160 SelectionStart, 403, 412 Self reference, 251 Selling Your App, 264 Send, 497, 524 Send To UI Cloud, 145
55
Send2, 525 SendBroadcastIntent, 515 SendDtmf, 554 Sender, 322 SendKeepAlive, 553 SendToBack, 340, 403, 405, 407, 412, 414, 416, 417, 422, 425, 427, 429, 431, 433, 436, 439, 441, 443, 446, 468, 476 Serial, 549, 565, 567 Serial Library, 548 SERIF, 347 ServerSocket, 494 Service, 391 Service Attributes, 82, 254 Service Code, 253 Service Module, 252 Set, 379 SetActivityAttribute, 118 SetActivityResult, 340 SetApplicationAttribute, 118 SetArray, 546 SetArray2, 546 SetBackgroundImage, 341, 403, 405, 407, 412, 414, 416, 418, 422, 425, 427, 429, 431, 433, 436, 439, 441, 443, 446, 468, 477 SetBoolean, 534 SetColorAnimated, 443 SetComponent, 376 SetContentDescription, 455 SetContentEncoding, 482, 502 SetContentType, 482, 502 SetCustomFilter, 488 SetDate, 586 SetDBVersion, 223 SetDefault, 528 SetElevationAnimated, 425 SetField, 490, 546 SetField2, 546 SetField3, 546 SetField4, 546 SetFocus, 329 SetHeader, 482, 502 SetHttpParameter, 481, 501 SetImage, 390 SetInfo, 388 SetInfo2, 388
56
SetItems, 403 SetItems2, 403 SetLanguage, 563 SetLayout, 341, 403, 405, 407, 412, 414, 416, 418, 422, 425, 427, 429, 431, 433, 436, 439, 441, 443, 446, 468, 477 SetLayoutAnimated, 443 SetManifestAttribute, 118 SetMute, 462, 516 SetNextFocusDown, 455 SetNextFocusLeft, 455 SetNextFocusRight, 456 SetNextFocusUp, 456 SetOnClickListener, 546 SetOnCreateContextMenuListener, 547 SetOnFocusListener, 547 SetOnKeyListener, 547 SetOnLongClickListener, 547 SetOnTouchListener, 547 SetPaletteAt, 584 SetPasswordQuality, 457 SetProgress, 391 SetProxy, 481, 501 SetProxy2, 481, 501 SetPublicField, 547 SetPublicField2, 547 SetRate, 465 SetReceiverAttribute, 118 SetRingerMode, 516 SetScreenBrightness, 516 SetScreenOrientation, 516 SetSelection, 422 SetServiceAttribute, 118 SetStaticField, 547 SetStaticField2, 548 SetString, 534 setTabContentViewPadding, 591 setTabEnabled, 591 setTabEnabled2, 591 setTabGradientDrawable, 591 setTabGradientDrawable2, 591 setTabHeight, 592 setTabHostPadding, 592 setTabTextColor, 592 setTabTextColorStateList, 592 setTabTextSize, 592 setTabTitle, 592
Index
setTabVisibility, 592 setTabVisibility2, 592 SetText, 391 SetTextColor, 391 SetTextColorAnimated, 443 SetTextSize, 391 SetTextSizeAnimated, 443 SetTime, 590 SetTimeZone, 349 Setting Backgrounds of Views and the Activity, 199 Setting Icons, 257 Setting Label Transparency, 330 Setting Your Project Parameters, 257 SetTrackMute, 463 SetType, 376 SetVisible, 391 SetVisibleAnimated, 444 SetVolume, 386, 464, 465, 516 SHA1 Certificate Fingerprint, 263 Shared Event Handler, 297 Shared Modules, 232 Shared Modules Folder, 108 Shell, 330, 517 ShiftLeft, 342 ShiftRight, 343 Short, 273 Show, 512, 582, 583, 584, 585, 586, 587, 588, 589, 590 ShowCalendar, 586 ShowDropDown, 403 Showing Tables to the User, 216 ShowKeyboard, 488 ShowOnlyFolders, 587 ShowRingtonePicker, 528 ShowSign, 589 Shutdown, 519 Signing, 261 Signing for Distribution, 261 Simple Example of Usage, 288 Sin, 322 SinD, 322 Single line, 312 SingleLine, 403, 412 SingleLineLayout, 422 Sip, 552 Sip Library, 551
Index
SipAudioCall, 553 Size, 192, 370, 379, 384, 422, 436, 541, 571 SizeChanged, 474, 493 Skin, 191 Skip, 373 Sliding Pages, 125 Smart Strings, 392 SMB, 577 Sms, 528 SmsDelivered, 519 SmsInterceptor, 529 SmsMessages, 530 SmsSentStatus, 519 Snapshot, 192 Snr, 478 Socket, 494 Sort, 379 Sort a List, 378 SortCaseInsensitive, 380 SortType, 380 SortTypeCaseInsensitive, 380 Sound, 388 SoundPool, 464 Source, 580 Sources of Icons, 259 Speak, 564 Speak Button, 577 SpeakerMode, 554 Specifying Functional Arguments, 38 Specifying Menus, 38 SpeechRate, 564 Speed, 480 SpeedValid, 480 Spinner, 433 Split, 321, 390 Split2, 321, 390 Splitting Long Lines, 273 SQL, 225, 556 SQL Library, 225, 554 SQL Object, 217, 218, 225 SQLCipher, 577 SQLite, 225 SQLite Commands, 226 SQLiteBrowser, 217 SQLiteExceptions, 225 SQLiteSpy, 217 Sqrt, 322
57
SrcRect, 475 Standard Libraries, 449 Standard Libraries included with Full Version, 454 Standard Screen, 163 Standard Variant, 151 Starred, 509 Start, 459, 478 StartActivity, 245, 322 StartAudio, 554 StartDiscovery, 549 StartElement, 572 Starter Service, 110 StartForeground, 391 StartListening, 523, 567 StartPreview, 470 StartService, 323 StartServiceAt, 323 StartServiceAtExact, 323 StartsWith, 396 StartTicking, 493 State_Checked, 362 State_Disabled, 362 State_Enabled, 362 State_Focused, 362 STATE_OFF, 549 STATE_ON, 549 State_Pressed, 362 State_Selected, 362 STATE_TURNING_OFF, 549 STATE_TURNING_ON, 549 State_Unchecked, 362 StateChanged, 548 StateListDrawable, 202, 361 StateManager, 577 Statement Separator, 272 Status Bar, 121 StatusBarNotification, 498 StatusCode, 484, 503 StdActionBar Library, 577 Step Value, 291 Steps for Creating a Custom View Class, 408 Stop, 386, 459, 464, 465, 468, 478, 564 StopForeground, 391 StopListening, 520, 523, 530, 551, 567 StopLoading, 446
58
Stopping B4A-Bridge, 52, 66 StopPreview, 470 StopService, 323 StopTicking, 493 Storing Data, 214 StreamBuffer, 464 StreamError, 463 StreamReady, 463 String, 274, 391 String “Members”, 331 String functions, 304 String Functions Library, 395 String manipulation, 303 StringBuilder, 396 Strings obfuscation, 173 StringUtils, 559 StringUtils Library, 559 Structure Matching, 87 STYLE_BOLD, 347 STYLE_BOLD_ITALIC, 347 STYLE_ITALIC, 347 STYLE_NORMAL, 347 Sub, 324 Sub Activity_Create, 242 Sub Activity_Pause, 243 Sub Activity_Resume, 243 Sub Class_Globals, 248 Sub Globals, 240 Sub Process_Globals, 237, 239 SubExists, 324 Subject, 513 Subroutine Dropdown List, 80 Subroutines, 327 SubRoutines, 254 Subs, 295 Subs within a Class or Code Module, 234 Subs within Activity and Service Modules, 235 SubString, 396 SubString2, 396 Success, 487, 506 Supported Firebase Services in B4A, 595 Switch, 571 Sync, 89 TAB, 324 Tab Groups, 95 Tabbed Views, 125
Index
TabChanged, 437 TabCount, 439 TabHost, 436 TabHostExtras Library, 590 TabIndex, 330 Table, 214 Table creation, 226 Table of Contents, 3 TableView, 578 Tabs, 124 Tag, 341, 403, 405, 407, 412, 414, 416, 418, 422, 425, 427, 429, 431, 433, 436, 439, 441, 444, 446, 468, 477, 487, 493, 506 TakePicture, 470 Tan, 324 TanD, 324 Tap for Tap, 578 TapForTap, 264 Target, 190, 548 TargetRank, 548 Telling the IDE where to find additional libraries, 573 Telling the IDE where to find Additional Libraries, 449 Terminated, 535 test, 564 Testing your App, 183 Text, 403, 405, 407, 412, 418, 429 Text encoding, 365 Text Properties, 165 Text Size, 163 Text Style, 150 TextChanged, 401, 410 TextColor, 403, 405, 407, 412, 418, 429, 436, 441 TextOff, 441 TextOn, 441 TextReader, 372 TextSize, 403, 405, 407, 412, 418, 429, 436, 441 TextToSpeechFinish, 520 TextWriter, 373 The Integrated Development Environment, 67 The Project, 110 The Visual Designer, 141
Index
ThreadId, 529 Tick, 493 TickerText, 499 Ticks, 348 TicksPerDay, 350 TicksPerHour, 350 TicksPerMinute, 350 TicksPerSecond, 350 Time, 350, 480 TimeDialog, 590 TimeFormat, 350 Timeout, 482, 502 TimeOut, 495 TimeParse, 350 Timer, 330, 398 TimesContacted, 509 TimeTicks, 590 TimeZoneOffset, 350 Title, 341 Title Bar, 122 TitleColor, 341 To, 513 To obtain or update a user library, 578 ToastMessageShow, 138, 324 ToBinaryString, 343 ToBytesArray, 372, 540 Toggle Library, 592 ToggleButton, 440 ToggleMute, 554 ToHexString, 343 ToLowerCase, 396 ToOctalString, 343 Toolbar, 79 Tools, 597 Tools Menu, 72, 143 Top, 341, 361, 403, 405, 407, 412, 414, 416, 418, 423, 425, 427, 429, 431, 433, 436, 439, 441, 444, 446, 468, 477 TOP, 345 ToPrettyString, 491 toString, 377, 468, 496, 497 ToString, 398, 491, 548 Touch, 299, 337, 423, 493 Touch Event, 241 ToUpperCase, 396 Transactions, 226 TransactionSuccessful, 558
59
Transparent, 344 Trim, 331, 396 Troubleshoot Connection Problems, 198 True, 324 Try, 324 Try-Catch, 303 TTS, 561 TTS Library, 561 Tutorial, 420, 475 Twitter, 269 Two Versions, 44 TwoLinesAndBitmap, 423 TwoLinesLayout, 423 Type, 325, 529, 567 Type Checking, 278 Type Conversion, 275 Type variables, 284 TYPE_ACCELEROMETER, 523 TYPE_ALARM, 528 TYPE_DRAFT, 531 TYPE_FAILED, 531 TYPE_GYROSCOPE, 524 TYPE_INBOX, 531 TYPE_INCOMING, 507 TYPE_LIGHT, 524 TYPE_MAGNETIC_FIELD, 524 TYPE_MISSED, 507 TYPE_NOTIFICATION, 528 TYPE_ORIENTATION, 524 TYPE_OUTBOX, 531 TYPE_OUTGOING, 507 TYPE_PRESSURE, 524 TYPE_PROXIMITY, 524 TYPE_QUEUED, 531 TYPE_RINGTONE, 528 TYPE_SENT, 531 TYPE_TEMPERATURE, 524 TYPE_UNKNOWN, 531 Typeface, 347, 404, 406, 407, 412, 418, 429, 441 TypeName, 548 Types, 273 Types of Libraries, 449 UDPPacket, 495 UDPSocket, 496 Uncaught Runtime Exceptions, 110, 301 Unicode, 365
60
Unique name, 114 Unload, 465 UnsignedShiftRight, 343 Until, 325 Up, 404 Up Button, 123 Update, 472 UpdateAsync, 472 UpdateDelete, 472 UpdateRecord, 223 UpdateRecord2, 224 UpdateWidget, 391 Updating Additional Libraries, 450 Updating records, 228 Updating to a new version, 108 Upgrade to Full Version, 102 Upload your App to Google Play, 266 Uri, 473 URI, 565 Url, 446 USB Debugging, 185 USB Driver, 186 USB Host, 578 USB Library, 564 USB_CLASS_APP_SPEC, 569 USB_CLASS_AUDIO, 569 USB_CLASS_CDC_DATA, 569 USB_CLASS_COMM, 569 USB_CLASS_CONTENT_SEC, 569 USB_CLASS_CSCID, 569 USB_CLASS_HID, 569 USB_CLASS_HUB, 569 USB_CLASS_MASS_STORAGE, 569 USB_CLASS_MISC, 569 USB_CLASS_PER_INTERFACE, 569 USB_CLASS_PHYSICA, 569 USB_CLASS_PRINTER, 569 USB_CLASS_STILL_IMAGE, 569 USB_CLASS_VENDOR_SPEC, 569 USB_CLASS_VIDEO, 569 USB_CLASS_WIRELESS_CONTROLLER , 569 USB_DIR_IN, 569 USB_DIR_OUT, 569 USB_ENDPOINT_DIR_MASK, 569 USB_ENDPOINT_NUMBER_MASK, 569 USB_ENDPOINT_XFER_BULK, 569
Index
USB_ENDPOINT_XFER_CONTROL, 569 USB_ENDPOINT_XFER_INT, 569 USB_ENDPOINT_XFER_ISOC, 569 USB_ENDPOINT_XFERTYPE_MASK, 569 USB_INTERFACE_SUBCLASS_BOOT, 569 USB_SUBCLASS_VENDOR_SPEC, 569 USB_TYPE_CLASS, 569 USB_TYPE_MASK, 569 USB_TYPE_RESERVED, 570 USB_TYPE_STANDARD, 570 USB_TYPE_VENDOR, 570 UsbAccessory, 564 UsbDevice, 565 UsbDeviceConnection, 566 UsbEndpoint, 567, 570 UsbInterface, 567 UsbManager, 568 UsbRequest, 570 USBSerial, 578 Use Host GPU, 193 Use of Unassigned Variables, 278 UsedInFix, 479 User Help, 257 User Support, 265 UserAndPasswordRequired, 444 UserClosed parameter, 244 UserEnabled, 478 Username, 487, 506 UserPresent, 520 Using a Popup Menu, 63 Using Inline Code to access Libraries, 451 Using Integers, 326 Using Libraries, 450 Using SQLite to Convert Ticks to Strings, 229 Using the Android Virtual Device Manager, 188 Using the Designer Tools Menu, 62 Val, 329 Value, 433, 583 Values, 385 Variable Can Specify Dimensions, 282 Variable Placeholders, 393 Variables, 164, 273 Variables in other Activity Modules, 246
Index
Variables List, 179 Variables within an Activity, 239 Variables within Other Subs, 234 Variants Window, 151 VB6, 332 VB6 versus B4A, 326 VendorId, 566 Version, 548, 565, 582, 583, 584, 585, 586, 587, 588, 589, 590 Version of Android, 44 Version of B4A, 44 VersionCode, 341 Versioning, 218 VersionName, 341 Versions, 44 Vertical Tab Group, 95 Vibrate, 388, 525 Video Tutorials, 269 VideoRecordApp, 465 VideoView, 466 View, 441 View and Layout Concepts, 58 View Controls, 159 View Drawables, 199 View Events, 298 View Properties, 147 Views, 335, 400 Views Must be Global, 236 Views Tree, 156 Views within an Activity, 335 ViewsEx Library, 570 Visibility and Lifetime of Variables and Subs, 233 Visibility of Subroutines, 234 Visibility of Variables, 285 VisibilityChanged, 493 Visible, 404, 406, 407, 412, 414, 416, 418, 423, 425, 427, 429, 431, 433, 436, 439, 441, 444, 446, 468, 477 Visual Designer, 100 VM Heap, 191 VoiceRecognition, 531 Voip, 551 VOLUME_ALARM, 461, 517 VOLUME_MUSIC, 461, 517 VOLUME_NOTIFICATION, 461, 517 VOLUME_RING, 461, 517
61
VOLUME_SYSTEM, 461, 517 VOLUME_VOICE_CALL, 461, 517 Warning Bug in Emulator, 154 Warning Engine, 91 Warning Set Internal Properties before External, 165 warnings, 92 Watches, 180 Ways of Monetizing Your App, 263 We’d Like to Hear from You, 41 WebView, 444 What is a Class?, 247 What is a library?, 449 What is Firebase?, 594 What You Need to Run B4A, 44 What you see, 45 When Does Android Kill a Process?, 231 When is Activity_Pause called?, 243 When one activity opens another using StartActivity, 241 When second activity closes and first activity resumes, 241 When the screen is turned back on, 240 When the screen is turned off, 240 When the user brings your app to front after running a different app, 241 When the user clicks the Back button, 241 When the user first launches your app or brings it to the front after quitting, 240 When the user rotates the device, 241 When the user runs another app, 240 When to Use a Service, 254 When to use a Try-Catch, 303 When your app calls Activity.Finish, 241 Where to find your files, 197 Which ones does a project need?, 579 While, 325 White, 344 Who this Book is For, 37 Why this recommendation?, 152 Why use a Service, 252 Width, 341, 351, 377, 404, 406, 407, 412, 414, 416, 418, 423, 425, 427, 429, 431, 433, 436, 439, 441, 444, 446, 468, 477 Window Menu, 94 Window Menus, 94 Window Tabs, 87
62
Windows Area, 87 Windows Character Sets, 366 Windows Menu, 78, 146 Windows-1252, 366 WithAppendedId, 473 WithAppendedPath, 473 Wrap, 404, 412 WrapAsIntentChooser, 376 WrapInputStream, 538 WrapOutputStream, 538 Write, 374, 536 Write2, 536 WriteByte, 541 WriteBytes, 372, 540, 541 WriteDouble, 541 WriteEncryptedObject, 542 WriteFloat, 542 WriteInt, 542 WriteLine, 374 WriteList, 370, 374 WriteLong, 542 WriteMap, 370
Index
WriteObject, 542 WriteShort, 542 WriteString, 370 WriteToStream, 351 WYSIWYG Designer Menu, 143 XHDPI, 260 XML, 571 XMLBuilder, 578 XmlSax Library, 571 Xor, 343 XXHDPI, 260 XXXHDPI, 260 Year, 586 Years, 474 Yellow, 344 Your First App, 46 Your Second App Using the Designer, 58 Your Third App, 66 YouTube, 578 Zoom, 446 Zoom Control, 80 ZoomEnabled, 446