Full NET Wireless Programming 1st Edition Mark Ridgeway Ebook All Chapters
Full NET Wireless Programming 1st Edition Mark Ridgeway Ebook All Chapters
https://ebookfinal.com/download/distributed-net-programming-in-vb-
net-1st-edition-tom-barnaby-auth/
ebookfinal.com
https://ebookfinal.com/download/programming-net-security-1st-edition-
adam-freeman/
ebookfinal.com
https://ebookfinal.com/download/programming-mappoint-in-net-1st-
edition-chandu-thota/
ebookfinal.com
https://ebookfinal.com/download/wireless-java-programming-
with-j2me-1st-edition-yu-feng/
ebookfinal.com
ASP NET Website Programming Problem Design Solution VB NET
Edition Marco Bellinaso
https://ebookfinal.com/download/asp-net-website-programming-problem-
design-solution-vb-net-edition-marco-bellinaso/
ebookfinal.com
https://ebookfinal.com/download/programming-microsoft-asp-net-mvc-1st-
edition-dino-esposito/
ebookfinal.com
https://ebookfinal.com/download/programming-microsoft-linq-in-net-
framework-4-1st-edition-pialorsi/
ebookfinal.com
https://ebookfinal.com/download/object-oriented-programming-in-vb-
net-1st-edition-alistair-mcmonnies/
ebookfinal.com
https://ebookfinal.com/download/net-programming-10-minute-
solutions-1st-edition-russell-a-jones/
ebookfinal.com
NET Wireless Programming 1st Edition Mark Ridgeway
Digital Instant Download
Author(s): Mark Ridgeway
ISBN(s): 9780782129755, 0782129757
Edition: 1
File Details: PDF, 13.80 MB
Year: 2002
Language: english
.NET Wireless
Programming
Mark Ridgeway
SYBEX®
.NET Wireless
Programming
This page intentionally left blank
.NET Wireless
Programming
Mark Ridgeway
Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved. The author(s) created reusable
code in this publication expressly for reuse by readers. Sybex grants readers limited permission to reuse the code found in this publication or
its accompanying website so long as author is attributed in any application containing the reusable code and the code itself is never distri-
buted, posted online by electronic transmission, sold, or commercially exploited as a stand-alone product. Aside from this specific exception
concerning reusable code, no part of this publication may be stored in a retrieval system, transmitted, or reproduced in any way, including
but not limited to photocopy, photograph, magnetic, or other record, without the prior agreement and written permission of the publisher.
ISBN: 0-7821-2975-7
SYBEX and the SYBEX logo are either registered trademarks or trademarks of SYBEX Inc. in the United States and/or other countries.
Openwave, the Openwave logo, and UP.SDK are trademarks of Openwave Systems Inc. All rights reserved.
Netscape Communications, the Netscape Communications logo, Netscape, and Netscape Navigator are trademarks of Netscape Commu-
nications Corporation.
Netscape Communications Corporation has not authorized, sponsored, endorsed, or approved this publication and is not responsible for its
content. Netscape and the Netscape Communications Corporate Logos are trademarks and trade names of Netscape Communications
Corporation. All other product names and/or logos are trademarks of their respective owners.
Internet screen shot(s) using Microsoft Internet Explorer 6 reprinted by permission from Microsoft Corporation.
TRADEMARKS: SYBEX has attempted throughout this book to distinguish proprietary trademarks from descriptive terms by following
the capitalization style used by the manufacturer.
The author and publisher have made their best efforts to prepare this book, and the content is based upon final release software whenever
possible. Portions of the manuscript may be based upon pre-release versions supplied by software manufacturer(s). The author and the pub-
lisher make no representation or warranties of any kind with regard to the completeness or accuracy of the contents herein and accept no
liability of any kind including but not limited to performance, merchantability, fitness for any particular purpose, or any losses or damages
of any kind caused or alleged to be caused directly or indirectly from this book.
10 9 8 7 6 5 4 3 2 1
To the two most important people in my life:
my wife, Marian, and our son, Tyler.
Acknowledgements
any people have contributed to this book along the way. To the good people at Sybex,
M thank you for your ideas, support, and guidance. In particular, thank you to Denise
Santoro Lincoln, who originally suggested the book and got the whole project off the
ground. Thank you also to Leslie Light and Brianne Agatep, who have guided the project
through to completion, gently repaired my many grammatical mistakes, and helped entire
paragraphs make sense. I must also thank Joe Webb, Jim Gabbert, and Susan Berge from
Sybex for doing some of the editorial work on various chapters.
I would also like to thank the various people who have lent their technical expertise in sug-
gesting things I have overlooked, picking up any errors, and making sure that what I have
written about will actually work. In particular: Bob LaBerge, Srdjan Vujosevic, and Michael
Bruce—I would be in trouble without you!
I must also thank the many people at Microsoft who helped out with advice, suggestions,
and technical support at various points along the way. And a big thank you to the various
members of the mobile/wireless developers community—a rapidly growing brood who are
always willing to help each other out with ideas, suggestions, and specialized knowledge.
Finally, I must thank my family for their love, tolerance, and support. I wouldn’t have gotten
there without you.
Contents at a Glance
Introduction xix
Chapter 8: A Deeper Look at the Mobile Internet Toolkit and VB .NET 157
Chapter 10: Data Access with the Mobile Internet Toolkit, Part 2 219
Chapter 11: Using Styles and Templates in the Mobile Internet Toolkit 267
Chapter 14: Using XML Web Services to Build Distributed Applications 309
Chapter 19: Morris’s Wholesale Fruit & Vege: A Mobile Intranet 437
Appendices
Appendix A: Class Listing for the Mobile Internet Toolkit 533
Index 551
Contents
Introduction xix
Chapter 8 A Deeper Look at the Mobile Internet Toolkit and VB .NET 157
Components of a .NET Mobile Project 159
Exploring Extensibility 162
What’s New in Visual Basic .NET 162
How Does My Code Compile Under .NET? 166
Can I Port My Existing Code Over to .NET? 167
Differences between ASP.NET and .NET Mobile Web Forms 168
Looking at the Web.config, Global.asax, and AssemblyInfo.vb Files 169
The Web.config File 170
The Global.asax/asax.vb Files 173
The AssemblyInfo.vb File 174
<Assembly: AssemblyVersion(“1.0.*”)> Debugging Our Projects 175
Dynamic Debugging 175
Application-Level Tracing 177
Custom Error Pages 178
Handling Cookies and State Management 179
Cookies 180
Contents xiii
Chapter 9 Data Access with the Mobile Internet Toolkit, Part 1 (List Controls) 189
Data Binding and the Mobile Internet Toolkit 190
What’s New in ADO.NET? 191
Using the List Control 191
Creating a Static List Using the Items Property 192
Connecting the List Control to a Database 193
Connecting the List Control to an Array 201
Using the ObjectList Control 204
Connecting the ObjectList Control to a Database 204
Setting Up Custom Fields 208
Using the SelectionList Control 210
Paginating a List 214
Summary 216
Chapter 10 Data Access with the Mobile Internet Toolkit, Part 2 219
Setting Up MyContacts 220
The Database 220
Building the Project 221
Accessing Data from DataSets 222
Using a DataView Object to Access Data from a DataSet 229
Customizing the Displayed Text in a List Control 232
Using the DataReader to Access Data 234
Summary of Data Access 236
Modifying Data 236
xiv Contents
Chapter 11 Using Styles and Templates in the Mobile Internet Toolkit 267
Using Styles with the MIT Revisited 268
Creating an External Style Sheet 269
Using Template Sets in Style Sheets 272
Using MobileCapabilities 276
Adding Device Filters 285
Summary 286
Appendices 533
Index 551
Introduction
he lights in the crowded theatre had dimmed and the spotlight was focused on the
T Microsoft evangelists doing their thing on the stage. I had settled a little into my seat
amongst the audience and closed my eyes, waiting for the third coffee of the day to kick in.
All of a sudden, I heard the guy in a suit next to me straighten up in his seat and mutter,
“Amazing!” It was his first introduction to the power of mobile, wireless technologies, and
he instantly reminded me (who had been playing with the technology for the past 18 months)
of just how serendipitous that experience can be.
Imagine all your data, all your applications, and all your work available simultaneously
from a cell phone, a laptop, and a desktop computer. Imagine that your cell phone can be
used as a pocket or handheld PC. Access your organization’s Intranet and obtain information
from the Internet anytime, any place.
The Microsoft evangelists demonstrated an e-commerce system where they placed an
order over the Internet and then used a wireless Pocket PC to process the order at the ware-
house level. A confirmation of the order was sent to the client’s cell phone by the system.
The system just seemed to make so much sense that the guy in the suit muttered to him-
self, “Why aren’t we doing this now?” Around the whole theatre, this sense of excitement
rose as the rest of the demonstration unfolded. Never mind how all of this was supposed to
work—most of these people were playing at the management level and when they get excited
by an idea they expect to be able to point to others and say, “Make it happen.”
But Microsoft did not leave us hanging; they then introduced the next generation technol-
ogy that could help build a total end-to-end solution. Microsoft is by no means the first to
offer powerful tools for developing mobile, wireless applications. However, their .NET tech-
nologies offer possibilities for cross-platform solutions that extend the notion of computing
far beyond where we are today.
With this simple demonstration, Microsoft had succeeded in inspiring another generation
of management with a vision of the long-term, strategic possibilities for their IT budgets.
And for those of us who love to play at the cutting edge of technology, we thrive on new
ideas and exploring new possibilities, and we are more than happy to be the ones that are told
to “make it happen.”
If you haven’t been here before, welcome to the world of wireless and mobile connectivity.
This book that you hold in your hands now is about how to create interactive and dynamic
xx Introduction
applications for the Mobile Internet using some of the new tools being developed by
Microsoft, specifically, Microsoft’s Mobile Internet Toolkit and Visual Studio .NET.
The areas of wireless computing and mobile applications have grown rapidly over the last
five years, and it is expected that by the year 2005, the majority of Internet users will be able
to access the Web from a mobile device.
This creates enormous opportunities for developers wishing to get in on the “ground
floor” of a new technology and opens up exciting possibilities for how people will do business
st
and communicate in the early part of the 21 century.
Microsoft sees mobile technology as a key part of its integrated .NET strategy. The
company no longer views different technologies and platforms as being distinct entities that
operate independently from each other. Working with Microsoft’s mobile technologies
means that we also work with back-end database technologies, desktop application develop-
ment, Web design, distributed application architecture, ASP technologies, and content and
service provision.
To borrow a phrase that is almost irritatingly popular at Microsoft sponsored events: “This
stuff is amazingly cool!”
I even heard the guy in the suit say it. Enjoy the ride!
Mark Ridgeway, December 2001.
Key Terminology
The term wireless can be applied to a wide range of scenarios where computers are connected
by something other than wires. Examples include infrared, radio, and microwave. Wireless
can be used to connect the whole spectrum of digital devices, including desktop computers,
laptops, palmtops, PDAs, and mobile phones.
Mobile device usually refers to any digital device that is small enough to be easily carried
around and possessing its own power supply. This includes laptop computers, PDAs, palm-
tops, and mobile phones.
For our purposes, we are interested in wireless, mobile devices of the pocket-sized variety,
such as PDAs, palmtops, and mobile phones.
We also need to distinguish between online and embedded applications. The development
of embedded applications that exist and run on the device itself is very different from applica-
tions that exist online and are accessed by some form of browser software.
The purpose of this book is to illustrate the building of online sites and applications.
Introduction xxi
Finally, we need to distinguish between the Internet and the Mobile Internet. Internet sites
are mainly built using HTML (Hypertext Markup Language) and are designed for viewing
on conventional computer screens. On the other hand, Mobile Internet sites may or may not
be built using HTML—more likely WML (Wireless Markup Language)—and are designed
for viewing on very small, limited screens.
● Pocket Internet Explorer and Pocket Office applications for pocket PCs
● Content and services, including MSN Mobile
The company is also conducting ongoing development into related technologies such as
smart cards, location-based services, and speech technologies.
Tools Required
To work with .NET and the Mobile Internet Toolkit, you will need to have a few tools:
Software You will need the following:
● A copy of Microsoft’s Visual Studio .NET including the .NET Framework and the
Mobile Internet Toolkit. These may be obtained separately or as part of the Visual
Studio .NET package.
Introduction xxiii
● Emulators for various mobile devices are either provided as stand-alone entities or
included in the SDKs released by various companies. These tools allow developers to
test code for a particular device on their own computer without having to go out and
buy that device. The following are good starting points:
● Mobile Explorer from Microsoft (worth getting as part of the Microsoft Mobile
Explorer Content Toolkit)
● The UP.Browser (http://www.openwave.com)
● The Nokia browser (http://forum.nokia.com/main.html)
● Your computer should be running (in either their Professional, Server, or Advanced
Server guises) Microsoft Windows NT 4, 2000, or XP (each with latest service packs).
Note that NT 4 Workstation is only supported for client-side development. You will
also need a copy of Microsoft’s Web server, IIS 5.0, and Internet Explorer 6 or up.
TIP The Mobile Internet Toolkit and Microsoft Mobile Explorer Content Toolkit can be obtained
directly from Microsoft at http://msdn.microsoft.com/downloads.
More Information
Sybex has published all the code used in this book on their Website at www.sybex.com/. Search
for this book using the title, author, or the ISBN number (2975), and click the Downloads
button. Once you have accepted the license agreement, you’ll be able to download any of the
code listed in this book.
xxiv Introduction
As with any code published on a Website, be careful when copying and pasting as extra line
breaks can sometimes occur that cause your application to go pear shaped!
A list of developer sites has been included in Appendix C, “Internet References.” Many of
these sites run excellent e-mail lists where people can discuss these technologies and share
problems and solutions. Microsoft runs its own Mobile Internet Toolkit SDK newsgroup
at http://microsoft.public.dotnet.framework.aspnet.mobile which can be accessed
through http://msdn.microsoft.com/newsgroups.
What Is .NET?
• The .NET Framework
t the end of the chapter, readers can expect to have achieved a basic understanding of the
A following:
● What Microsoft is hoping to achieve with .NET
● The distributed nature of .NET and the role of new developments such as XML Web
Services
● The role of individual aspects of .NET, particularly relevant to this book such as the
.NET Framework, Visual Studio .NET, SOAP, and the Mobile Internet Toolkit
Before we launch into a study of the Mobile Internet Toolkit portion of .NET, it is a good
idea to have an understanding of the entire .NET package.
In this chapter we will have a look at a broad outline of .NET, some of its key components
and how the Mobile Internet Toolkit fits into the total package.
Microsoft defines .NET as being a five-part strategy consisting of the following:
● The .NET Framework and Visual Studio .NET developer tools
● Server infrastructure—Microsoft’s various server packages
● Building Block Services such as portable user identification (Passport)
● Devices—software products covering a range of different devices
● User experiences—applications such as Office and services such as MSN
Later in this chapter, we will cover the .NET Framework and Visual Studio .NET
package. We will also investigate some of the other key .NET components. In Chapter 2,
“Microsoft’s End-to-End Mobile Strategy,” we will have a more detailed look at server infra-
structure, devices, and some of the building block services and user experiences.
Essentially, .NET represents an integrated approach to software development, deploy-
ment, and usage. Developers no longer need to build applications and services just for a
mobile platform, a Pocket PC platform, or a desktop platform. Each of these is seen as a
greater part of the whole with users able to seamlessly transfer data between the platforms. A
single application might work across these platforms—for example, a messaging system that
communicates delivery instructions from warehouse PCs (personal computers) to the deliv-
ery drivers’ mobile phones via a server. The information entered into the PC might come
directly from a dedicated wireless mobile barcode reader.
.NET is also firmly based on a distributed computing model. Applications can be assembled
from components or XML Web Services that exist on different machines. XML (eXtensible
Markup Language) is the language used to communicate between these XML Web Services,
and Microsoft sees it as the “glue” that makes .NET work. XML Web Services may be either
software components or resources such as data libraries.
What Is .NET? 5
XML Web Services rely on SOAP (Simple Object Access Protocol) to transmit and receive
data and commands within a distributed system. This protocol describes how the data and
commands should be represented using XML. There are a number of other services and tech-
nologies associated with the use of SOAP that are described in the “SOAP” section later in
this chapter.
As an application may consist of a number of XML Web Services accessing a number of
other XML Web Services, which could be spread over a large number of machines poten-
tially across the planet, execution sequences can become a problem. Not everything will
necessarily happen in the correct order. In these scenarios, .NET allows for the synchron-
ous (in sequence) or asynchronous (out of sequence) execution of the various functions.
This needs to be specified in the code during design, but it means that applications won’t
sit there churning away to themselves, waiting for something to come down the pipe, and
locking the user out of doing something else on their machine. Figure 1.1 illustrates how
an application built around XML Web Services might look.
It also provides the IDE for building mobile sites and applications using the Mobile Internet
Toolkit.
As illustrated in Figure 1.2, programmers can open Visual Studio .NET, and choose the
type of project they wish to build (such as a Windows application or XML Web Service) and
the language they wish to build it in. You can even change languages within a project where
necessary or use a non-Microsoft language (such as Eiffel).
FIGURE 1.2:
Developers have the
choice of project type
and language in Visual
Studio .NET.
In addition, Microsoft has included a new language in Visual Studio .NET, C#. This
language is designed to bring a simpler, more RAD (Rapid Application Development)
approach to the world of C/C++ programming. It is object-oriented, is type-safe, and offers
automatic garbage collection. As you can see in Figure 1.3, if you have previously used any
of the Microsoft visual development tools, the new Visual Studio .NET interface is very
familiar.
8 Chapter 1 • What Is .NET?
FIGURE 1.3:
The Visual Studio IDE
SOAP
SOAP (Simple Object Access Protocol) is a lightweight protocol for exchanging data in a
distributed heterogeneous environment. It provides a set of rules (or grammar for XML)
about how data and commands should be represented. In the past, distributed computing
has run aground because the objects required are unable to be accessed through the firewalls
and security protocols set up (quite rightly!) around many networks. SOAP now allows these
objects to transmit their data or receive commands via Port 80 (the HTTP port that any
network administrator wishing to use the Internet would normally leave open).
New XML Web Services are set up with SOAP already incorporated into them. Existing
COM objects can be given a SOAP “wrapper” (using Visual Studio .NET) that enables them
to be used as a distributed XML Web Service.
Microsoft has other members of the SOAP “family” that work alongside the protocol to
help make it possible for developers to actually find and use available XML Web Services in
their applications:
WSDL Another XML “grammar” (set of rules for XML) is WSDL (Web Service
Description Language). WSDL is used to expose the capabilities of an XML Web Ser-
vice. For example, we might have an XML Web Service that has some function called
“calculate” that requires three variables a, b, and c. We would talk to the XML Web Ser-
vice using WSDL to find out about this function and what its requirements were.
The Mobile Internet Toolkit 9
Disco Disco, which is short for SOAP Discovery, is used to locate descriptions for XML
Web Services. When an XML Web Service is created, a file with the extension .disco is
also generated. This file enables the WSDL description files for a particular site to be auto-
matically located when someone wishes to make use of the XML Web Services in a distri-
buted application. (This assumes that the owner of the site is willing to allow the use of his
or her XML Web Services in some other distributed application!)
UDDI UDDI (Universal Description, Discovery, and Integration) is a directory service to
provide the location of a whole range of XML Web Services. They are categorized into vari-
ous types of information and services. For more information, see http://www.uddi.org/.
FIGURE 1.4:
The UP.Simulator,
an example of
Openwave’s mobile
emulator
Summary 11
Mobile applications are usually built-in “decks” of “cards” with each card representing the
Internet equivalent of a page. Each deck is in fact a single page of code, so in HTML terms,
it would be like writing your entire Website onto a single page of code and only using a sec-
tion of the code to represent each page of the site. The Mobile Internet Toolkit allows this to
happen by permitting developers to place multiple form controls onto a single Mobile Form
Web page. As controls are added to the forms on the page, each control has a runat=server
attribute declared to ensure that they are executed as server-side code.
The result is a streamlined development environment with drag-and-drop controls onto a
single form (or multiple forms if you wish). The business logic and content can then be added
in the traditional “code behind” approach used with Microsoft development tools. Developers
already schooled in ASP.NET have very little to learn before they begin developing sites and
applications for the mobile Internet. The adaptive rendering of the Mobile Internet Toolkit
handles device detection and appropriate presentation of the code for any mobile device.
Summary
Microsoft’s .NET brings together a range of development tools, platform software, and ser-
vices under one integrated umbrella. The developer can now create user-centric applications
that are designed to work across a particular environment rather than just on a particular plat-
form. Developers are able to use the tools and languages of their choice within the single IDE
of Visual Studio.NET. At the wider level, XML Web Services and their associated protocols
open up the real possibilities of building and using distributed applications across the Internet.
The strong mobile focus of .NET and the creation of a set of dedicated tools simplify devel-
opment in this area and help to ensure that any software solution is able to be equipped with
mobile capability where appropriate.
This page intentionally left blank
Chapter 2
Microsoft’s End-to-End
Mobile Strategy
• Understanding Microsoft’s Mobile Strategy
he purpose of this chapter is to introduce Microsoft’s strategy for mobile devices and to
T investigate some of its key components. By the end of the chapter, the reader can expect
to have some understanding of Microsoft’s philosophy in this area, which is designed to tar-
get each aspect of mobile application development and delivery. Microsoft is working closely
with hardware manufacturers to jointly produce products (such as mobile phones and hand-
held computers) that run its software on its operating systems. These products, in turn, are
linked very closely with other products (such as servers) also running on and using Microsoft
software. Lastly, Microsoft is also working at the service end to create and provide a range of
both free-to-air and commercial (paying) services available over the Internet to the full range
of devices and platforms capable of accessing the Web.
Readers will also be taken through various individual examples of Microsoft’s strategy with
a view to developing a closer understanding of how it all fits together. The examples include
the following:
Stinger Microsoft’s mobile phone platform.
Microsoft Mobile Explorer Microsoft’s Internet browser for mobile devices.
Microsoft Mobile Information 2001 Server Server platform specifically developed for
mobile devices.
Pocket PC PDA style mobile devices.
Handheld PC Small, portable computers.
Windows Embedded Operating Systems Various flavors of embedded operating
systems developed by Microsoft to run mobile and industrial devices.
My Internet An example of a commercial service being developed and offered by
Microsoft over the Internet.
FIGURE 2.1:
The Mobile Explorer
Emulator
In Microsoft’s vision and strategy documentation for mobile technology, “Microsoft Vision
and Strategies for Mobile Technology,” Microsoft says its strategy is “to extend, connect, and
innovate.” This documentation can be found at http://microsoft.com/business/mobility/
vision.asp. The company expands these key words with the following descriptions:
● “To extend the communication and collaboration potential of the more than 80 million
users of MSN, MSN Hotmail, Microsoft Outlook, and Microsoft Exchange Server.”
● “To connect users to the information they want, when and how they want it.”
● “To innovate towards a new synergy among the platforms, applications, and tools of the
computing and wireless industries.”
Note that the italics are mine.
The company’s aim is to seamlessly connect people to their data and information irrespec-
tive of the device they are using. It has identified four categories of wireless players that it is
targeting with various services and technologies:
● Content and service providers
● Device manufacturers
Exploring the Variety of Random
Documents with Different Content
república; pero pasad adelante en
tanto que esto se remedia.
Lerma.—Es tanta la iñorancia
desta gente de quien hablamos,
que en lo que decían saber más
es en lo que menos saben,
porque la principal parte que han
de tener es en el conocimiento de
las hierbas y plantas y raíces y
piedras; notorio está que la mayor
fuerza de la medicina consiste en
ellas, y tanto que, según dice
Rasis en el segundo de los
anforismos, trayéndolo por
auctoridad de aquel gran filósofo
Hermes, si se conociesen bien las
propiedades y virtudes de las
hierbas y plantas, curarían los
médicos con solas ellas, de
manera que pareciese que
curaban con arte mágica; pues si
esto es assí, al médico conviene
ordenar y á los boticarios poner
en efeto lo que ellos ordenassen,
lo cual pueden muy mal hacer si
no conocen destintamente las
plantas y las hierbas y las raíces y
piedras, y aun las condiciones y
propiedades dellas. ¡Oh cuántos y
cuántos boticarios de los buenos
se engañan en tener unas hierbas
por otras, y en no conocer y
entender muchas dellas! ¿Que
harán los que no lo son? ¿Y esto
de donde pensáis que procede?
De que no saben gramática para
entender los libros que tratan
dellas, ó si la saben, porque les
falta la experiencia, que ni nunca
las han buscado ni visto, y
cuando las buscan, hallan
algunas que se parecen unas á
otras en las hojas, en el tamaño y
en las flores y en el olor, y por
ventura son tan distintas y
diferentes en las propiedades,
que la una mata y la otra sana, y
los mezquinos de los enfermos
han de estar sujetos á la simpleza
de un boticario, si acierta ó no
acierta, y no solamente los
enfermos, pero los médicos, que
desto y de otras muchas cosas
nos ponen la culpa, sin tenerla.
D. Gaspar.—¿Y qué pueden
hacer para esso los
protomédicos?
Lerma.—Yo lo diré. Que al que
examinasen, no había de ser ni
en un día, ni en ocho, ni aun en
quince, y también le habían de
examinar de la teórica como de la
prática, y de la experiencia como
de la ciencia; mostrándole mucha
cantidad de hierbas juntas, á lo
menos de las que más le traen en
uso, para que apartasen las unas
de las otras, y las nombrassen
por sus nombres y dixesen los
efectos que tienen y en qué
pueden servir en las medicinas,
pues tienen á Dioscórides y á
Plinio y á Leonardo Susio, y á
otros muchos que tan buena
noticia les dan de todas ellas, si
ellos las hubiesen buscado y
tratado para conocerlas. Pero el
mal es que nunca las buscan sino
cuando tienen necesidad dellas, y
por esto caen en tantos yerros, y
tan perjudiciales como aquí he
dicho. Lo mismo habían de hacer
en las piedras y raíces y gomas y
licores, y en todas las otras
medicinas; y dexando los
pecados que hacen en esto por
iñorancia, líbrenos Dios de los
boticarios que no tienen respeto
sino adquirir y ganar haciendas,
que la avaricia y codicia les hace
dejar de usar fielmente sus
oficios, porque éstos son aquellos
de quien dice Jacobo Silvio en el
proemio de su obra que hizo de
las cosas que tocan á este arte,
que se pueden llamar carniceros
y verdugos los boticarios que no
saben ni usan bien su obligación,
porque de lo que aprovecha es de
matar los hombres sin ningún
respeto ni piedad.
Verdaderamente, si no tienen
conciencia y fidelidad, y si han ya
perdido el temor de Dios por el de
los dineros, no hay cosa más
cruel que sus manos, más sin
piedad que su intención ni más
abominable que sus hechos,
porque no dan medicina que sea
buena, ni que haga buena
operación. Lo que los médicos
hacen, ellos lo dañan, ellos
destruyen la buena cura. Y
porque más claramente se
entienda quiero decir algunas
particularidades, pues que para
decirlas todas sería menester
muy largo tiempo. Tienen por flor
una cosa que diré, y es que
cuando un médico quiere recentar
una purga ó píldoras, ó otra cosa,
y pide las medicinas que entran
en ella para verlas, suele decir:
¿Tenéis buen reubarbo ó buen
agárico? Mostradlo acá. Y
entonces el boticario saca tres ó
cuatro pedazos que no valen dos
maravedises, y entre ellos uno
que es muy bueno, y antes que el
médico hable le dice: Señor, todo
el reubarbo es tal que no hay más
que pedir; pero este boleto dél es
el mejor del mundo, y por tal me
ha costado á tanto precio; dél se
podrá gastar en esta purga lo que
vuesa merced mandare. El
médico le dice: Pues echad dél
una dracma, ó media dracma
como ves que es menester; y en
volviendo las espaldas, el
boticario guarda aquello bueno y
echa de lo malo, de manera que
con un pedazo bueno vende
cuanto reubarbo tiene que no vale
nada, porque después que lo
muele y se echa en la purga, mal
se puede ver si era de lo uno ó de
lo otro.
D. Gaspar.—Si no se pudiera ver,
á lo menos podráse sentir en la
disposición y salud del enfermo,
pues no hará tan buena operación
lo malo como lo bueno.
Lerma.—Lo mesmo que digo
hacen en la escamonea, en el
acíbar y en todas las otras
medicinas desta suerte.
Pimentel.—¿Y en la cañafístola
hay algún engaño desos?
Lerma.—Si sueltan la rienda al
deseo de la ganancia, no hay
medicina en sus tiendas con que
no puedan engañar á las gentes,
y en la cañafístola hay lo que
dice. Si se receuta dos onzas
della y es la cañafístola de la
buena, sácale la pulpa necesaria,
y si es de la mala y seca, todo el
peso tiene la caña, y la pulpa no
es casi nada ni hace operación
ninguna, y para engañar á los
médicos ó á los que la compran,
meten la cañafístola en las
cuevas y lugares muy húmedos
porque parezca mejor y pese
más, y así los enfermos con la
cañafístola que les ha de
aprovechar como medicina
benedita, toman la mitad de
humedad que no obra de otra
cosa sino de destruir la salud y el
cuerpo.
Pimentel.—Y en las otras
medicinas simples ¿qué pueden ó
suelen hacer los boticarios?
Lerma.—Lo uno no conocerlas
cuando las compran ó cogen del
campo ó de los huertos en que
nacen; y lo otro, si las conocen,
no entender cuáles sean las
mejores ni las peores para usar
dellas, y lo que peor es, que hay
tantos boticarios tan necios y
iñorantes, que no saben
gramática ni entienden los
nombres de las medicinas en
latín, y cuando les dan las
receutas, por no mostrar su
iñorancia, dexan de echar aquella
medicina simple en el compuesto,
y por ventura es la que en todas
más hace al caso; y éstos tienen
á Mesue y á la declaración de los
fraires, y Antonio Musa y Jacobo
Silvio, y otros cien libros muy bien
encuadernados que no sirven de
más que de auctorizar su botica,
estando obligados á entenderlos
tan bien como los médicos
mismos. Y para que vuestras
mercedes entiendan lo que pasa,
yo sé boticario que, receutando
un médico en su casa cierta
medicina en que hubo necesidad
de poner media onza de simiente
de psilio, él no lo entendió ni supo
qué cosa era, y para salir de la
duda que tenía fuesse á casa de
otro boticario y preguntóle si tenía
psilio. El otro le respondió que sí.
Pues dadme media onza dél y
ved lo que me habéis de llevar
por ella. El otro boticario, que era
astuto y avisado, entendió luego
el negocio y díxole: No os la
puedo dar un maravedí menos de
un ducado, porque por dos
ducados compré la onza, y no os
hago poca cortesía en dárosla sin
ganancia. Pues que assí es, dixo
el que compraba, veis aquí el
ducado y dádmela. El otro lo tomó
y le dió en un papel la media onza
de psilio, y cuando lo hubo
descogido y mirado, vio que era
zaragatona y dixo: ¿Qué me dais
aquí, que esta zaragatona es?
Assí es verdad, dixo el otro que
se le había dado. Pues por cosa
que vale un maravedí, dixo él,
¿me lleváis un ducado? Sí,
respondió el que le había
vendido, que yo no os vendí la
zaragatona, sino el nombre, que
no lo sabíades, y el aviso para un
boticario como vos vale más que
diez ducados. Y aunque sobre
esto hubieron barajas y fueron
ante la justicia, se quedó con el
ducado y reyéndose todos del
boticario nescio que se lo había
dado.
D. Gaspar.—Por cierto él lo
merecía bien por lo que hizo.
Lerma.—No es menos de oir lo
que agora diré, y pasa así de
verdad; que queriendo hacer un
boticario el collirio blanco de
Rasis que aprovecha para el mal
de los ojos, viό que al cabo de las
medicinas que habían de entrar
en él estaba escrito tere sigilatim,
que quiere decir que las moliese
cada una por sí, y él entendió que
le mandaba echar una medicina
que se llamaba tierra sellada, y
teniendo todo junto para
revolverlo, llegó otro boticario, y
conociendo la tierra sellada,
díxole: ¿Qué es esto que hacéis?
En el collirio de Rasis no entra
esta medicina. Y el que lo hacía
porfiaba que sí y que así estaba
en la receuta del collirio. Sobre
porfía lo fueron á ver, donde el
boticario que había llegado de
fuera, conociendo la causa de su
yerro, le desengañó, mostrándole
lo que quería decir tere sigilatim, y
así le hizo quitar la tierra sellada,
y lo que en ello iba era que todas
las medicinas de aquel collirio son
frías, y ésta era cálida y de tal
condición, que bastaba para
quebrar los ojos en lugar de
sanarlos. Otras muchas cosas
pasan cada día desta mesma
manera, porque boticarios hay
que, siendo el espodio de Galeno,
y de los griegos Tucia, y el de
Avicena y los árabes raíces de
cañas quemadas, y el que
nosotros comúnmente usamos
dientes de elefantes, que es
verdadero marfil, ellos hacen otro
nuevo espodio echando los
huesos y canillas, y aun plega á
Dios que no sean de la primera
bestia quo hallasen muerta, y con
esto les parece que tienen
cumplido con lo que deben. Y
cuando vienen á hacer algún
compuesto en que entren muchas
medicinas, algunas dellas les
faltan, otras están dañadas, otras
secas y que les falta la virtud y no
dexan de echarlas sin tener
respeto á que: improbitas unius
simplicis totam compositionem
viciat.
D. Gaspar.—No entendemos
muy bien latín; vuestra merced lo
diga en romance.
Lerma.—Digo que la maldad de
una medicina simple, cuando se
junta con otras, destruye y hace
que no valga nada toda la
composición. Pues si esto es
assí, qué hará en la composición
de los xarabes, y purgas, y
píldoras, que alteran y
descomponen los cuerpos
humanos y más adonde entran
medicinas furiosas, recias y
venenosas, que se desvelan los
médicos por no errar en la cuantía
y en el peso y medida, y los
boticarios, yendo envidada la vida
de un hombre en acertar ó en
errar, no se les da dos maravedís
que sea más ni menos ni que
obren bien que mal. Su atención y
intención es de ganar, y sea como
fuere, que la culpa ha de ser del
médico y no del boticario.
D. Gaspar.—Esso es en las
purgas; pero en los xarabes ¿qué
hacen que no sea bien hecho?
Lerma.—Antes creo que no hay
xarabe que se haga bien en las
boticas de los hombres desta
suerte que he dicho, porque ó no
tienen los zumos tan buenos
como son menester y tan
perfectos como han de ser, ni los
echan en la cantidad que el
xarabe ha de llevar; y en el
azúcar tienen una alquimia que
siempre compran y traen el más
vellaco y más sucio que hallan,
porque con ser para xarabes,
parésceles que es pecado gastar
azúcar bueno y limpio. Y entre
diez xarabes no hallaréis los dos
que tengan el punto necesario.
Pimentel.—En esso parece que
no va tanto, aunque lo mejor sería
que todo fuese perfecto.
Lerna.—En las píldoras hay
también las mesmas faltas que en
las purgas, y aun otras que
parecen mayores, porque demás
de lo que he dicho, hay una
massa de píldoras que se quieren
gastar en haciéndose, y otras que
duran cuatro meses, y otras seis y
ocho y un año y más, pero
cuando passan de su tiempo
sécanse y pierden la virtud y
fuerza las medicinas que allí
están incorporadas, y assí no son
para aprovechar; y los boticarios
avarientos, por no perder el
intereses que dellas se les ha de
seguir, ni gastar en hacer otras de
nuevo, ¿qué pensáis que hacen?
Visitan las cajas donde tienen las
píldoras y miran un rétulo ó
cédula que tienen dentro dellas
en que está puesta la hecha del
año, mes y día, y si es pasado el
tiempo quitan aquella cédula y
ponen otra, por la cual parece que
no ha dos meses que se hicieron,
habiendo por ventura más de un
año que estaban hechas, estando
ya perdidas y corrompidas; y assí
engañan al médico que las pide y
receuta, y al enfermo que con
ellas se cura; y donde han de
hacer evacuar los humores si
estuviesen en su perfición, no
tienen fuerza más de para
alterarlos y moverlos más de lo
que están, en grandísimo daño y
perjuicio de los enfermos y de su
salud y vida. Pues en las aguas
que venden, ¿no hay engaños?
Muchas veces al medio año
acaban todas cuantas han
destilado y hinchen las redomas
de agua de la fuente ó del río, y lo
que les costó una blanca hacen
della tres ó cuatro ducados, y
jamás pedirán cosa ninguna en su
botica que digan que no la tienen
ó por gran maravilla; y dan unas
cosas por otras, diciendo que
tienen la misma propiedad y que
hacen el mismo efecto, y á esto
llaman ellos dar quid pro quo,
mudando las medicinas sin la
voluntad y consentimiento de los
médicos, por no dexar de vender
y hacer dineros. Y por ventura no
halló el licenciado Monardis
tantas medicinas en un diálogo
que hizo que se podiesen poner
unas por otras cuantas hallan los
boticarios porque los que traxeren
dineros á sus tiendas no se
vuelvan con ellos. En los aceites,
si se les van acabando, con poco
que tenga el cántaro ó la redoma,
la tornan á henchir encima del
que se vende en la plaza; y assí
me dixeron á mí de uno que
vendió un gran cántaro de aceite
rosado no teniendo sino un poco
en el hondón, sobre el cual
tornólo á henchir, y revolviéndolo
todo, quedóle un poquito de olor
con que lo pudo vender,
afirmando que era el mejor del
mundo. Y en los ingüentos
también pecan, ó por iñorancia ó
por malicia, que pocas veces
salen en su perfición. Lo mesmo
hacen en los polvos, y finalmente,
no hay medicina ninguna que no
hagan de manera que justamente
se pudiese condenar por falsa si
se pudiesen averiguar los simples
que echan en la composición, á lo
menos si son costosos ó
dificultosos de haber ó de
conocerse. Si mandaren á estos
boticarios hacer una buena triaca,
muchos de ellos no conocerían la
mitad de las medicinas simples
que entran en ella, y plega á Dios
que conozcan las de la confeción
de Hamech, que son menos y
más usadas, y las que entran en
otras confeciones desta suerte.
La triaca de esmeraldas que
venden no creo más en ella que
en Mahoma, si no la viese hacer
por los ojos, y por más cierto
tendría que echan esmeraldas
contrahechas de alquimia ó de
vidrio ó de unas que vienen de las
Indias, que de las finas; y por mi
consejo nadie las tomaría, ni
daría á quien bien quisiese, si no
la hubiese visto cuando se hacía
ó si no fuesse de mano de
boticario de quien estuviese tan
saneado que no se tuviere duda
de su conciencia y virtud.
D. Gaspar.—Harto ha dicho
vuesa merced, señor licenciado,
para que estemos más avisados y
advertidos de lo que los boticarios
pueden hacer; pero no es posible
que todos pequen tan á rienda
suelta.
Lerma.—No digo yo que todos,
porque haría injuria á algunos
buenos que hay entre ellos,
aunque no sean muchos, y los
que son malos es, ó porque son
simples y iñorantes, ó porque son
malos cristianos y tienen poco
temor de Dios, ó porque son
pobres, que la pobreza es
ocasión de grandes males.
Pimentel.—Pues, ¿qué remedio
se podría poner en este
desconcierto que bastase para
estorbar tan gran daño como los
malos boticarios hacen?
Lerma.—El primero ya yo le he
dicho, que no habían de permitir
que ninguno usase el oficio que
no fuese muy docto y muy
experimentado; y lo principal que
ha de tener es ser muy buen
gramático, para entender los
libros de su arte, muy estudioso y
curioso de saber y aprender todos
los primores que hay en ella, y sin
esto, se requiere que hayan
estudiado alguna medicina para
que sepan mejor lo que hacen.
Los boticarios que son buenos
muchas veces aprovechan de
advertir á los médicos en algunos
descuidos y yerros que hacen, y
no holgaría yo poco de que todos
los boticarios con quien tratase
fuesen tan suficientes que
supiesen hacer esto.
D. Gaspar.—¿Pues por qué os
enojasteis de que Dionisio dixo
poco ha que la cura del hígado no
iba por los términos que
convenía?
Lerma.—No me enojé yo porque
me lo dixese, sino porque me lo
dixo en público, y no ha de ser
por vía de reprensión sino de
consejo, y en esto no me negará
él que tengo razón; y, aunque no
lo quisiera decir en su presencia,
sería mal que vuesas mercedes
pensasen que ninguna cosa de
las que he dicho aquí toca en su
honor, porque yo certifico que
ninguna falta tiene para que no
sea uno de los mejores boticarios
que hay en el reino y de quien
más sin sospecha puedan
confiarse los enfermos y los
médicos que los curaren.
Pimentel.—Bien me parece que
después de descalabrado le
untéis la cabeza; yo fiador que, á
lo que creo, no os vais, señor
licenciado, sin respuesta, que no
sin causa os ha escuchado sin
contradeciros en nada. Pero
pasad adelante y decidnos otros
remedios.
Lerma.—No habían de ser los
boticarios pobres, sino que
también les habían de pedir si
tenían patrimonio de donde
ayudarse á sustentar, como
hacen á los clérigos cuando van á
ordenarse; que recia cosa sería
fiarse de un hombre pobre
muchos dineros sin contarlos, y
sin pensar que se aprovecharía
del los en sus necesidades,
podiendo hacerlo, y lo mesmo de
un boticario con pobreza las
medicinas, sin pensar que
procurase remediarla con ellas; y
por esto hay autores que dicen
que en un tiempo se tuvo en
Roma tanta cuenta con este
oficio, que las medicinas estaban
depositadas en ciertas personas
de gran confianza; que llevaban
salario por ello, y que allí iban los
médicos á tomarlas y los
boticarios las gastaban así como
las llevaban, sin que en ello, ni
por iñorancia ni por descuido,
pudiese haber yerro ninguno. El
otro remedio que se podría tener
es en las visitas que les hacen,
para las cuales, habiendo buena
gobernación, había de haber
visitadores generales que no
entendiesen en otra cosa, y éstos
habían de estar proveidos en
cada provincia y pagados del
dinero público, de manera que no
se les siguiese interés particular
ni les cupiese parte de la pena ni
de otra cosa, para que más sin
afición ni pasión pudiesen juzgar,
y que los que no hallasen
suficientes los inhabilitasen y
privasen del oficio sin tener
advertencia á la honra ó bien
particular de uno en perjuicio y
daño de toda la república.
Pimentel.—Bien sería esso, si se
hallasen personas de quien se
pudiese tener tan buena
confianza, y el rey, con otros
cuidados que tiene mayores, no
puede tener tan particular cuenta
con este negocio.
Lerma.—Pues habríala de tener
él ó los que tienen cargo de la
gobernación de sus reinos, como
lo tienen con examinar á uno que
ha de ser escribano real, que
quieren que sepa hacer bien una
escritura en que va la hacienda
de un hombre; y sería más justo
que procurasen de que también
fuesen bien hechas las medicinas
en que va la salud y vida de los
hombres, porque no son pocos
los que mueren por culpa dellos.
Y conforme á este parecer es lo
que dice Jacobo Silvio hablando
desta gente que digo: Dios haga y
provea que la justicia real alguna
vez tenga cuenta con los que
primero usan esta arte que la
hayan entendido, siendo á los
cuerpos de los hombres tan
saludable cuando bien se hace y
tan dañosa cuando iñorantemente
se trata. Y, finalmente, habrían de
tener los boticarios fieles que les
mirasen las medicinas y se las
tasasen en precios convenibles,
averiguando la costa que tienen y
dándoles ganancia con que se
pudiesen sustentar, aunque fuese
más de la que agora llevan, pues
las medicinas serían mejores y de
más valor; porque si las que
agora venden son buenas, yo
digo que las venden muy baratas,
y si son malas, en cualquiera
precio, aunque den dinero por
que las lleven, son tan caras que
ninguna mercaduría hay que tanto
lo sea.
Pimentel.—Pues, decidme,
señor licenciado: ¿de que
aprovecha el visitar las boticas
cuando los regimientos de los
pueblos traen boticarios de fuera
para hacerlo?
Lerma.—Algún fruto hace,
aunque poco, porque si los
médicos se hallan presentes,
como siempre lo están, es para
ayudar á los boticarios, y ellos
que habían de acusar sus defetos
se los encubren, porque son sus
amigos, y cuando les preguntan
alguna cosa que no saben,
responden por ellos, tomándoles
la palabra de la boca, y también
defienden algunas cosas cuesta
arriba, y con otras disimulan todos
ellos; y aun plega Dios que no
haya algunas que ni los unos ni
los otros no las entiendan. Y
sobre esto, no hay botica tan bien
visitada que si veniesse otro día
alguno que entendiese bien el
oficio no hallase cosas nuevas
que reprender y enmendar. Y
cuando ya se viene á dar la
sentencia, nunca faltan amigos y
favores que con buena maña
bastan para procurar con solicitud
que sea muy moderada; y de
ciento que podrían privar, no
hallaréis dos inhabilitados, y ya
que lo sean luego hay mil
remedios para que la sentencia
no se execute y tornen á usar sus
oficios contra justicia y conciencia
suya y de los que se lo permiten y
consienten. Dios ponga remedio
en esto, que harta necesidad hay
de que lo provea de su mano.
INTERLOCUTORES
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookfinal.com