eveloping applications for the Palm OS may seem like a daunting task to a VB developer. The traditional Palm SDK requires at least moderate knowledge of the C programming language and has a substantial learning curve. Further complicating the situation are the memory management requirements of the Palm OS and its specific API references. Now, in version 3.5, MobileVB is a well thought-out add-in for VB6 that alleviates the drawn-out development process and makes Palm OS programming a viable option for even novice VB programmers. Enhancing development effectiveness, MobileVB allows VB programmers to take advantage of existing skills without the need to learn a new programming language or another IDE.
MobileVB requires Visual Basic 6.0 with Service Pack 5 or higher. There is a free trial version of MobileVB at the AppForge Web site, www.appforge.com. You can download the free trial to follow along with this article, and because the installation process is painless, I’ll skip over these minor steps and focus on how MobileVB is used within the Visual Basic IDE.
Getting Started with MobileVB Developing a Palm OS project in MobileVB is straightforward, although if you have developed in VB before, you will find a few items that are slightly out of the ordinary. For starters, the manner in which you start VB is important. Rather than using your existing desktop icons or Start Menu shortcut, MobileVB installs its own icons. You will find these on your desktop after installation, and in the Start Menu located in the AppForge MobileVB folder.
When you start MobileVB using one of its icons, you are given options for creating several types of applications. This option window can be seen in Figure 1. Along with the Palm OS, MobileVB provides templates for the Pocket PC, Symbian P800, and the Nokia Communicator. I’m interested in the Palm OS for this tutorial, but the basic concepts are the same for all of the devices.
Figure 2: Access to a variety of new controls on the General tab.
MobileVB Controls When you create a Palm OS project, MobileVB creates a blank form with the correct size for a Palm OS device. You may be tempted to begin developing a project by dragging and dropping the intrinsic VB controls, as you would normally do with a traditional Visual Basic project. But if you look further, you will see an entirely new set of controls in the General tab of your toolbox (See Figure 2). It is with these newly available controls (AppForge calls them Ingots) that you will devise your interface and construct your project.
Often, these controls provide a greater set of functions than their VB counterparts, making them much more powerful than the intrinsic controls. Table 1 details the MobileVB controls:
Table 1: Sorting out the MobileVB Ingots (controls).
MobileVB Control Name
What it does…
AFTextBox
Like its VB counterpart
AFComboBox
Reads textual input and/or prompts the user to select an item from a menu
AFListBox
Displays a list of varying size and content; the user can select one or more of the items in the list box to provide input
AFGrid
Displays text in a spreadsheet-like control from which the user can select one or more grid elements to provide input
AFLabel
Used like the standard VB label control
AFGraphicButton
Provides standard button options but can display a picture instead of a shape
AFButton
Similar to the VB CommandButton control
AFCheckBox
Provides a True/False option
AFRadioButton
Provides the option of selecting exactly one item from a list of items
AFGraphic
Displays graphics on the screen; uses the MobileVB Graphic Converter to create a proprietary .rgx or .jpg image
AFShape
Draws rectangles, squares, circles, and ovals
AFFilmstrip
Animates a series of graphics on the screen
AFMovie
Displays a movie on the screen after it has been converted from AVI to RMV
AFHScrollBar
Places a horizontal scrollbar on the form
AFVScrollBar
Places a vertical scrollbar on the form
AFSlider
Allows user input or output based on magnitude.
AFTone
Plays simple musical tones
AFScanner
Provides barcodes scanning in a variety of formats
AFSerial
Sends and receives data through a serial port
AFInetHTTP
Connects to the Internet
AFSignatureCapture
Reads signatures, stored as String data, for user input
AFClientSocket
Provides a variety of functions for performing socket-based communication
Sprite Field
Controls sprites and receives events during game progress
Sprite Control
A non-visual Ingot that eases sprites
AFTimer
Like the standard Timer, used to execute code at intervals
The VB IDE can become cluttered with the new controls, so if you prefer, you can create a new tab to which you can copy the MobileVB Ingots. To create the MobileVB tab, right-click on the General tab, select Add Tab and then name the new tab. Notice the small yellow letter “i” that allows you to distinguish between standard controls and MobileVB controls. You can now move the MobileVB controls by dragging and dropping them to the new tab.
The remaining IDE, including the Form Layout window, Property window, Project Explorer, and menus, continues to function as you would expect, although MobileVB adds an additional AppForge-specific menu with the following functions (Table 2).
Table 2: AppForge adds another menu with specific functionality to the Visual Basic IDE.
AppForge-specific Menu Item
What it does…
Database Converter
Converts Microsoft Access database tables to the Palm Database (.pdb) format and generates a VB code module for the database, providing an interface for accessing and modifying the Palm Database
PDB Database Viewer
Displays the internal schema and data records in the Palm Database file. Also displays other useful information, including the internal database name, CreatorID, and TypeID of the database, and the number of records in the database
Font Converter
Converts TrueType fonts (ttf) into AppForge fonts (cmf)
Font Viewer
Displays the properties and characters for AppForge fonts
Graphic Converter
Converts bitmap files (bmp) into AppForge graphic files (rgx).
Graphic Viewer
Allows you to view AppForge graphic files (rgx)
Movie Converter
Converts AVI movies to AppForge movie files (RMV)
Movie Viewer
Allows you to view RMV movies
Universal Conduit Configuration
Configures a conduit for your application
Compile and Validate
Compiles and checks code for error
Deploy to Device
Uploads a compiled project to a handheld device
AppForge Settings
Applies the settings for an AppForge project
Open Project
Opens AppForge projects
Zoom Level
Opens a Zoom window, allowing you to view forms in a larger format
Creating a New Database Application with MobileVB
Writing Some Code The module you added to the project contains all the necessary code for directly accessing the Palm Database, leaving you responsible for adding the appropriate code in the VB events. When the button Ingots are clicked, an event is raised. Using these events, it’s easy to add records, navigate the existing records, or delete records. Begin with the creation of a new record, which occurs when btnNew is clicked.
Along with the Palm OS, MobileVB provides templates for the Pocket PC, Symbian P800, and the Nokia Communicator.
Begin by opening the Code window to create a variable called NewRecord. The variable should be of type Boolean; that is, it holds a yes/no, true/false, or 1/0 value. Inside the btnNew_Click event, begin by setting the NewRecord variable to True. Next, set txtItem and txtQuantity to “”. You’ll be setting the TextBoxes to “” on several occasions and with that in mind, create a new procedure called ClearDisplay to set them. Then call the procedures as needed. The following procedures are finished:
Private NewRecord As Boolean Private Sub btnNew_Click() NewRecord = True ClearDisplay End Sub Private Sub ClearDisplay() txtQuantity.Text = "" txtItem.Text = "" End Sub
Next, handle the forward and back (<- and ->) buttons. The code is nearly identical for both items and looks like this:
Private Sub btnBack_Click() PDBMovePrev dbInv DisplayInfo End Sub Private Sub btnNext_Click() PDBMoveNext dbInv DisplayInfo End Sub
The next item is the btnDelete code. Again, it uses the ClearDisplay sub procedure and the NewRecord variable. It checks to see if there is a record, and if so, deletes it. Here is the code:
Private Sub btnDelete_Click() If NewRecord Then ClearDisplay NewRecord = False DisplayInfo ElseIf PDBNumRecords(dbInv) > 0 Then PDBDeleteRecord dbInv DisplayInfo Else MsgBox "No records to delete" End If End Sub
Before moving on, let’s look at the Form_Load event. This event checks to see if the database exists and if not, creates a new one. You’ll also move to the first record in the database. The code you need is in Listing 1.
At the end, the Form_Load event calls the DisplayInfo sub procedure. This procedure (in Listing 1) contains the code that actually displays the information on the screen. You only have two buttons left to deal with. The first is btnSave, which saves the database record you currently have displayed, and btnExit, which causes the program to end. The following procedures finish the application:
Private Sub btnSave_Click() Dim MyRecord As tInvRecord If NewRecord Then PDBCreateRecordBySchema dbInv End If MyRecord.Item = txtItem.Text MyRecord.Quantity = txtQuantity.Text PDBEditRecord dbInv WriteInvRecord MyRecord PDBUpdateRecord dbInv DisplayInfo End Sub Private Sub btnExit_Click() Unload Me End Sub
MobileVB does a splendid job of integrating Palm development into the VB IDE, and is undoubtedly one of the easiest to use all-around development tools available for the Palm. The tools are especially easy to use for developers that are already experienced with VB, as the learning curve is nearly nonexistent. If you are a VB developer and want to write software for mobile devices like the Palm OS, look no further.
Navigating the tech landscape to find the right partner is crucial yet challenging. This article offers a comparative glimpse into the top software development companies
Looking for the best in software development? Our list of Top Software Development Companies is your gateway to finding the right tech partner. Dive in
Democratic state legislators in Michigan continue to discuss and debate clean energy legislation in the hopes of establishing a comprehensive clean energy strategy for the
In response to the intensifying worldwide technology competition, Europe has unveiled the long-awaited European Chips Act. This daring legislative proposal aims to fortify Europe’s semiconductor
Navigating the tech landscape to find the right partner is crucial yet challenging. This article offers a comparative glimpse into the top software development companies in the USA. Through a
Looking for the best in software development? Our list of Top Software Development Companies is your gateway to finding the right tech partner. Dive in and explore the leaders in
In the digital race, the right web development partner is your winning edge. Dive into our curated list of top web development companies in India, and kickstart your journey to
Looking for the best web development companies in the USA? We’ve got you covered! Check out our top 10 picks to find the right partner for your online project. Your
Democratic state legislators in Michigan continue to discuss and debate clean energy legislation in the hopes of establishing a comprehensive clean energy strategy for the state. A Senate committee meeting
In response to the intensifying worldwide technology competition, Europe has unveiled the long-awaited European Chips Act. This daring legislative proposal aims to fortify Europe’s semiconductor supply chain and enhance its
As the demand for rapid software development increases, low-code platforms have emerged as a popular choice among developers for their ability to build applications with minimal coding. These platforms not
In today’s increasingly digital landscape, businesses of all sizes must prioritize cyber security measures to defend against potential dangers. Cyber security professionals suggest five simple technological strategies to help companies
Since the start of 2023, the global technology sector has experienced a significant rise in layoffs, with over 236,000 workers being let go by 1,019 tech firms, as per data
During a prominent unveiling event, Huawei, the Chinese telecommunications powerhouse, kept quiet about its enigmatic new 5G phone and alleged cutting-edge chip development. Instead, Huawei astounded the audience by presenting
The banking, financial, and insurance (BFSI) sectors are pioneers in digital transformation, using web applications and application programming interfaces (APIs) to provide seamless services to customers around the world. Rising
Over the past 30 years, Terry Clune has built a remarkable business empire, with CluneTech at the helm. The CEO and Founder has successfully created eight fintech firms, attracting renowned
In the digital age, the role of Artificial Intelligence (AI) in web design is rapidly evolving, transitioning from a futuristic concept to practical tools used in design, coding, content writing
There is no doubt that modern technology has changed the way we live and work forever. Nowadays, there is a wide array of different types of technologies such as AI
The increasing demand for Generative AI models has led to a surge in its adoption across diverse sectors, with healthcare, automotive, and financial services being among the top beneficiaries. These
The Surface Laptop Studio 2 is a dynamic and robust all-in-one laptop designed for creators and professionals alike. It features a 14.4″ touchscreen and a cutting-edge design that is over
NTT DOCOMO, a global telecommunications giant, is set to break new ground in the industry as it prepares to launch a GPU-accelerated 5G network in Japan. This innovative approach will
An op-ed, produced using Microsoft’s Bing Chat AI software, recently appeared in the St. Louis Post-Dispatch, discussing the potential concerns surrounding the employment of artificial intelligence (AI) in journalism. These
The highly awaited Big Deal Days event for October 2023 is nearly here, scheduled for the 10th and 11th. Similar to the previous year, this autumn sale has already created
Cisco’s recent massive purchase of Splunk, an AI-powered cybersecurity firm, for $28 billion signals a potential boost in tech deals after a year of subdued mergers and acquisitions in the
Iran has recently unveiled a jet-propelled variant of its Shahed series drone, marking a significant advancement in the nation’s drone technology. The new drone is poised to reshape the regional
The Overshoot Commission has recently released a comprehensive report that discusses the controversial topic of Solar Geoengineering, also known as Solar Radiation Modification (SRM). The Commission’s primary objective is to
School districts are preparing to reveal a substantial technological upgrade designed to significantly improve remote learning experiences for both educators and students amid the ongoing pandemic. This major investment, which
Scientists John Connell and Yi Lin from NASA’s Solid-state Architecture Batteries for Enhanced Rechargeability and Safety (SABERS) project are working on experimental solid-state battery packs that could dramatically change the
Are you wondering how much it costs to build a website? The approximated cost is based on several factors, including which add-ons and platforms you choose. For example, a self-hosted