text:
Address: 221 Bridge Road, Richmond
Phone: 9427 8772
Details: Mon to Sat 10am to 6pm, Sun 11am to 5pm
Address: 362 Smith Street, Collingwood
Phone: 9416 0711
Details: Mon to Fri 10am to 6pm, Sat to Sun 11am to 5pm
Address: Direct Factory Outlets
Cnr Centre Dandenong and Grange Roads, Cheltenham
Phone: 9585 5811
Details: Mon to Sun 10am to 6pm
Address: Cnr Tullamarine Freeway and Bulla Road, Essendon
Phone: 9374 3334
Details: Mon to Sun 10am to 6pm
Address: 20 Convention Centre Place, South Wharf
Phone: 9099 1206
Details: Mon to Sun 10am to 6pm (Fri till 9pm)
Address: Brand Smart Outlet Mall
286 Whitehorse Road, Nunawading
Phone: 9894 0634
Details: Mon to Fri 9.30am to 6pm, Sat and Sun 9.30am to 5.30pm, Public Holidays 10am to 5pm
*No Website Available.
Share| More
Send BRANDS UNITED an email:
At the time of publishing, the retailer did not provide an email address to the Bargain Shopper team. If you are the retailer, please Contact Us with your details and we will be happy to update your details.
This leading outlet is a must-stop destination for lovers of quality underwear and sleepwear. Favourite big-name brands, including Bonds, Berlei, Mossimo, Calvin Klein, Diesel, Antz Pantz, Lovable, Davenport, Mitch Dowd and many more, are up to 70 per cent off the recommended retail price all year round. You'll find everything from bras, briefs, boy-legs and singlets to men's briefs, boxers and trunks plus a great range of sleepwear for everyone. Check out the website for fantastic offers and new arrivals.
Read the latest from our Bargain Shopper editors.


text:
Kragthorpe: Corbin's success hinges on Jazz making playoffs
A free throw, a layup and a rebound.
If any or all of those plays had gone the Jazz's way at the end of road games last week, their playoff chances would be more favorable. So would my evaluation of coach Tyrone Corbin.
That's how this stuff works. If Paul Millsap makes a free throw in Milwaukee, Mo Williams converts a layup in Cleveland and anybody in a Jazz uniform rebounds the ball in Chicago, Corbin is judged better. The reality is he's responsible for those losses. And only if the Jazz make the Western Conference playoffs can Corbin's first full, 82-game season be considered successful.
His team probably overachieved for much of this season, but if Corbin's work in the first two-thirds of the schedule is undone by the ending, he will have failed.
The franchise's long-range outlook hardly hinges on whether this team qualifies for 2012-13 playoffs as a No. 8 seed. Yet I still say it's meaningful, and that make-or-miss opportunity will serve as a fair measurement of Corbin.
I want to believe in Corbin, I really do. But every time he seems to be proving himself, he regresses. When the Jazz beat Golden State right after the All-Star break, giving him a 75-74 career record, that was monumental. It meant Corbin had gone 70-56 since his 5-18 start after taking over for Jerry Sloan under tough circumstances. His current team stood 31-24, while having absorbed most of Williams' lengthy absence following thumb surgery.
But then Corbin and the Jazz gave it all back by losing seven of eight games before beating Detroit on Monday. Two losses came in overtime; two other defeats could have been reversed by last-second shots, which the Jazz missed.
In other words, Williams and Gordon Hayward could have made Corbin look good. Yet when Corbin said of his team's wobbly play in fourth quarters, "You've got to be able to manage those moments," he should have been speaking of himself.
Coaches should be judged by how their players respond in late-game sequences and not just at the very end. Williams could have salvaged a win at Cleveland, but the real story was how the Jazz blew a 12-point lead in the final eight minutes when they became rattled and had defensive lapses. And the way Corbin managed Hayward's playing time in a series of close losses undoubtedly resulted in his being worn down and ineffective at the end.
When the Jazz returned from their 0-4 trip, Corbin reflected, "It's just part of the game, part of life." And then he became defensive, paraphrasing the old Sloan stance that critics have never played in the NBA and harsh judgment is "what sells."
The irony of that mini-rant is that last week, general manager Dennis Lindsey had gone on the Jazz-owned radio station and expressly invited fans, the media and everybody else to hold the team to a high standard.
That's what I'm doing with Corbin. He's faced his share of challenges, amid injuries and his dual mission of utilizing veterans Al Jefferson and Paul Millsap while developing Derrick Favors, Enes Kanter and other young players at the same time.
That's not an easy job. But his bosses have given him enough support and resources. Jazz management left Corbin's roster intact through the NBA deadline in February not necessarily just to maximize this season's possibilities, but enabling him to follow through on what he'd done to that point.
What's more, during the entire Raja Bell saga, everything the front office did was to back Corbin. You'd better believe Jazz CEO Greg Miller would like to recoup some of Bell's $3.4 million salary via a couple of home playoff games.
By giving Bell all that money to stay home this season, management reinforced the Jazz as a coach-driven franchise. What's still in question is whether Corbin really is the right coach to drive it.

subset: commoncrawl


text:
Jason Bateman stars as bad guy Guy Trilby in 'Bad Words.'
- Filed Under
"Bad Words" will keep you laughing from beginning to end.
But you may feel twinges of guilt chuckling at a 40-year-old man who verbally and psychologically abuses children - his competitors in spelling bees - in order to win.
And there you have the premise of "Bad Words," directed by and starring Jason Bateman as Guy Trilby, who found a loophole in the bylaws of the National Spelling Bee competition that allows him to enter. ...


text:
is this $22 for a whole season? or $22 per game?
It's for the whole season. Roughly 50 cents per game.
Jump to content
Posted 06 May 2011 - 05:31 AM
is this $22 for a whole season? or $22 per game?
Posted 06 May 2011 - 08:08 AM
Posted 06 May 2011 - 09:03 AM
Posted 06 May 2011 - 09:15 AM
So what'd you end up doing?
Posted 06 May 2011 - 10:48 AM
Thats the only thing making me hesitate. I dont have a 9-5 schedule, so there are a lot of games I might not be able to make, and I dont want selling these tickets to become a major chore. I'd say I'd make it to roughly half depending on my schedule, maybe a few more.
I signed on for the $28 ST's back in mid-February. Had a 12-pack this season, and it was so much cheaper (per ticket) to go with the ST for next year that my wife and I decided we couldn't pass up the opportunity. Moved up two rows from our 12-pack seats, but in the same section. Never had ST's for anything before. It actually seems kind of overwhelming, to be honest, but of course we won't be able to make it to every game anyway. Pretty excited about it, though....
Posted 06 May 2011 - 03:05 PM
+1, he's been my rep since I first bought season tickets and I have nothing but good things to say about the guy.
Posted 06 May 2011 - 07:58 PM
Posted 06 May 2011 - 08:20 PM
Edited by NJDevs4978, 06 May 2011 - 08:20 PM.
Posted 06 May 2011 - 08:38 PM
I don't think they'd be admitting it if it were just 1400 seats sold
It's 1400 'new' season ticket holders, mostly taking advantage of the balcony deal since the $22 and $28 prices are now the lowest sth's in the arena other than the mini-$15 sections. Wouldn't be surprised if a ton of the 'new' ticket holders were actually former sth's who got priced out of the uppers in the first place (a la CRASHER)
Posted 19 July 2011 - 09:06 PM
Posted 20 July 2011 - 08:18 AM
Sumus Legio
You don't turn this around in a couple shifts. Its going to take a little time, but I know the guys will come back. Because I can see it. -- Jacques Lemaire
Posted 20 July 2011 - 08:20 AM
So I got a call from the fan experience girl today. She seems nice, but Isaac is no longer with the Devils. Anyone know what happened?
Posted 20 July 2011 - 09:49 AM
he probably realized he had talent as a salesman and wanted to make more than $8 a hour
Posted 20 July 2011 - 10:52 AM
Posted 20 July 2011 - 11:25 AM
Posted 20 July 2011 - 01:26 PM
I was going to go for the $22 sections, but I wanted to be on the side the Devils attack twice, so I went to the $28 side, section 102!
Posted 20 July 2011 - 03:04 PM
Posted 20 July 2011 - 03:48 PM
Posted 20 July 2011 - 04:07 PM
So when can we expect to see the tickets in the mail?
Season Ticket Holder since '08 - '09
Section 226 - Row 2 - Seats 15 and 16
Posted 20 July 2011 - 04:20 PM
My sarcasm meter is broken. Is this serious?
1,600 new season ticket holders baby! More to come with Parise's re-signing. We should sell-out quite a bit this year.
0 members, 0 guests, 0 anonymous users


text:
It all started in 1950, when Vern was helping his uncle deliver pianos. Soon, Vern was buying old pianos and repairing them to sell to dealers.
Eventually, Vern opened his first store in a converted radiator shop in Colton, CA. As the business grew up, he recognized the need of a larger facility, so he purchased an old dance hall and a bowling alley to expand his operation.
As his business continued to grow, this enterprising young man took over a Ford agency dealership site, and ultimately bought the old city hall and jail in Colton.
Hear the difference in a Schafer & Sons. The sound is clear, clean, and powerful.
See the difference in a Schafer & Sons. Custom designed cabinets are fashioned in the finest woods that have been both hand selected and hand finished.
We guarantee the difference. In fact, we are so confident in our quality, that we provide a very special limited lifetime warranty that is unique among piano makers.
Enter featured post/product of the week or month here.
© Copyright 2013 Schafer & Sons. www.SchaferAndSons.com


text:
I already found viewtopic.php?f=2&t=4799 which says "In your .sublime-theme, look for "class": "sidebar_label" and add "font.size": 10"
This makes sense - EXCEPT that the theme is a TextMate theme, not a Sublime Text theme, which means it's a plist, not JSON. I've tried hacking it but I haven't figured it out. Any ideas?


text:
- Filed Under
The rock band Phestur from Cleveland will be playing at 7 p.m. Saturday at the Alley Taproom, 117 W. Buckeye St., formerly known as Agitators Alley. Lead singer is Adam Hines, nephew of Grace Rohrbacher of Clyde.
"I am very proud of him," said Rohrbacher, adding that the band has been nominated for two Grammys. She said that Hines was always interested in music and has a smile that brightens the whole room. Other members are Art Koch, lead drummer and Weedge, bass player. The band has been in existence since 1999 playing at fairs and festivals and has made several albums.
Another coincidence is ...


text:
Way More Than Cake has many chocolate creations, including Heavenly Decadent cake.
- Filed Under
This time of year it's hard to escape the beady gaze of little chocolate rabbits from where they sit on grocery shelves.
They're reminders of the mixed messages society is sent about the confection: Indulge in such an unwholesome temptation now, because Easter is a feel-good holiday, but what's the excuse tomorrow?
For three local families, chocolate is a business and an art.From grandma's kitchen ...


text:
|By C. Enrique Ortiz, October 2005
The Wireless Messaging API (WMA) provides a common interface you can use to enable an application based on the Mobile Information Device Profile (MIDP) to send and receive short text and binary messages, as well as multimedia messages. These messages typically are part of store-and-forward messaging systems such as the Short Messaging Service (SMS) and the Multimedia Messaging Service (MMS) that guarantee delivery of messages.
Originally introduced in the Java Community Process as JSR 120, WMA 1.1 has been enhanced and released as WMA 2.0 in JSR 205. You can find more information on the WMA, and a reference implementation, at the WMA technology page. This article covers the differences between versions 1.1 and 2.0, and shows you how to take full advantage of this messaging API.
|WMA Overview
|WMA 2.0 Message Types
|WMA Connections
|Creating a Message Connection
|Closing a Message Connection
|Creating and Sending Messages
|Creating and Sending a Text Message
|Creating and Sending a Binary Message
|Creating and Sending a Multipart Message
|Creating Message Parts
|Waiting for Incoming Messages
|Processing Messages
|Message Persistence
|About Segmentation and Reassembly
|System Properties
|WMA 2.0 and the Push Registry
|The WMA v2.0 Reference Implementation
|About Server-to-Handset Messaging
|About the Author
WMA targets cell phones and other devices that can send and receive wireless messages. It's a generic messaging API for sending not only individual text and binary messages but the multipart payloads typically used for transmitting multimedia messages.
How messages are delivered depends on the underlying transport, or bearer, such as GSM SMS, GSM CBS, CMDA SMS, or MMS. The message format and transport are defined by the respective standards, but for the most part WMA renders such details transparent to the application. It's important to note, though, that SMS and MMS transports are actually managed differently in the network, and that MMS is not just a means to transmit larger SMS packets. WMA doesn't place limits on message size and other restrictions but do be aware that the underlying transports do, as you'll see shortly.
WMA is based on the Generic Connection Framework (GCF). It's defined as a J2ME optional package; that is, it contains specialized APIs that can be added to a software stack based on a standard configuration. WMA's lowest common denominator is the Connected Limited Device Configuration (CLDC). Because the Connected Device Configuration (CDC) is a superset of CLDC, WMA can be included in both CLDC- and CDC-based stacks. Figure 1 summarizes the components of the WMA 2.0:
WMA, a required optional package
JTWI defines minimum and common characteristics that all compliant handsets must provide; it mandates support for WMA 1.1, but not WMA 2.0. MSA continues the evolution of mobile architectures and specifies WMA 2.0 to be a mandatory package.
Even though WMA is an optional package with regard to the Java Platform, Mobile Edition (Java ME) as a whole, its presence is mandatory on handsets that claim to comply with JSR 185, the Java Technology for the Wireless Industry (JTWI) specification, and with JSR 248, the new Mobile Service Architecture (MSA) for CLDC.
All WMA-specific interfaces and classes are contained in a single package,
javax.wireless.messaging, which defines all the APIs required for sending and receiving wireless text, binary, and multi-part messages. Table 1 summarizes this package:
Base message interface, from which subinterfaces such as
TextMessage, and
MultipartMessage are derived
Subinterface of
Message that represents a binary message and provides methods to set and get the binary payload
Subinterface of
Message that represents a text message and provides methods to set and get the text payload
Subinterface of the GCF Connection, which provides a factory of
Messages, and methods to send and receive
Defines the listener interface to implement asynchronous notification of
Message objects
Defines a message part that can be added to a
Subinterface of
Message that represents a multi-part message and provides methods to set and get multiple payloads
Exception thrown if the multipart message content is larger than the available memory or supported size for the message part
The differences between WMA versions 1.1 and 2.0 are related primarily to the support of multi-part messages used for MMS messaging. The next several sections provide some of the particulars of the different components of WMA. For the low-level details of each of the WMA methods, consult the WMA specification.
WMA 2.0 defines four message representations, or types. In addition, it defines a message part in support of multipart messages, used for carrying multimedia messages. The next five sections describe the interfaces that represent messages, and the class that represents a message part.
Message Interface
The interface
javax.wireless.messaging.Message is the base type for all messages communicated using WMA - a
Message is what is sent and received, produced and consumed. In some respects, a
Message looks similar to a datagram: it has source and destination addresses, and a payload.
There are significant differences too. A WMA
Message includes a timestamp, and supports multiple payload types, as defined by its subinterfaces. Moreover, because wireless messaging is typically implemented on top of store-and-forward systems such as SMS and MMS, message delivery is reliable, guaranteed, and even traceable.
The interface specifies methods to get and set the message's source and destination addresses, and to get its timestamp:
String getAddress();
void setAddress(String address);
Date getTimestamp();
WMA 2.0 defines three subinterfaces of
Message, seen in Figure 2:
BinaryMessage is for short binary messages typically over SMS.
TextMessage is for short text messages typically over SMS.
MultipartMessage is for multi-media messages typically over MMS.
BinaryMessage Interface
BinaryMessage subinterface represents a message with a binary payload, typically an SMS-based short binary message. A binary payload is encoded using 8-bit data, allowing 140 bytes per segment 133 if a port number is used. For more information about message segmentation refer to the section " About Segmentation and Reassembly" later in this article. This interface declares methods to set and get the binary payload as an array of bytes:
byte[] getPayloadData();
void setPayloadData(byte[] bytes);
Methods to set and get the address of the message, and to get its timestamp, are all inherited from
TextMessage Interface
TextMessage subinterface represents a message with a text payload, typically an SMS-based short text message. This interface provides methods to set and get the text as an instance of
String getPayloadText();
void setPayloadText(String data);
The underlying implementation is responsible for properly encoding or decoding the
String to or from the appropriate format before the text message is sent or received. The character encoding that's used affects the size of the message. For example, GSM 7-bit allows 160 characters per segment, or 152 if a port number is used, while UCS-2 allows for 70 double-byte characters per segment, or 66 if a port number is used. Again, refer to the section " About Segmentation and Reassembly" for more information. As with
BinaryMessage, the methods to set and get the address of the message and get its timestamp are inherited from
MultipartMessage Interface
MultipartMessage subinterface represents a message that consists of multiple parts, typically an MMS-based multimedia message. This interface defines a container of one or more
MessageParts, and provides methods to manage the sender and recipient addresses, the message's headers, the "start message" content ID, and the message's parts:
boolean addAddress(String type, String address);
void addMessagePart(MessagePart messagePart) throws SizeExceededException;
String getAddress();
String[] getAddresses(String type);
String getHeader(String headerField);
MessagePart getMessagePart(String contentID);
MessagePart[] getMessageParts();
String getStartContentId();
String getSubject();
boolean removeAddress(String type, String address);
void removeAddresses();
void removeAddresses(String type);
boolean removeMessagePart(MessagePart messagePart);
boolean removeMessagePartId(String contentID);
boolean removeMessagePartLocation(String contentLocation);
void setAddress(String address);
void setHeader(String headerField, String headerValue);
void setStartContentId(String contentID);
void setSubject(String subject);
MultipartMessage overrides the methods to set and get the message's address it inherits from
Multipart messages follow the format of standard emails, which consist of RFC822-based headers and multiple parts based on the Multipurpose Internet Mail Extensions (MIME) standard defined by the World Wide Web Consortium (W3C) in RFC2045 and RFC2046, as Figure 3 illustrates:
MultipartMessage interface represents the multimedia message and its headers, while a
MessagePart class instance represents each individual MIME part.
MessagePart Class
As its name suggests,
MessagePart represents one part of a message. In addition to various constructors, this class provides methods to retrieve the content, and information about the content:
MessagePart(byte[] contents, int offset, int length, String mimeType, String contentId, String contentLocation, String encoding) throws SizeExceededException;
MessagePart(byte[] contents, String mimeType, String contentId, String contentLocation, String encoding) throws SizeExceededException;
MessagePart(java.io.InputStream is, String mimeType, String contentId, String contentLocation, String encoding) throws IOException, SizeExceededException;
public byte[] getContent();
public InputStream getContentAsStream();
public String getContentID();
public String getContentLocation();
public String getEncoding();
public int getLength();
public String getMIMEType();
A message part consists of a MIME type as defined in RFC2046, a content ID, a content location, and the content itself. You can construct a
MessagePart from a byte array or a
In the Wireless Messaging API, input, output, and network connectivity are based on the Generic Connection Framework (GCF). WMA connections are based on the
MessageConnection interface, which is a subinterface of GCF's
javax.microedition.io.Connection, as illustrated in the next figure:
MessageConnection interface defines factory methods for creating
BinaryMessages, and
MultipartMessages, a method to calculate the number of protocol segments needed for sending the message, methods to receive and send messages, and a method to set the message listener for this connection:
Message newMessage(String type);
Message newMessage(String type, String address);
int numberOfSegments(Message message);
Message receive() throws IOException, InterruptedIOException;
void send(Message message) throws IOException, InterruptedIOException;
void setMessageListener(MessageListener messageListener) throws IOException;
In addition, the interface defines
String constants, one of which you pass to the
newMessage() factory method to identify the type of
Message to create:
String TEXT_MESSAGE = "text";
String BINARY_MESSAGE = "binary";
String MULTIPART_MESSAGE = "multipart";
When creating a message connection, always use one of these constants. Note that the WMA implementation uses
String.equals() to compare the string values, making these message types case-sensitive.
You open and close a
MessageConnection just as you do any other GCF Connection. To create the connection, call the connection factory's method
javax.microedition.io.Connector.open(). To close it call the appropriate method of the base connection interface,
javax.microedition.io.Connection.close(). You can have multiple
MessageConnections open simultaneously.
You can create a
MessageConnection in either of two modes: as a client connection or as a server connection. A client connection can only send messages, while a server connection can both send and receive. As with other GCF connections, you specify a connection as either client or server by way of the URL, as here:
scheme://address-part [params]
scheme is the protocol to use
address-part is the protocol-specific address for client or server connections
params are scheme-dependent optional parameters in the form
WMA 2.0 Supported Protocol Adapters and Standards
Support for WMA protocol adapters is based on the following standards:
The URL
scheme for creating a
MessageConnection is not specific to a single protocol. Instead it is intended to support many wireless messaging protocols. The WMA specification defines the following messaging protocol adapters:
sms for Short Messaging System. SMS is bi-directional: you can create, send, and receive messages and thus support both client and server connections.
mms for Multimedia Messaging System. Like SMS, MMS is bi-directional, and thus supports both client and server connections.
cbs for Cell Broadcast Short
Message. CBS messages are broadcast by a base station, and can only be received; attempting to send over a
cbs connection results in an
IOException. CBS messages don't have a timestamp; trying to get a message's timestamp returns a
address-part of the URL specifies the handset and application. It also specifies whether the connection is a client or a server. A URL for a client connection includes a full destination address, while the URL for a server connection specifies a local address no host, just a protocol-specific local address, typically a port number or an application ID. For
sms the
address-part comprises an MSISDN that identifies the handset, a port number that identifies the application, or both. For
mms, the
address-part could consist of an email address, phone number, IPv4, IPv6, or shortcode-address, or an application ID, or both. For
cbs, which supports only receiving messages (server mode), the
address-part is only a port number that identifies the application.
Examples of client connection URLs:
(MessageConnection)Connector.open ("sms://+15121234567:5000");
(MessageConnection)Connector.open ("mms://+15121234567: com.j2medeveloper.MyMmsApp");
No example for
cbs is included, as
cbs supports only server connections.
Examples of server connection URLs:
About Application IDs and Port Numbers
Application IDs identify the receiving application on a handset. For example, in the two URLs
sms://+5121234567:5000 and
mms://+5121234567:com.j2medeveloper.MyMmsApp , the number
5000 and the string
com.j2medeveloper.MyMmsApp are both application identifiers. In
sms and
cbs , applications are identified by port numbers, similarly to how port numbers are used for TCP and UDP connections. In
mms , applications are identified by a string that typically is a fully qualified name such as
com.j2medeveloper.MyMmsApp rather than a port number. Note that a port number takes space, typically 16 bits, away from the actual content of a short message. MMS application IDs, which can't exceed 32 characters in length, are optionally included as part of the multipart
Content-Type message header. Creating an MMS server connection that specifies the application ID
com.j2medeveloper.MyMmsApp will cause two parameters to be added to the value of the
Content-Type message header:
When a server connection is opened, a port number or application ID is specified (depending on the protocol used). A client wanting to send a message to that server application must indicate that same port number or application ID. The first application to bind to a given port number or application ID gets it, and attempting to bind to an already reserved local port number or application ID throws an
IOException that your code must handle appropriately.
You can pick a random port number to use from the private/dynamic port range 49152-65635; the range 0-49151 is used by privileged applications or user applications such as WAP; refer to the WMA 2.0 specification for more information on which ones you should avoid. You can reserve your own port number for your application by contacting the Internet Assigned Numbers Authority (IANA).
Note that sending a message to a handset without specifying a port number or application ID to identify an application typically causes that message to be delivered to the handset's default viewer application.
For more information about URLs see the articles " The Generic Connection Framework," and " A Generic Connection Framework cheat sheet."
As Table 1 shows,
MessageConnection provides the methods
send(), and
receive(), to create, send, and receive
Message objects respectively. The
numberOfSegments() method is of particular interest; it's used to determine segment information for a given
Message before it is sent see " About Segmentation and Reassembly" for more information. You use
setMessageListener() to set the message listener that is called by the WMA implementation when new messages arrive.
WMA is a very intuitive, very simple-to-use API. Let's go over some code that shows how to take advantage of it.
To create a client
MessageConnection you call the connection factory method
Connector.open(), passing a URL that specifies a valid WMA messaging protocol, and that includes either the local address for a server connection, or a full destination address for a client connection:
... MessageConnection mc = null; String connUrl = "mms://:com.j2medeveloper.MyMmsApp"; // My MMS server app ... try { mc = (MessageConnection)Connector.open(connUrl); } catch (IOException ioe) { // Port number or application identifier is already reserved } catch (SecurityException se) { // Permission to open the MessageConnection was not granted } ...
It is good practice to define your application's port numbers and application identifiers in the Java Application Descriptor (JAD) file, and retrieve these at runtime, typically during application startup.
For instance, we can place the following attributes in the JAD file:
... SmsApplicationPort: 50000 CbsMessageID: 50001 MmsApplicationID: com.j2medeveloper.MyMmsApp ...
To retrieve each of these attributes, we call
MIDlet.getAppProperty(String attributeName), passing it the name of the attribute to get. For illustration, let's define the helper method
loadWmaAttributes() to retrieve the WMA port and application ID from the JAD:
... // Define the SMS and MMS Port and Application Identifiers String smsPort; String cbsMsgId; String mmsAppId; ... /** * Loads the application WMA attributes */ private void loadWmaAttributes() { mmsAppId = getAppProperty("MmsApplicationID"); smsAppId = getAppProperty("SmsApplicationPort"); cbsAppId = getAppProperty("CbsMessageID"); } ...
To illustrate how to create a connection, let's define the helper method
newMessageConnection(), which creates and returns a
/** * Create a new MessageConnection * * @param connUrl is the server or client URL for the connection * @param messageListener is the message listener for this * connection * @return a MessageConnection object * @throws a ConnectionNotFoundException if * the Connection target is not found, * or the protocol not supported * @throws an IOException if * the Port number or application identifier is already reserved, * or the connection has been closed, * or if an attempt is made to register a listener on a client * connection * @throws an IllegalArgumentException if * a Message type parameter is invalid * or attempting to create a *Stream * @throws SecurityException if * permission to open the MessageConnection was not granted, * or, when setting the message listener, it was determined * that the application does not have permission to receive * on the given port number */ final public MessageConnection newMessageConnection( String connUrl, MessageListener messageListener) throws ConnectionNotFoundException, IOException, IllegalArgumentException, SecurityException { MessageConnection mc = null; mc = (MessageConnection)Connector.open(connUrl); mc.setMessageListener(messageListener); return(mc); }
The connection factory returns a
Connection subtype that must be properly cast; in our example, we cast the value returned by
Connector.open() to a
MessageConnection, which we then return to the caller. The helper method also sets a message listener for the connection, if one is specified. Note that setting the connection's message listener to
null deregisters any current message listener, which will then not receive any notifications. I'll cover message listeners later in the article.
Although GCF provides convenience methods to create
InputStream and
OutputStream for
StreamConnections, be aware that
MessageConnection doesn't support stream-based operations. Attempting to create a
*Stream will throw an
To close a connection, call the connection's
close() method, as shown in the next code snippet:
/** * Closes the specified message connection * * @param connection is the connection to close */ static final public void closeConnection(MessageConnection connection) { try { if (connection != null) { connection.setMessageListener(null); // deregister the msg listener connection.close(); } } catch (IOException ioe) { // Handle or ignore the exception... } }
This method first deregisters any message listener and then closes the connection. Don't forget to call the above method to close connections and unset your message listeners during cleanup, in
Recall that
MessageConnection provides methods to create and send
Messages. To create a message call the message factory method
newMessage(), and to send a message use the method
send(). Note that
newMessage() will return a message even if the connection has been closed.
As you learned earlier, you can create either a client connection or a server connection, specifying your choice in the connection URL. A message created from a client connection has its destination address already set, taken from the connection URL passed when the client connection was created. A server connection's destination address, on the other hand, is not already set; you must set it explicitly before sending the message.
Let's define the helper method
sendMessage() to send
Messages. The method takes for parameters the
MessageConnection to use, the actual
Message to send
MultipartMessage or
TextMessage - and the optional destination URL.
A non-
null URL indicates that the caller wants to set the destination address before sending the message, as in the case of server connections. The method also checks whether the message can be sent, by calling the method
Our example follows good practice by sending the message on its own thread of execution, to avoid contention with system threads such as the main display thread. The helper method
alertUser() is not shown; it's called here to warn the user if the message can't be sent. Note the different exceptions that could arise while sending the message:
/** * Sends a Message on the specified connection * * @param mc the MessageConnection * @param msg the message to send * @param url the destination address, typically used in server mode */ final public void sendMessage( final MessageConnection mc, final Message msg, final String url) { Thread th = new Thread() { public void run() { try { if (url!= null) msg.setAddress(url); int segcount = mc.numberOfSegments(msg); if (segcount == 0) { alertUser(UiConstants.TXT_SEGCOUNT); } else { mc.send(msg); } } catch(Exception e) { // Handle the Exception: // IOException if the message could not be sent // because there was a network failure or // if the connection was closed // IllegalArgumentException if the message was // incomplete or contained invalid information // This exception is also thrown if the payload // of the message exceeds the maximum length // for the given messaging protocol // InterruptedIOException if a timeout occurs // while trying to send the message or this // Connection object was closed during this // send operation // NullPointerException if the parameter is null // SecurityException if the application does not // have permission to send the message } } }; th.start(); }
Now that we have covered the generic
sendMessage() helper method, let's define a helper method to send a
/** * Sends a TextMessage on the specified connection * * @param mc the MessageConnection * @param msg the TextMessage to send * @param url the destination address, typically used in server mode */ final public void sendTextMessage( MessageConnection mc, TextMessage msg, String url) { sendMessage(mc, msg, url); }
The method assumes the
TextMessage has already been created. Let's now define a more useful version of
sendTextMessage(), one that takes an ordinary
String for input, and creates and sends the
TextMessage for us. Before sending, the method populates the outgoing
TextMessage by calling the method
/** * Sends a TextMessage on the specified connection * * @param mc the MessageConnection * @param msg the message to send * @param url the destination address, typically used in server mode */ final public void sendTextMessage( MessageConnection mc, String msg, String url) { TextMessage tmsg = null; tmsg = (TextMessage) mc.newMessage(MessageConnection.TEXT_MESSAGE); tmsg.setPayloadText(msg); sendTextMessage(mc, tmsg, url); }
Sending binary and multipart messages follows the same pattern.
Now let's define another helper method, one to send a
/** * Sends a BinaryMessage on the specified connection * * @param mc the MessageConnection * @param msg the Binary Message to send * @param url the destination address, typically used in server mode */ final public void sendBinaryMessage( MessageConnection mc, BinaryMessage msg, String url) { sendMessage(mc, msg, url); }
The method assumes the
BinaryMessage has already been created. Let's now define a more useful version of
sendBinaryMessage(), one that takes a byte array for input, and creates and sends the
BinaryMessage for us. Before sending, the method populates the outgoing
BinaryMessage by calling the method
/** * Sends a BinaryMessage on the specified connection * * @param mc the MessageConnection * @param msg the byte[] message to send * @param url the destination address, typically used in server mode */ final public void sendBinaryMessage( MessageConnection mc, byte[] msg, String url) { BinaryMessage bmsg; bmsg = (BinaryMessage) mc.newMessage(MessageConnection.BINARY_MESSAGE); bmsg.setPayloadData(msg); sendMessage(mc, bmsg, url); }
Let's define one more helper method, to send a
/** * Sends a multi-part message on the specified connection * * @param mc the MessageConnection * @param msg is the multiplart message to send * @param url the destination address, typically used in server mode */ final public void sendMultipartMessage( MessageConnection mc, MultipartMessage msg, String subject, String url) { sendMessage(mc, msg, url); }
The method assumes the
MultipartMessage has already been created. As for text and binary messages, we'll define a more useful version of
sendMultipartMessage(), one that takes an array of
MessageParts for input, and creates and sends the
MultipartMessage for us. Before sending, the method populates the outgoing
MultipartMessage by adding to it each individual
MessagePart. The method takes a lot of arguments: the
MessageConnection; an array of
MessageParts; the start-content ID; lists of TO, CC, and BCC identifiers; a message subject; the message's priority; and the destination URL.
/** * Sends a multi-part message on the specified connection * * @param mc the MessageConnection * @param msgParts the array of message parts to send * @param startContentID is the ID of the start multimedia * content part (SMIL) * @param to is the message's TO list * @param cc is the message's CC list * @param bcc is the message's BCC list * @param subject is the message's subject * @param priority is the message's priority * @param url is the destination URL, typically used in server mode */ final public void sendMultipartMessage( MessageConnection mc, MessagePart[] msgParts, String startContentID, String[] to, String[] cc, String[] bcc, String subject, String priority, String url) { try { int i=0; MultipartMessage multipartMessage; multipartMessage = (MultipartMessage) mc.newMessage(MessageConnection.MULTIPART_MESSAGE); if (to != null) { for (i=0; i<to.length; i++) { multipartMessage.addAddress("to", to[i]); } } if (cc != null) { for (i=0; i<cc.length; i++) { multipartMessage.addAddress("cc", cc[i]); } } if (bcc != null) { for (i=0; i<bcc.length; i++) { multipartMessage.addAddress("bcc", bcc[i]); } } multipartMessage.setSubject(subject); if ((priority.equals("high")) || (priority.equals("normal")) || (priority.equals("low"))) { multipartMessage.setHeader("X-Mms-Priority", priority); } for (i=0; i<msgParts.length; i++) { multipartMessage.addMessagePart(msgParts[i]); } multipartMessage.setStartContentId(startContentID); sendMessage(mc, multipartMessage, url); } catch(Exception e) { // Handle the exception... } }
For multimedia messages with presentation information, such as those in the Synchronized Media Integration Language (SMIL) defined by the World Wide Web Consortium (W3C), the multipart message's start-content ID should always be set to point to the message part that contains the presentation information. You do so by calling the method
setStartContentId(). You may set the start-content ID to
null; if it's not
null the reference must be to a valid message part, or an
IllegalArgumentException will be thrown. The result of this call is that the MMS content type becomes
application/vnd.wap.multipart.related, followed by a start parameter as shown next. Recipients of this type of message will then know how to retrieve the presentation information and present the message to the user appropriately.
[THE FOLLOWING ARE THE MMS HEADERS] X-Mms-Message-Type: m-send-req X-Mms-Transaction-ID: 123456 X-Mms-Version 1.0 X-Mms-Message-Class: Personal X-Mms-Expiry: 36000 X-Mms-Priority: Normal From: +15121234567 To: +15121234544 Date: Fri, 17 May 2005 21:30:30 -0600 Subject: A multimedia message sample Content-Type: application/vnd.wap.multipart.related;start=<start>; type=application/smil;Application-ID=com.j2medeveloper.MyMmsApp; Reply-To-Application-ID = com.j2medeveloper.MyMmsApp nEntries: 2 [THE FOLLOWING IS THE MMS BODY THAT CONSIST OF MESSAGE PARTS] [EACH MESSAGE PART CONSISTS OF TYPE, CONTENT ID, AND CONTENT] Content-Type: image/png; name="image1.png" content-id: <001> [...IMAGE DATA...] Content-Type: application/smil; name="first.sml" content-id: <start> <smil> <body> <seq repeatCount="indefinite"> <img src="image1.png" dur="3s" /> </seq> </body> </smil>
Next let's look at
As you've seen,
MessageParts are at the center of
MultipartMessages; each comprises a MIME type, a unique content ID, and the content itself.
You can construct a
MessagePart from a byte array or a
java.io.InputStream. Three constructors are available:
MessagePart(byte[] contents, int offset, int length, String mimeType, String contentId, String contentLocation, String encoding) throws SizeExceededException;
MessagePart(byte[] contents, String mimeType, String contentId, String contentLocation, String encoding) throws SizeExceededException;
MessagePart(java.io.InputStream contents, String mimeType, String contentId, String contentLocation, String encoding) throws IOException, SizeExceededException;
contents refers to the actual message content.
mimeType is the MIME type, as defined in RFC2046.
contentId is a required ID that uniquely identifies a message part, as defined in RFC2045.
contentLocation specifies the filename for the attached message represented by the content. A
null value means that no content location value is set for this message part.
encoding identifies the content's encoding scheme. A
null value means that no encoding is specified for this message part.
The first two constructors enable you to create the message part from a byte array, while the last constructor enables you to create the message part from an
InputStream. A rule of thumb says that you should construct the message part from an
InputStream instead of a
byte[] if the content size is close to 10KB.
The following code snippet illustrates now to create two message parts, one
text/plain and the other
public final static String MIMETYPE_TEXT_PLAIN = "text/plain"; public final static String MIMETYPE_IMAGE_PNG = "image/png"; ... MessagePart textMessagePart, imageMessagePart; try { // Create a text/plain part String textContent = "Hello world"; String textContentId = "text_hello"; String textContentLocation = "/helloworld.txt"; textMessagePart = new MessagePart( textContent.getBytes(), 0, textContent.length(), MIMETYPE_TEXT_PLAIN, textContentId, textContentLocation, null); // Create an image/png part InputStream imageContent; String imageContentId = "img_hello"; String imageContentLocation = "/helloworld.png"; imageContent = getClass().getResourceAsStream (imageContentLocation); imageMessagePart = new MessagePart( imageContent, MIMETYPE_IMAGE_PNG, imageContentId, imageContentLocation, null); } catch (SizeExceededException see) { // Handle exception } catch (IOException ioe) { // Handle exception }
Your code must handle the following exceptions:
IOException if an exception other than
EOFException occurs while reading the
IllegalArgumentException if the specified MIME type is
SizeExceededException if the content size is larger than the available memory or the size is not supported for the message part.
Once the individual message parts have been created, we are ready to send them using the
sendMultipartMessage() helper method you saw earlier, that automatically creates and sends the
MultipartMessage for us.
... String connUrl = ...; MessageConnection mc; MessagePart textMessagePart, imageMessagePart; MessagePart[] msgParts; ... mc = newMessageConnection(connUrl, null); ... // Create a message parts array textMessagePart = new MessagePart(...); imageMessagePart = new MessagePart(...); msgParts = new MessagePart[2]; msgParts[0] = textMessagePart; msgParts[1] = imageMessagePart; // Send the multiple parts sendMultipartMessage(mc, msgParts, connUrl); ...
Recall that only a server-mode
MessageConnection can receive messages. There are two approaches to receiving messages:
The approach to choose is really a matter of personal preference. I personally prefer the asynchronous approach, to avoid having a thread running even when there are no messages to process. This approach may be a bit more expensive on resources, as a new thread needs to be created and dispatched for each incoming message; but as the typical WMA use case is for messages that are not that frequent, the cost of dispatching one thread per message is acceptable.
Note that before a message is delivered to the application, the WMA implementation may request user confirmation.
For synchronous messaging you normally dispatch a thread during MIDlet initialization. This thread loops for messages, invoking
Message.receive() to block while it waits for incoming messages, then consuming them as they become available. As an example let's define the class
MySynchronousMsgReader, a Runnable that implements a Thread of execution to wait for and process incoming messages.
public class MySynchronousMsgReader implements Runnable { MessageConnection messageConnection; boolean done; ... /** * Constructor * * @param messageConnection is the MessageConnection to use */ public MySynchronousMsgReader( MessageConnection messageConnection) { this.messageConnection = messageConnection; Thread th = new Thread(this); th.start(); } ... /** * Sets the done flag to true */ public void setDone() { done = true; } /** * Message receive thread of execution */ public void run() { while (!done) { try { Message message; message = messageConnection.receive(); if (message != null) { processMessage(message); } } catch (IOException ioe) { // Handle or ignore the exception } } } /** * Process the message * * @param message is the Message to process */ public void processMessage(message) { // Here process the message } ... }
I'll discuss message processing shortly.
For asynchronous messaging WMA implements the conventional Observer or Listener design pattern for receiving messages asynchronously; that is, without blocking while waiting for messages. WMA defines the
MessageListener interface, with a single method,
notifyIncomingMessage(), which the platform invokes each time it receives a
To use a message listener the application must implement the interface
MessageListener and its
notifyIncomingMessage() method, thus:
public class MyClass implements MessageListener { ... /** * Asynchronous callback for inbound message * Called by the WMA implementation when a new message is ready. * * @param connection is the message connection with incoming * messages. */ public void notifyIncomingMessage(MessageConnection connection) { readMessageThreaded(connection); } ... }
The message listener's
notifyIncomingMessage() method receives the
MessageConnection with inbound messages for input. Once this method has been invoked, the application must retrieve the new message by calling
messageConnection.receive(). The following methods implement some helper methods to receive messages.
///////////////////////////////////////////////////////////////////// // Receive Helper Methods ///////////////////////////////////////////////////////////////////// /** * Thread of execution to read messages from MessageConnection * * @param messageConnection is the messageConnection with inbound * messages */ public void readMessageThreaded(final MessageConnection messageConnection) { Thread th = new Thread() { public void run() { readMessage(messageConnection); } }; th.start(); } /** * Reads a message from MessageConnection, processes the message * @param messageConnection is the messageConnection with inbound * messages */ public void readMessage(final MessageConnection messageConnection) { try { Message message = null; message = messageConnection.receive(); if (message != null) { processMessage(message); } } catch (IOException ioe) { System.out.println("readMessage exception: " + ioe); } } /** * Process the message * @param message is the Message to process */ public void processMessage(message) { // Here process the message }
Remember that, to enable asynchronous messaging, the application must register a message listener with the connection by calling
MessageConnection.setListener(), as in the helper method
newMessageConnection() you saw earlier. Also see that setting the connection's message listener to
null deregisters any current message listener, which will then not receive any notifications.
... mc.setMessageListener(messageListener); ...
Note that the
readMessageThreaded() method we just defined spawns its own thread of execution to read the message. Because the listener method is called by the platform, you must always minimize the processing it does on the system thread. You should always dispatch a separate thread of execution to consume and process the message, so the platform spends as little time as possible in
Once a message has been read by calling
messageConnection.receive(), it's ready for processing. The return type of
receive() is the generic supertype
Message, so before you can process the message appropriately you must discover its subtype:
MultipartMessage, or
Let's define a helper method that can be used to view WMA messages through MIDP's Liquid Crystal Display User Interface (LCDUI). It takes a
Message for input and returns UI elements or Items the application can display on an LCDUI Form. The
processMessage() method uses the
instanceof operator to learn the
Message's subtype, then calls the appropriate process-message method, which returns an array of
/** * ProcessMessage processes a Message */ public Item[] processMessage(Message message) { Item[] items = null; // Process the received message appropriately to its type if (message instanceof TextMessage) { TextMessage tmsg = (TextMessage)message; items = processTextMessage(tmsg); } else if (message instanceof BinaryMessage) { BinaryMessage bmsg = (BinaryMessage)message; items = processBinaryMessage(bmsg); } else if (message instanceof MultipartMessage) { MultipartMessage mpmsg = (MultipartMessage)message; items = processMultipartMessage(mpmsg); } else { // Ignore System.out.println("Unrecognized message type..."); return null; } return items; }
This method delegates the actual work of processing the message and returning the array of
javax.microedition.lcdui.Items to one of three helpers. One of these,
processTextMessage(), retrieves a text message's payload by calling
TextMessage.getPayloadText(), then returns a one-element
StringItem array that contains the message's text:
/** * Process TextMessage * * @param tmsg is the TextMessage to process */ public Item[] processTextMessage(TextMessage tmsg) { Item[] items; String text = tmsg.getPayloadText(); items = new Item[1]; Item item = new StringItem(null, text); items[0] = item; return items; }
processBinaryMessage() helper method is similar, but instead of processing a text message it retrieves a binary message's payload by calling
BinaryMessage.getPayloadData(), converts the byte array to a hexadecimal string, then returns a one-element
StringItem array that contains the hex:
/** * Process BinaryMessage * * @param bmsg is the BinaryMessage to process */ public Item[] processBinaryMessage(BinaryMessage bmsg) { Item[] items; byte[] data = bmsg.getPayloadData(); String hex = toHex(data); items = new Item[1]; Item item = new StringItem(null, hex); items[0] = item; return items; } /** * toHex converts a byte array to human-readable hexadecimal * This method was borrowed from examples in the Sun Wireless * Toolkit :-) * @param data is the array of bytes to convert * @return a String containing the byte[] in hexadecimal format */ final private String toHex(byte[] data) { StringBuffer buf = new StringBuffer(); for (int i = 0; i < data.length; i++) { int intData = (int)data[i] & 0xFF; if (intData < 0x10) buf.append("0"); // display 2 digits per byte i.e. 09 buf.append(Integer.toHexString(intData)); buf.append(' '); } return (buf.toString()); }
The next helper method,
processMultipartMessage() is a bit more complex.
The MMS headers in a
MultipartMessage are used to ensure delivery of the message from a sender to a recipient, and contain information such as TO, CC, BCC, and FROM addresses. The MMS body itself comprises one or more message parts, each consisting of headers, type, and body.
Each individual message part can be of any MIME type, but the message's overall MMS content type is one of three:
application/vnd.wap.mms-message if it is not a true multimedia message
application/vnd.wap.multipart.related if it is a multimedia message with related presentation information
application/vnd.wap.multipart.mixed if it is a multimedia message with unrelated parts
The following helper method
processMultipartMessage() retrieves the
MultipartMessage header information, then each message part, and finally returns an array of
Items that correspond to each part's MIME type.
... // MIME Types public final static String MIMETYPE_TEXT_PLAIN = "text/plain"; public final static String MIMETYPE_TEXT_XML = "text/xml"; public final static String MIMETYPE_TEXT_HTML = "text/html"; public final static String MIMETYPE_IMAGE_PNG = "image/png"; public final static String MIMETYPE_IMAGE_JPEG = "image/jpg"; public final static String MIMETYPE_IMAGE_GIF = "image/gif"; public final static String MIMETYPE_APPLICATION_OCTET_STREAM = "application/octet-stream"; ... /** * Process MultipartMessage * * @param mpmsg is the MultipartMessageto process * @return array of javax.microedition.lcdui.Item */ public Item[] processMultipartMessage(MultipartMessage mpmsg) { // Get the Multipart message headers from the access methods: // X-Mms-From, X-Mms-To, X-Mms-CC, X-Mms-BCC, X-Mms-Subject String from = mpmsg.getAddress(); String tos[] = mpmsg.getAddresses("to"); String ccs[] = mpmsg.getAddresses("cc"); String bccs[] = mpmsg.getAddresses("bcc"); String froms[] = mpmsg.getAddresses("from"); String subject = mpmsg.getSubject(); // Get the rest of the headers by calling the getHeader() method String mmsPriorityHeader = mpmsg.getHeader("X-Mms-Priority"); String mmsDeliveryTimeHeader = mpmsg.getHeader("X-Mms-Delivery-Time"); // Get the message timestamp Date timestamp = mpmsg.getTimestamp(); // Get the start-content ID, which will be set for multimedia // content, and will contain the presentation information // (not used in this method) String startContentID = mpmsg.getStartContentId(); // Get to the message parts array MessagePart[] messageParts = mpmsg.getMessageParts(); int itemCount = messageParts.length + 2; // +2 is to account for from & subject Item[] messageItems = new Item[messageParts.length]; // Create the UI elements for the message's Date and Subject messageItems[0] = new StringItem("From", from); messageItems[1] = new StringItem("Subject", subject); // process each message part for (int i=0; i<messageParts.length; i++) { MessagePart messagePart = messageParts[i]; if (messagePart != null) { String mimeType = messagePart.getMIMEType(); int length = messagePart.getLength(); byte[] content = messagePart.getContent(); String encoding = messagePart.getEncoding(); // Message content can be retrieved as an InputStream InputStream contentAsInputStream = messagePart.getContentAsStream(); // Used for multimedia messages, such as SMIL messages String contentID = messagePart.getContentID(); String contentLocation = messagePart.getContentLocation(); try { // text/plain if (mimeType.equals(MIMETYPE_TEXT_PLAIN)) { String text = new String(content); messageItems[i] = new StringItem(null, text); } // text/xml else if (mimeType.equals(MIMETYPE_TEXT_XML)) { messageItems[i] = new StringItem(null, "text/xml is not supported"); } // text/html else if (mimeType.equals(MIMETYPE_TEXT_HTML)) { messageItems[i] = new StringItem(null, "text/html is not supported"); } // application/octet-stream else if (mimeType.equals (MIMETYPE_APPLICATION_OCTET_STREAM)) { String hex = toHex(content); messageItems[i] = new StringItem(null, hex); } // image/png else if (mimeType.equals(MIMETYPE_IMAGE_PNG)) { Image img = Image.createImage(content, 0, length); messageItems[i] = new ImageItem(null, img, 0, "Image"); } // image/jpg else if (mimeType.equals(MIMETYPE_IMAGE_JPEG)) { messageItems[i] = new StringItem(null, "image/jpeg is not supported"); } // image/gif else if (mimeType.equals(MIMETYPE_IMAGE_GIF)) { messageItems[i] = new StringItem(null, "image/gif is not supported"); } } catch (Exception e) { System.out.println( "processMultipartMessage, Exception: " + e); } } } return items; }
Note how some of the
MultipartMessage information that's stored as RFC822 headers is accessible through access methods, while other headers are available only by calling
getHeader() to retrieve them directly,. Other attributes are inaccessible for security reasons.
One of the headers, the start-content ID, refers to the message part that contains the presentation information for true multimedia messages, such as SMIL-based content. To retrieve the start message content ID, call the multipart message method
getStartContentId(), as here:
... // Get the start-content ID, which will be set for multimedia // content, and will contain the presentation information String startContentID = mpmsg.getStartContentId(); ...
The format of the
X-Mms-Delivery-Time header is milliseconds since midnight January 1, 1970 UTC, as a string value. The format of the contents of
X-Mms-Priority is a string with the value "
high", "
normal", or "
... // Get the Multipart message headers via the access methods: // X-Mms-From, X-Mms-To, X-Mms-CC, X-Mms-BCC, X-Mms-Subject String from = mpmsg.getAddress(); String tos[] = mpmsg.getAddresses("to"); String ccs[] = mpmsg.getAddresses("cc"); String bccs[] = mpmsg.getAddresses("bcc"); String froms[] = mpmsg.getAddresses("from"); String subject = mpmsg.getSubject(); // Get the rest of the headers by calling the getHeader() method String mmsPriorityHeader = mpmsg.getHeader("X-Mms-Priority"); String mmsDeliveryTimeHeader = mpmsg.getHeader("X-Mms-Delivery-Time"); // Get the message timestamp Date timestamp = mpmsg.getTimestamp(); ...
The method
getAddresses() takes for input the address type "
to", "
cc", "
bcc", or "
from", and returns a
String array, or
null if the specified address type is not found. There can be one or more TO, CC, and BCC addresses in any combination. The
getHeader() method takes the header name for input. It throws a
SecurityException if the requested header is restricted, or an
IllegalArgumentException if the header is unknown. For more information on MMS headers refer to Appendix D of the WMA 2.0 specification.
Incoming WMA messages are initially stored on the device's Subscriber Identity Module (SIM) card, and removed from the SIM as they're delivered to the application.
Message persistence at the application level is the developer's responsibility. To add message persistence to your application you must serialize and deserialize the message payloads, and use the Record Management System (RMS) API to manage a local store.
Some transports impose a limit on the size of a single message or on the number of segments that compose a message. Segmentation and reassembly (SAR) is a feature of some low-level transports that concerns breaking a large message into a number of smaller sequential, ordered segments, or transmission units. For example, a message sent on the SMS network is typically limited to 160 GSM 7-bit encoded characters or 140 binary 8-bit bytes; to send a longer message you must segment it. Reassembly is the opposite of segmentation: putting those smaller, related segments back together into a single message.
The WMA 2.0 specification mandates that WMA-based SMS implementations must support at least three SMS-protocol segments for a single message. Some implementations may support more, but applications will be more portable if they adhere to the three-segment limit, and refrain from sending messages that are larger than 456 GSM 7-bit encoded characters, 198 double-byte characters, or 399 binary bytes; see WMA 2.0 Appendix A.1.2 "Message Payload Concatenation" for more information. Sending a larger message may result in an
IOException. Note that for MMS messages, SAR is handled differently, and the size limitation is not as restrictive. Individual message parts can be kilobytes in size. A
SizeExceededException will result if an MMS message part is larger than the available memory, or than the supported size.
To help you deal with SMS message segmentation, WMA provides a method called
MessageConnection.numberOfSegments(), which provides segmentation information for a
Message before you send it with
MessageConnection.send(). The
numberOfSegments() method returns the number of segments it will take to send a message, or
0 if the message can't be sent. Let's look at a modified version of
sendTextMessage() that uses
... Message msg = ...; int segcount = mc.numberOfSegments(msg); if (segcount == 0) { // can't send, alert the user alertUser(SEGMENTATIONERROR); } ...
With the information you get from
numberOfSegments() you can also warn the user about higher costs of sending longer messages. For example, sending a short message might cost 5 cents, while sending a large message in three segments might cost 15 cents. Users who want to control costs will welcome the opportunity to cancel longer messages.
The WMA 2.0 defines two system properties to retrieve the address of the Short Message Service Center (SMSC) and the Multimedia Message Service Center (MMSC):
wireless.messaging.sms.smsc - the SMSC attribute name
wireless.messaging.mms.mmsc - the MMSC attribute name
Use the method
System.getProperty(String attributeName) to retrieve these values, thus:
... String smsc = System.getProperty("wireless.messaging.sms.smsc"); String mmsc = System.getProperty("wireless.messaging.mms.mmsc"); ...
The SMSC address is an MSISDN number such as
+18472549270. The MMSC address is an MSISDN number value like
+18472549270 or a URL like
MIDP 2.0's push registry enables MIDlets to set themselves up to be launched automatically, without user initiation. The push registry manages network- and timer-initiated MIDlet activation; that is, it enables an inbound network connection or a timer-based alarm to wake a MIDlet up.
MIDlets can be activated by incoming WMA connections, if the underlying implementation provides the necessary support. Before a MIDlet can be activated, it must register with the push registry using either static or dynamic registration. Static registration is done by placing
MIDlet-Push-n entries in the JAD or MANIFEST file; dynamic registration is done at runtime, using the
PushRegistry object's
registerConnection() API.
Here's an example of using static registration:
... MIDlet-Push-1: sms://:50000, MyWmaMIDlet, +123456789 MIDlet-Push-2: cbs://:50001, MyWmaMIDlet, * MIDlet-Push-3: mms://:com.j2medeveloper.MyMmsApp, MyWmaMIDlet, * ...
The first attribute value is the local (server) connection URL; that is, the server protocol and port number or application ID. The second value is the name of the MIDlet class responsible for handling incoming messages for the specified connection URL, and the third is a filter used to restrict the senders that can activate the MIDlet. The next code snippet shows how to use dynamic registration:
... // Identify the MIDlet class String midletClassName = this.getClass().getName(); // Register a static connection String url = "sms://:50000"; // Use a filter for SMS String filter = "+123456789"; // only allow messages from +123456789 ... try { PushRegistry.registerConnection(url, midletClassName, filter); } catch (IOException ioe) { // Handle the exception } catch (ClassNotFoundException ioe) { // Handle the exception } ...
Because the will maintain registrations across MIDlet invocations, it is important to unregister the push connection when it's no longer needed by calling the method
... String url = "sms://:50000"; ... try { // unregisterConnection returns true if successful, false if not status = PushRegistry.unregisterConnection(url); } catch(SecurityException e) { // Handle the exception } ...
You can discover whether your MIDlet was activated by the by calling the method
listConnections(). Let's define the helper method
processPushConnections() to discover and process any pushed connections. You typically invoke this method during application startup.
/** * Discover whether there are pending push inbound connections * and, if so, process */ public void processPushConnectionsThreaded() { Thread th = new Thread() { public void run() { String[] connections = PushRegistry.listConnections(true); if (connections != null && connections.length > 0) { for (int i=0; i<connections.length; i++) { String connUrl = connections[i]; if ((connUrl.startsWith("sms")) || (connUrl.startsWith("cbs")) || (connUrl.startsWith("mms"))) { try { MessageConnection messageConnection; messageConnection = (MessageConnection) Connector.open(connUrl); readMessage(messageConnection); } catch (IOException ioe) { // Ignore } } } } } }; th.start(); }
Note that the
processPushConnectionsThreaded() method runs on its own thread of execution, for two reasons: to avoid contentions with the system threads, and to serialize message processing so messages are processed in the same order they were received. " The MIDP 2.0 Push Registry" has more information on how to use the push registry's API.
WMA does not define a security mechanism, but instead uses the underlying platform's security framework. On some platforms, including MIDP 2.0, networking operations are considered privileged operations < meaning that to open a connection or to send and receive messages, permissions must be requested by the application and granted by the platform; specifics are implementation-dependent. In MIDP 2.0, permissions are requested by way of the JAD or the manifest, and granted (or not) by the user when the operation (in our case open, send, or receive) is invoked. Note that for signed MIDlets, permissions must be defined in the manifest.
Here's an example of requesting WMA permissions via the JAD or manifest:
... MIDlet-Permissions: javax.microedition.io.Connector.sms, javax.wireless.messaging.sms.receive, javax.wireless.messaging.sms.send, javax.microedition.io.Connector.cbs, javax.wireless.messaging.cbs.receive, javax.microedition.io.Connector.mms, javax.wireless.messaging.mms.receive, javax.wireless.messaging.mms.send, javax.microedition.io.PushRegistry ...
The WMA defines the
SecurityException class to notify the application of permission exceptions it encounters when invoking platform services. This exception can be thrown as follows:
javax.microedition.io.Connector: if the application is not granted permission to create a connection for a given messaging protocol, as defined by the platform security services
MessageConnection.send(): if the application has no permission to send messages on the specified port
MessageConnection.receive(): if the application has no permission to receive messages on the specified port
For more information about MIDP 2.0 permissions, see the MIDP 2.0 specification and the WMA Recommended Practices, which you can find on the WMA technology page.
You can find a reference implementation of the Wireless Messaging API 2.0 that you can use to test your programs in the J2ME Wireless Toolkit technology page.
This article has covered how to send "mobile-originated" messages from the handset, and how to receive "mobile-terminated" WMA messages sent from a handset or a server. To send messages to a handset from a server you need access to the network provider's SMSC and MMSC servers. Access to these servers is considered privileged and typically you need to go through third-party messaging vendors. These vendors already have relationships with the major carriers such as AT&T (Cingular Blue), Boost Mobile, Cingular (Orange), Nextel, T-Mobile, Sprint, and Verizon, as well as with second-tier carriers such as Alltel, Western Wireless, Leap, Cincinnati Bell, and Dobson. These vendors provide access to the carrier's SMSC and MMSC through exposed APIs that use HTTP and other protocols, allowing your server application to send messages to given handsets, receive messages from handsets, and use premium services such as short-codes.
Also remember that, if you need to send a message to a particular application on a handset, you must set the appropriate port or application ID for the message; if you don't, the message will be delivered to the handset's default viewer. How you set port number or application ID on an outgoing message will depend on the messaging service you use; the vendor may provide APIs or you may have to build the raw message in binary form. For GSM SMS, the port number resides in the
TP-User-Data/User-Data-Header field, while for MMS the application ID resides in the MMS
Content-type header.
The Wireless Messaging API provides a very flexible messaging API that is protocol- and device-independent. The reference implementation allows you to start writing and testing WMA-based applications today. WMA's flexible design ensures that it can easily be extended in the future, and it already supports the most common message types: text, binary, and multimedia. The WMA allows developers to create neat applications that incorporate messaging, such as SMS, email, and rich multimedia, as well as push behavior and consumption of short messages.
I would like to thank Gary Adams of Sun Microsystems, for his feedback to this article.
C. Enrique Ortiz is a software architect and developer, and a wireless mobility technologist and writer. He is author or co-author of many publications, and has been an active participant in the wireless Java community and in various J2ME expert groups. Enrique holds a B.S. in Computer Science from the University of Puerto Rico and has more than 15 years of software engineering, product development, and management experience.
Java SDKs and Tools
Java Resources


text: Roy Pérez is an Assistant Professor of English, American Ethnic Studies and Women's & Gender Studies at Willamette University in Salem, Oregon. He received his PhD in English at New York University with concentrations in Latina/o literary and performance studies. He is a past fellow of the School of Criticism and Theory at Cornell University and the Andrew W. Mellon Foundation and currently serves on the Outreach Committee for the Critical Ethnic Studies Association. He has published poems and essays in Glitter Tongue, the Best of Panic! poetry anthology, TheThePoetry, bully bloggers, and FENCE Magazine, and recently adapted one of his poems to film with director Finn Paul. His current scholarly book project, Proximity: Queer Configurations of Race and Sex, examines the function of interracial closeness in the articulation of sexual identity by queer artists from the late-nineteenth century into the twenty-first.


text:
Apple v. Samsung and the Smartphone Wars
The legal conflict between Apple and Samsung is one of the most extensive patent conflicts in history. It spans many countries and has potentially huge economic impact.
In the United States alone, multiple products, multiple patents, multiple suits in Federal District Court, multiple interim decisions from the CAFC, multiple USPTO actions, an action in the ITC and possible involvement of the Justice Department make this a complex conflict that has not yet been resolved and that will continue for some time to come.
Join Professor Jeffrey J. Hawley, Distinguished Fellow in Intellectual Property at UNH Law, for a discussion of this important milestone in patent law.
The talk will be co-hosted by UNH Law's Student Intellectual Property Law Association (SIPLA) and Patent Law Forum (PLF).
Questions: firstname.lastname@example.com


text:
BPL Community Profile
Jay Ham (jham) - BPL Professional Member
You cannot send this user a personal message (PM) because they have not specified a PM email address yet.
All Forum Posts by Jay Ham
Re: Success!
Laurence and Marius, What fun. I'm glad to hear the project worked out for you. I use my cut down thermarest as my primary pad, and it's still going strong. Take care, Jay MYOG
Re: ti rods bending in heat
We are aware of this happening with some stoves. Mine works great with my alcohol stove; but some alcohol stoves burn too hot, or the combination of stove, windscreen, and pot creates an environmen...
Re: Tale of Two Alphamid's ~ MYOG ~ Prototype Finished
Bill, Nice work on the prototype. My only concern is condensation coming in contact with the foot and hood of your sleeping bag. Sure you fit in it on your side, but if you move around at night,...
Re: 5 minute, 1.6 oz pillow
Sounds like a good idea to me, too. I'm not sure how I would like sleeping with my head atop a plastic bag though. A few years ago I sewed several 1.1 ounce, non-silicone impregnated nylon bags abo...
Re: Waterproof zipper on bivy
What is called waterproof zippers and those that are called water resistent are the same thing in my book. The "waterproof" zippers I have used leak over time, making them only water resistent at b...
Re: Tale of Two Alphamid's ~ MYOG ~ U-L & SUL
Bill, I really like how you introduce your projects. And this project sounds like fun to me. First a question, then a comment or two. As far as I know, BMW doesn't make an alphamid. Did you mean...
Re: Re: Re: Hasty Hooch modification? by Minibull designs
If you're talking about the stuff I think you're talking about it's sometimes called "stitch witchery" (might have other names as well). Though I've never tried it on silnylon, it doesn't have much...
Re: Make your own UL notebook
Dale, That's a really cool idea. It could even go a step further using Rite in the Rain's water resistant notebook paper. Even barring that, it's still cool. Thanks for posting this. Jay MYOG
CAD Software
These responses were copied from another thread, where this topic started. Jay, Regarding your search for an affordable CAD program. Consider using the draw features in Microsoft Excel. I ...
CAD Software
Here are the tasks I would like to perform with CAD software: -printable, full-sized patterns -catenary curves -2D drawing patterns and material lists (example: drawing a dome tent in 2D and h...
All Reader Reviews by Jay Ham
Jay Ham has posted no reviews.


text:
Big Boots, Thinner Waist
View Single Post
Join Date: Aug 2010
Location: Huntingtown, MD
Posts: 36
Hey man.
I'm far from an expert on all of this stuff, but I just posted a thread with a question similar to yours.
You said you wear size thirteen shoes, but do you know what size boots you wear? I wear a size 11.5 shoe and I thought I was going to fit into an 11 boot, but after trying boots on in the store I found that I could fit into many 10.5 boots. Your boot size may be smaller than your shoe size also.
With this in mind, I still doubt that you'll wear anything less than a 11.5 boot (although I can't be certain) and I was being told by many people that 10.5 was the border for a using normal board or a midwide/wide board and 11 was pushing it. What I'm trying to say is that from the answers/advice I've been giving and the research I've done you'll probably have some overhang, maybe even a decent amount of it.
As far as footprint-reducing boots go, I know that Burton and Salomon make boots like this (I'm sure more people will elaborate on that in the following replies) and I think Thirty-two does too (correct me if I'm wrong).
Risers will help to if you really need them, and I've been told that you can shave down the fronts of your boots but this may void the manufacturer warranty (and you could possibly ruin them).
I hope this helped a little.
View Public Profile
Send a private message to chinds4
Find More Posts by chinds4


text:
Welcome back to Stockhouse Member Sign In
Sign in with one of the following accounts.
Send my password
« back
Become a member today, It's free!
We will not release or resell your information to third parties without your permission.
Use one of the following accounts.
Go Back...
hey batman better put the bat mobile in 1st gear as the slope of this stock going down hill show alot of speed being gathered as it tries to level at the bottom


text:
Web Design Facebook Web Hosting and SEO
Digital Extreme Media Group is one of the oldest full-service web design company and is committed to the success of all its clients. We've built hundreds of websites for clients both large and small. Our internet marketing solutions are designed to provide business and brand growth. All inclusive web design packages and no hassle web hosting keeps our clients with us for many years. We can help you in branding your company & products with over 20 years of experience.
Call 717-532-6494 for web design, Facebook, SEO, internet marketing and hosting.
This website is optimized for mobile users
- Full Service Web Design
- Internet Marketing
- Google Adwords
- Web Hosting
Internet Marketing Services for Chambersburg, Carlisle, Harrisburg, Lancaster, Shippensburg and York Pennsylvania. We offer more than the other web design & SEO companies.Did the last SEO company you dealt with build toxic backlink and spam out your content? 20 years experience in the SEO sets us apart.


text:
by Worldchanging New York local blogger Amy Shaw:
This summer the Cooper Hewitt National Design Museum is featuring an ambitious and refreshingly different kind of design exhibition: Design for the Other 90%. The show features ingenious yet low-cost functional objects that, according to the museum, highlight "the growing trend among designers to develop solutions that address basic needs for the vast majority of the world's population not traditionally serviced by professional designers."
Well arranged in the museum's magnificent garden, Design for the Other 90% treats the viewer to one good idea after another, in the form of solar-powered portable LED lights, devices that store rainwater for irrigation, and insecticide-treated bed nets to prevent malaria (shown at the bottom). Many of these products are already in use in dozens of countries around the world, including the United States.
I found a few products especially useful, economical, and well built. The LifeStraw, shown here, is a portable water-purification tool that one drinks through to turn any still water into drinkable water. The Q Drum, designed to make it easier for people in drought-prone areas to carry water over distances, is a wide donut-shaped container with a rope strung through so that the water may be rolled rather than lugged. The Global Villages Shelters, three of which anchored the exhibition design, are 8-foot square temporary structures that ship flat, assemble easily, and protect people left homeless by earthquakes, storms, or other natural disasters. The Pot-in-Pot Cooler uses water evaporation to keep food cool in hot climates and can be easily produced by local potters.
Admirably, the Cooper Hewitt is presenting this smart exhibition at the same time as its national design triennial Design Life Now, the event that presents slick, concept rich, and stimulating objects that represent "the most innovative American designs" of the past few years. These, I suppose, are designs for "us," the 10% that is traditionally serviced by professional designers. It's also a fine show, but by contrast, the objects seem a measure less meaningful and inspiring after taking in the show outdoors.
The catalog for Design for the Other 90% is also impressive, filled with complete information about each product, photos of products in use, and essays. Proving that design needn't be glitz-for-the-glitzy to be clever and inspiring, it should be required reading for all design students and practitioners alike. There is also an accompanying website.
After the exhibition, I took my June issue of Harper's magazine into Central Park for a rare moment of leisure. Coincidentally, the essay I turned to, "Pure Product," threw the whole exhibition into question. Written by Binyavanga Wainaina, who grew up in Kenya and now teaches writing in Schenectady, NY, the essay considers with raw honesty how objects designed for the poor are really regarded by those they're intended to help. The bottom line: such design objects communicate one thing only: "You are f***ed."
Wainaina actually references one of the objects that happens to be in Design for the Other 90%: the so-called $100 laptop (shown here). "I'm sure," he writes, "the One Laptop per Child initiative will bring glory to its architects…. [The designer Nicholas] Negroponte will win a prize or ten." And then using development lingo to slap itself in the face: "There will be key successes in Rwanda; in a small village in Cambodia, and a small, groundbreaking initiative in Palestine, where Israeli children and Palestinian children will come together and play Minesweeper." Ouch.
He posits that what motivates rich countries to design such "pure products" for the poor is a "feeling that the giant world of the urban poor is too pathetic to tolerate" and so "pins its hopes and dreams on some revolutionary product… a pure product [that] presents itself as a complete solution." The problem is that "a product built to serve the needs of the needy assumes the needy have measured themselves exactly as the product has measured them."
Some of the products in Design for the Other 90% might be regarded in this way. Yet many of the designers selected for the show worked directly with intended users to develop their products, listening to the users define their needs and then coming up with inclusive, solution-driven products.
In any case, the Cooper Hewitt is taking a noble direction by presenting this exhibition, down to the way it attempts to define poverty not in financial terms, but rather in terms of "how the potential users define what they need and want in order to feel empowered, self-reliant, and secure," as former curatorial director Barbara Bloemink writes in the catalog foreword.
Perhaps some of these products will prove to be world changing, communicating something much more positive to their intended users than what Wainaina suggests. It might not be necessarily "You are saved," but perhaps "You are not alone."
On view through September 23, 2007.


text:
Nov 21 2012
A Closer Look at Judicial Election Campaigns
Judges are increasingly forced to raise huge amounts of money for state judicial elections. A recent New York Times editorial focuses on these judicial campaigns across the country.
According to the the Brennan Center for Justice and Justice at Stake, more than
$28 million was spent on television advertisements in state supreme court races around the country. More than half of these television ads were paid for by groups not connected to the candidates' campaigns.
Three Florida State Supreme Court justices raised more than $1.5 million for their retention campaigns. They needed to raise so much money because they were targeted for their alleged liberal views. Although the justices felt they needed to fight back, the public may question whether the judges are still
impartial because of new donor debts.
Michigan set Pokies records gabrielle anwar pokies for the amount of money spent. "Of the $15 million or so spent for TV ads in Michigan, 75 percent cannot be attributed to identifiable donors, notes Rich Robinson, executive director of the Michigan Campaign Finance Network." The problem with unidentifiable donors is that litigants will not know when to request that the judge recuse himself/herself. The knowledge that a party in litigation donated money to the judge's campaign leads to an appearance of impropriety.
This election experience, with an increasing amount of money spent on judicial campaigns "should at least hasten state efforts to revise rules for judicial recusal to take campaign contributions into account."
Pennsylvania's 2013 elections are looming. With expensive campaigns and a state Supreme Court Justice awaiting trial for campaign finance misconduct, what else will it take to reform our system?


text:
I know nothing about Quarter Horse bloodlines. I'm not planning on breeding my filly, but out of curiosity, I would like to know what , if anything, her background indicates. (reining, cutting, halter, etc.) Also, if anyone knows anything about her sire and/or dam or other relatives, good or bad. I have tried to find pictures of both sire and dam, but have been unsuccesful. THANKS for ANY INFO!!!
Tommys Paprika Gal Quarter Horse


text:
Patriots cornerback Logan Ryan apologized Thursday for his actions in last Sunday's 30-27 overtime loss to the Jets when he grabbed his groin as he crossed the goal line on a 79-yard interception return for a touchdown in the first quarter.
The action drew him a $10,000 fine from the NFL.
"First off, I just want to apologize all the fans and all the viewers who had to witness that. I own up to it 100 percent," said Ryan. "It's not acceptable. It's not acceptable for me and this team and I want to put it behind me and I want to move on and focus on Miami and just let people know it won't happen again. That's not who I am."


text:
Given last week's downgrading of various European sovereign debt ratings by Standard and Poor's, it might seem unthinkable that Greece might see its ratings upgraded next week.
But, a preliminary agreement outlining coupons, haircuts and discount rates in a proposal to be put to private sector investors in Greek debt is likely on Friday says Dow Jones's Costas Paris.
Greece will then send a letter to every creditor that holds bonds and ask them to participate.
There will however be investors who want all their money back and want to trigger credit default swaps. Either way, this might be considered a technical default.
However, if Greek sovereign debt is put into this status, there is a likelihood that the agencies will upgrade Greece's ratings shortly afterwards.
Watch the video to find out why.
Why was France downgraded by Standard & Poor's last week, while the U.K. got to keep its triple-A rating?
After all, the U.K. has had a worse recession, has a bigger deficit, has had higher inflation and has almost as big a total government debt load relative to GDP, while having a more heavily indebted private sector.
The difference, Keynesians say, is that the U.K. has its own currency and its own central bank while France doesn't. Whereas the Bank of England could meet any of the U.K. government's obligations, which means the government need never default, the Bank of France can't. With the European Central Bank in control of the currency, the French have, in effect, debt denominated in a foreign currency.
When Argentina went bust a decade ago, it wasn't the country's domestically-denominated borrowing that pushed it over the edge, but rather its dollar bonds.
All this makes sense… until you look at the U.S. or Japan.
The Journal's Euro Crisis blog provides real-time updates and new takes on important developments as governments and financial institutions deal with Europe's continuing debt crisis.


text:
Phoenix, AZUSA
Hometown: St. Louis, Missouri
October 31, 2012
I lived in north Scottsdale when I first arrived and now have friends in the community.
I have hiked a number of areas here and in Colorado over the years, and Although I don't consider myself "highly experienced" I am experienced enough.
Not sure how to answer that, but I always manage to keep up.
I don't have a favorite, although Sedona sure is one of the best for all around beauty.
Hi! I am originally from St. Louis and moved to Arizona in 2011. I enjoy all types of outdoor activities and hiking is one of them. I look forward to making friends and sharing new experiences together.
Meetup members, Log in
By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy


text:
Protectionism motivated by self-interest can backfireComment on this story
Trade deals are based on the concept of give and take – a reality that protectionists try to ignore. No countries play fair when it comes to trade, pleading the need to protect the interests of their own industries.
The interests of their own consumers are usually not on the agenda, perhaps because consumers are less organised and therefore less powerful than big business lobbies. However, earlier this month, South Africa's trade officials, lobbying for the extension of a favourable trade arrangement with the US, accepted there could be no take without some give.
After the US-Africa Leaders Summit in Washington, they agreed to review tariffs on US chicken imports – as part of a campaign to get that country to extend the African Growth and Opportunity Act (Agoa) when it expires next year.
Nearly a year ago Trade and Industry Minister Rob Davies hiked import tariffs on five categories of imported chicken, to protect local producers. The move damaged businesses relying on poultry imports – businesses that are major employers – and increased the cost of a high-protein food for consumers.
Moreover, the raised tariffs put US products at a disadvantage in the local market, just two years before Agoa was due to expire. The raising of the barriers to imports prompted protests from US food producers, who said they would oppose the extension of Agoa if protectionism increased in African countries.
Tom Donohue, the president and chief executive of the US Chamber of Commerce, argued recently that, among other things, South Africa would have to repeal anti-dumping measures if it wanted to persuade US businesses to support the attempts to extend Agoa benefits to South Africa beyond 2015.
Last week another trade issue was on the agenda: protectionism in other African countries is creating problems for locally based automotive manufacturers.
The National Association of Automobile Manufacturers of SA (Naamsa) reported a 20 percent fall in exports to Africa between the first half of last year and the first half of this year. Engineering News attributed the fall partly to "sudden and sharp increases in import duties, levied by countries such as Nigeria and Algeria, working to protect and develop their own vehicle assembly industries".
Naamsa director Nico Vermeulen confirmed that exports to Nigeria had been hit by the introduction of duties on new car imports. And he said Zimbabwe had plans to impose higher tariffs on vehicle imports.
Every country has its own developmental plans – a policy that boils down to tit-for-tat. In a 2011 paper, economist Andreas Freytach argued that "empirical evidence demonstrates that protectionism, being selective and economically distortive, is to the disadvantage of the very country behaving in a protectionist fashion. Although the protected industries can gain from trade protection measures, other industries may suffer severely".
Freytach noted that trade protection was "a politically attractive policy tool" because "most voters appreciate the immediate gains for the protected industries and underestimate the costs for the economy in the long run".
He said South Africa's industrial and trade policy initiatives relied on "old interventionist tools" and only addressed the major problems in the economy.
The major problems he identified were "poor regulation of network industries [such as energy and telecommunications] and administrative burdens".
Consulting economist Cees Bruggemans also identified underlying problems, particularly relating to the government's aim to increase the proportion of beneficiated goods in total exports.
Bruggemans said that the shortage of "cost-effective electricity in our heavy manufacturing industry [alone] should place question marks behind any new energy-intensive beneficiation projects, especially of metals".
Another challenge for entrepreneurs, he said, was that factories and machinery were being "burned down, plundered or otherwise vandalised in union-related labour unrest".
From a political point of view, it is far easier and more politically acceptable to talk about the merits of a "developmental state" than to tackle controversial problems like the failure to generate adequate electricity and dysfunctional labour relations. But protectionist chicken tariffs always come home to roost.
Comment Guidelines
- Please read our comment guidelines.
- Login and register, if you haven' t already.
- Write your comment in the block below and click (Post As)
- Has a comment offended you? Hover your mouse over the comment and wait until a small triangle appears on the right-hand side. Click triangle () and select "Flag as inappropriate". Our moderators will take action if need be.
- Verified email addresses: All users on Independent Media news sites are now required to have a verified email address before being allowed to comment on articles. You are only required to verify your email address once to have full access to commenting on articles. For more information please read our comment guidelines


text:
- Otolaryngology (Ear Nose and Throat)
- Head and Neck Cancer
- Surgery
Clinical Interests
Head and neck tumors; Salivary gland tumors; Thyroid tumors
Medical School
Stanford University School of Medicine (M.D.); Yale University School of Epidemiology and Public Health (M.P.H.)
The Johns Hopkins Hospital (Otolaryngology--Head and Neck Surgery)
The Johns Hopkins Hospital (Otolaryngology, Head and Neck Surgery)
- Minnesota Monthly's Best Doctors for Women (2013-2014)
- Best Doctors in America® (2011-2012, 2013)
- Member, Collegium Oto-Rhino-Laryngologicum Amicitiae Sacrum
- Honor Award, American Academy of Otolaryngology/Head and Neck Surgery
- Mpls.St. Paul Magazine "Top Doctor" (2012-2015)
- Minnesota Monthly "Best Doctor" (2014)