wireless
Search EarthWeb
CodeGuru | Gamelan | Jars | Wireless | Discussions
Navigate developer.com
Architecture & Design  
Database  
Java
Languages & Tools
Microsoft & .NET
Open Source  
Project Management  
Security  
Techniques  
Voice  
Web Services  
Wireless/Mobile
XML  
Technology Jobs  

   Developer.com Webcasts:
  The Impact of Coding Standards and Code Reviews

  Project Management for the Developer

  Defining Your Own Software Development Methodology

  more Webcasts...




See the Winners!


Developer Jobs

Be a Commerce Partner
Memory Upgrades
Online Shopping
KVM over IP
PDA Phones & Cases
Compare Prices
Build a Server Rack
Laptop Batteries
Career Education
Promotional Golf
Calling Cards
Data Center Solutions
Promotional Gifts
KVM Switches
Boat Donations

 
Biz Resources
Technology Asset Management Software
Information Technology Services
ecommerce solutions


Developer News -
Apple's iPhone SDK Off to The Races    March 12, 2008
Sales Data, New Challengers Don't Bode Well For Moto    February 28, 2008
iPhone Grabs Market Share, But Not Yet in The Enterprise    February 6, 2008
Open Wireless Network Looms on Horizon    February 1, 2008
Free Tech Newsletter -

Best Practices for Developing a Web Site: Checklists, Tips, Strategies & More. Download Exclusive eBook Now.

How Palm OS Expands Your Applications: Volumes
By Alex Gusev

Go to page: 1  2  Next  

General Overview

Starting from Palm OS 4.0, applications can a utilize new set of additional system extensions that provide a unified interface for accessing various expansion capabilities. The simplest examples are SD cards, Compact Flash cards, and so forth. Another possible area is digital cameras, players. and so forth. In other words, expansion technology covers not only I/O and memory gadgets, but also proposes a convenient way for data exchange with other systems.

As a matter of fact, you can divide all this business into two co-operating parts:

  • Expansion Manager
  • Virtual File System Manager

Palm OS uses a term, 'slot,' to represent physical carrier of media. These slots are managed by slot drivers. Each slot driver encapsulates direct access to given hardware and exposes a set of stanrard services to Expansion Manager. Optionally, slot drives may have interfaces available from file system libraries. A slot driver itself is a shared library of type sysFileTSlotDriver.

The Virtual File System Manager from another side is a software layer that manages all installed file system libraries. The file system is implemented as a shared library of type sysFileTFileSystem. It provides a unified API to applications to get transparent access to different types of file systems such as VFAT (which is natively supported in Palm OS 4.x), HFS, or NFS on many different media types. VFS Manager abstracts all details of underlying file system, so developer can utilize it by one standard manner. You will find API for manipulating files, folders and volumes.

But, obviously VFS Manager won't do its job for free. You will pay for consistent interface to external media and interoperability by additional overhead on all read/write operations. Your responsibility is to decide if application really needs such features. If you are not required to support different media carriers, Data Manager can be a better option to go.

You first will deal with VSF Manager. As was told above, this manager provides a common API to manage and manipulate files, folders, and volumes. In the next sections, you will see all these operations in more details. Expansion Manager capabilities will be covered in the next article.

Standard Folders

You will start your "virtual tour" on Virtual File System Manager stuff by exploring the standard folders existing on expansion card.

Folder Description
/ Root folder for VFAT file system
/PALM This is a folder where standard Palm applications store their data. Your application can use it as well
/PALM/Backup Reserved folder for backup purposes
/PALM/Programs According to its name, it contains different applications and data, but they are not visible for the Launcher
/PALM/Launcher All applications located under this folder will be automatically added to new category while expansion card will be mounted

An important thing to note right here is that in cases where the displayed application name and database name are different, application name can be changed if user will copy your application from expansion card to main memory and back to another card. This is due to the database name is used during copy operations to the cards. Besides, there is a notion of 'Default Folder' for specific file types. Virtual File System Manager provides an API to determine these folders' names.

Volume-Related Operations

In case the expansion card is able to support some file system, VFS Manager gives you a unified set of operations your application can proceed on volumes:

Err VFSVolumeFormat(UInt8 flags, UInt16 fsLibRefNum,
                    VFSAnyMountParamPtr vfsMountParamP)
Err VFSVolumeMount(UInt8 flags, UInt16 fsLibRefNum,
                   VFSAnyMountParamPtr vfsMountParamP)
Err VFSVolumeUnmount(UInt16 volRefNum)
Err VFSVolumeEnumerate(UInt16 *volRefNumP, UInt32 *volIteratorP)
Err VFSVolumeInfo(UInt16 volRefNum, VolumeInfoType *volInfoP)
Err VFSVolumeGetLabel(UInt16 volRefNum, Char *labelP, UInt16 bufLen)
Err VFSVolumeSetLabel(UInt16 volRefNum, const Char *labelP)
Err VFSVolumeSize(UInt16 volRefNum, UInt32 *volumeUsedP,
                  UInt32 *volumeTotalP)

You will find the example of using those functions in following sub-topics.

Volume enumeration

This is one of the simplest tasks to be performed. VFSVolumeEnumerate has two parameters, volRefNumP and volIteratorP. volRefNumP on exit keeps the volume reference number or is set to vfsInvalidVolRef in case of errors or no more volumes available. *volIteratorP should be set to vfsIteratorStart before the first call to VFSVolumeEnumerate. You will simply call this function in loop to obtain all available volumes in the system. When iteration is completed, *volIteratorP is set to vfsIteratorStop. When there are no volumes in the system, VFSVolumeEnumerate will return expErrEnumerationEmpty upon the very first call. Below is a small sample of volume enumeration:

Err err = errNone;
UInt16 volRefNum = -1;
UInt32 volIterator = vfsIteratorStart;

while ( volIterator != vfsIteratorStop )
{
   err = VFSVolumeEnumerate(&volRefNum, &volIterator);
   if (err == errNone)
   {
      // Do something
   }
   else
   {
      // handle the error
   }
}

Go to page: 1  2  Next  

Next article: How Palm OS Expands Your Applications: Files and Folders


Tools:
Add www.developer.com to your favorites
Add www.developer.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed


Palm Archives

Work With InterSystems. Not Separate Systems. Rapidly develop and deploy connectable applications.
Generate Complete .NET Web Apps in Minutes . Download Iron Speed Designer today.
Five Trends for Application Development. Download Your Complimentary Report. Exclusive. Act Now.
Guide to Developing a Web Site. Best Practices, Tips and Strategies. Download Exclusive eBook Now.
Five Trends for Application Development & Program Management. Download Complimentary Report Now.



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES