Thursday, July 23, 2009

Creating Custom Table Items Under Palm OS

Tables (or grids) are very useful controls when you need to display and edit multiple data columns. Especially if column's types are different like checkboxes, text fields or popup triggers. In addition to standard cell types (described in Table.h) Table API provides an opportunity to create custom cells. This article highlights some aspects of custom table development.
Getting started

Let's cover shortly the basics of tables. Usual working flow is as follows:
  • type of column in table's row
  • a value to integer or pointer data of the cell if needed
  • desired columns usable
  • set custom procedures for loading, saving and drawing if needed
  • set ID and Data values for row (each one is of two bytes length) if needed
Note that by default columns are unusable, so you should explicitly set them into visible state. The following illustrates all of these concepts:

FormPtr frmP = FrmGetActiveForm();
TablePtr tableP = FrmGetObjectPtr( frmP,
FrmGetObjectIndex(frmP,TestTableTable));
UInt nNumRows = TblGetNumberOfRows(tableP);
UInt i = 0;

for (i = 0; i < i =" 0;" nvalue =" TblGetItemInt(tableP,row,column);" nvalue ="="" bitmaph =" DmGetResource('Tbmp'," bitmaph =" DmGetResource('Tbmp'," bitmapp =" (BitmapPtr)">topLeft.x, bounds->topLeft.y);
MemHandleUnlock (bitmapH);
}

All this function does is load the appropriate bitmap resource according to stored value and then draw it inside the cell bounds. You may freely apply your imagination here and implement almost any behavior. Just avoid time consuming operations when the cell is being drawn, otherwise users will not understand you!

Responding to events

The Table API provides more opportunities to display data than to edit data. One more point where you may customize your control is in handling some events. Applying to tables, it will be tblEnterEvent and tblSelectEvent. You may process them in HandleEvent function. As an example we'll implement in-place edit. The main idea is simple. We need to create field in cell's bounds and then redirect events to this control. For example, in case of in-place edit you may write something like following code sample. This is just a very simple and schematical implementation of what was presented above:

*********************************************************************
Global variables
*********************************************************************/
FieldPtr g_InPlaceField;
UInt16 g_wCurrRow, g_wCurrCol;
MemHandle g_hText;
Boolean g_bSelected;
static void SaveValue(TablePtr table);
static void HandleTapInCell(EventType* eventP,
TablePtr tableP,
UInt16 wCol,
UInt16 wRow,
Boolean& bHandled);
..................................
static void MainFormInit(FormType *frmP)
{
.......................
g_wCurrRow = g_wCurrCol = -1;
g_bSelected = false;
g_InPlaceField =
(FieldPtr)FrmGetObjectPtr(frmP,FrmGetObjectIndex(frmP,MainInPlaceEdit));
.......................
}

static Boolean MainFormHandleEvent(EventType * eventP)
{
Boolean handled = false;
FormType * frmP;

switch (eventP->eType)
{
// other events
......................
case tblEnterEvent:
{
frmP = FrmGetActiveForm();
TablePtr tableP = eventP->data.tblEnter.pTable;
UInt16 wRow = eventP->data.tblEnter.row;
UInt16 wCol = eventP->data.tblEnter.column;
HandleTapInCell(eventP, tableP, wCol, wRow, handled);
g_wCurrRow = wRow;
g_wCurrCol = wCol;
}
break;
}
return handled;
}

/*********************************************************************
* Internal Functions
*********************************************************************/
static void SaveValue(TablePtr table)
{
Boolean dirty;

if (!g_InPlaceField)
return;

dirty = FldDirty(g_InPlaceField);

if (dirty)
{
CharPtr textP = FldGetTextPtr(g_InPlaceField);
Int nInt;

if (textP)
nInt = StrAToI(textP);
else
nInt = 0;
TblSetItemInt(table,g_wCurrRow,0,nInt);
}

FldReleaseFocus(g_InPlaceField);
FldSetSelection(g_InPlaceField, 0, 0);
}

static void HandleTapInCell( EventType* eventP,
TablePtr tableP,
UInt16 wCol,
UInt16 wRow,
Boolean& bHandled)
{
FormPtr frmP = FrmGetActiveForm();

// if user tapped on new row then deselect current one
if ( g_bSelected &&
(wCol != g_wCurrCol || wRow != g_wCurrRow) )
{
SaveValue(tableP);
FrmHideObject(frmP,FrmGetObjectIndex(frmP,MainInPlaceEdit));
TblMarkRowInvalid(tableP,g_wCurrRow);
g_bSelected = false;
}
TblRedrawTable(tableP);

if ( wCol > 0 )
{
g_bSelected = false;
bHandled = false;
return;
}

// show field at new position if needed
RectangleType r;
TblGetItemBounds(tableP,wRow,wCol,&r);

if ( (wCol == 0 && wCol != g_wCurrCol) || (wRow != g_wCurrRow) )
{
TblGetItemBounds(tableP,wRow,wCol,&r);
Int16 nInt = TblGetItemInt(tableP,wRow,wCol);

FrmSetObjectBounds(frmP,FrmGetObjectIndex(frmP,MainInPlaceEdit),&r);
FrmShowObject(frmP,FrmGetObjectIndex(frmP,MainInPlaceEdit));

char szBuffer[10];
StrPrintF(szBuffer,"%d",nInt);

char* pText = (char*)MemHandleLock(g_hText);
StrCopy(pText,szBuffer);
MemHandleUnlock(g_hText);
FldSetTextHandle(g_InPlaceField,g_hText);
FrmSetFocus(frmP,FrmGetObjectIndex(frmP,MainTestTable));
{
// Convert tblEnter event to fldEnter event
EventType newEvent;
EvtCopyEvent(eventP,&newEvent);
newEvent.eType = fldEnterEvent;
newEvent.data.fldEnter.fieldID = 1971;
newEvent.data.fldEnter.pField = g_InPlaceField;

FldHandleEvent(g_InPlaceField, &newEvent);
}
FldDrawField(g_InPlaceField);
g_bSelected = true;
bHandled = true;
}
FrmDrawForm(frmP);
}

Such solution is really simple yet effective enough. You create field control once; then you just need to move it to correct position of edited cell or hide field control if no cells are required to be edited. An important point in this sample is that you should convert and redirect tblEnter event to FldHandleEvent function in order to support natural field functionality. Once you are done with it, saving/assigning values of cells are just trivial things! The only additional step ought to be noted here is that usually you need to save data in frmCloseEvent handler.
Where to go

As we have seen, Table API manager gives us several opportunities to customize our tables. For most of relatively simple cases it's more than enough. But if you're requested to implement more complex behavior, next possible area of thinking is Gadget control. We will discuss it in next article.


Article Source:
Developer.Com

To inquire more about Palm applications, mobile application development services please visit www.palmphone.com or Call 888-284-0858

Tuesday, July 21, 2009

New WebOS Is Palm’s Secret Sauce

With its new Palm Pre phone announced earlier today, troubled phone maker Palm has clearly put itself back into the game.

The spotlight is clearly on the slick hardware but Palm is betting its secret sauce, its newly created operating system, WebOS, will give the Pre an edge over competitors.

"We created a new platform from the ground up," said Ed Colligan, CEO of Palm at CES 2009. "It is going to redefine the center of your access point to the Internet."

A key feature of WebOS is the Palm Synergy, which brings different information from calendars, contacts and instant messaging applications into a single screen.

WebOS links contacts together so if the same contact is listed in Outlook, Google and Facebook accounts, it recognizes that they are the same person and links them together into one listing.

Pre_contact_list
There’s also combined messaging, which allows you to see who’s active in a buddy list and start a conversation with just one touch, instead of having to fire up the IM application seperately.

The OS treats every application as a "card", a new term that Palm has introduced with the Pre. Cards or individual applications are stacked up like a deck on the main screen and can be scrolled through.

WebOS also comes with global search– any search string typed on the phone searches through contacts, applications and other information repositories on the device. The OS also offers to search the Internet, all in a seamless way.

While Palm has said the WebOS is developer friendly, it hasn’t commented about how applications written for WebOS will be compatible with Palm OS 5.


Article Source:
Wired.Com

To inquire more about Palm applications, mobile application development services please visit www.palmphone.com or Call 888-284-0858

Monday, July 20, 2009

Up Close and Personal With the Palm Pre

Palm just gave us a demo of the Pre. You know the gadget unveiled at CES everyone is talking nonstop about. And although they didn’t let us handle the device (no touching!), we did get a very detailed preview from the Palm’s Director of Product Marketing, Paul Cousineau.

Our first impressions? The hardware itself is…succulent. When the slider is closed, it’s a little smaller than an iPhone, when opened it’s a little larger than a BlackBerry Bold. The touchscreen itself is prettier than an Icelandic supermodel with colors that pop like an M-80. The screen is also multi-touch, allowing you to pinch and expand photos and web pages…kind of like another touch screen device we know of. During the demo we didn’t see any sort of lag or jagged scrolling — the phone’s operating system looked like it was fully baked and functioning flawlessly.


The accelerometer had no problem orienting itself. Flipping the phone on its side and the web browser followed suit. One cool, novice feature: when the phone is titled on it’s Y axis 45 degrees or so (like you’re showing the person in front of you a picture) the screen orients itself 180 degrees allowing whoever is on the other end to view the screen right side up. It’s a clever touch that allows you to share images and web pages with friends a little more easily than other devices.

The browser is constructed on top of Webkit — the same platform as
Android and the iPhone — and it works. The slide out QWERTY keyboard handles text input (there’s no virtual keyboard) with web pages that took only a few seconds to load. When text or pictures were too small to read, the multi-touch pinching expanded things out perfectly. Palm claims they selected Sprint as the Pre’s lone carrier primarily because of the very large, ultra-fast data networks. While I’m sure this will benefit the Palm on the data side, Sprint’s voice network skews toward the subpar end of the spectrum.

Okay remember when we said that we didn’t touch the phone before? That was a little bit of a fib. When no one was looking we did scroll through the contacts screen. It was creamy smooth but took a very delicate touch. When I first mashed my index against the screen the contact list flipped out a little and wouldn’t scroll. When I lightened up and just barely brushed the screen, it responded with fluid scrolling. I also managed to pinch a web page, opening up some difficult to read text and a small picture.
The pinching action felt exactly like the iPhone; natural and effortless.

The brief time I played with the Pre felt promising. Palm has been vague on when we’ll see actual review units, but it should be sometime in the next month or so. Hopefully, the finalized version of the Pre lives up to the promise we’ve seen in this demo.


Article Source:
Wired.Com

To inquire more about Palm applications, mobile application development services please visit www.palmphone.com or Call 888-284-0858

Sunday, July 19, 2009

Palm WebOS Mojo SDK now available to all

Palm’s Mojo Software Development Kit is available to all interested app developers. The SDK can be downloaded from a new developer portal -- Palm webOSdev -- at developer.palm.com. Any interested developer with a valid email address can access the SDK, its associated documentation, and new Mojo developer forums.
The initial response to Palm webOS apps -- from both developers and customers -- has been enthusiastic. Even in its initial beta stage, over 1.8 million apps have been downloaded from the beta App Catalog since Palm Pre was released less than six weeks ago. Thousands of developers have participated in the Mojo SDK early access program since it began in early April. New applications are in the pipeline for the Palm Pre Apps Catalog, and the App Catalog submission process will be opened to all developers beginning this fall.


Developers interested in exploring Palm webOS and the Mojo SDK further may be interested in these upcoming events:

- Michael Abbott, Palm’s Senior Vice President for Application Software & Services, is speaking on the emerging opportunities for mobile applications at the MobileBeat 2009 conference in San Francisco.

- webOShelp is organizing a developer meetup (at Palm’s Sunnyvale headquarters) on July 28.

- preDevCamp an informal network of Mojo developers, will host events in 73 cities around the world on August 8.

Article Source:
Blog.Palm.Com

To inquire more about Palm applications, mobile application development services please visit www.palmphone.com or Call 888-284-0858

Thursday, July 16, 2009

A Few Quick Shortcuts For The Palm Pre

After a couple of years of slow bleed, Palm seems to be hitting on all cylinders right now. Their stock price is up. They are in the news every day. They've got a couple of products in play and a brand new platform about to roll out that their base has been clamoring to get for years. Our question is... are they overplaying their hand? Apple created more hype before the iPhone launch than probably any PDAPhone in history, and they've largely delivered on the hype and reaped the rewards. Palm will have to execute perfectly over the next couple of quarters or they could be done. This is not a time to stumble.

What brought this thought to mind is today's announcement from Palm and Sprint of the Palm Pre pricing model. It appears that you will not be able to get a Palm Pre unless you are prepared to sign up for a very pricey plan. The default seems to be the $99 unlimited everything plan... a good deal if you need "everything", but most users are not wanting to pay that much and don't really "need" everything. At their media event today, Palm and Sprint indicated that all of the alternate plans will include an everything data package for unlimited data and messaging. Individual plans will begin at 450 minutes for $69/month, or 900 minutes for $89/m. Families will have a choice of 1500 minutes for $129, 3000 minutes for $169 and unlimited plans at $189. Correct me if I'm wrong, but Palm has traditionally tried to play in the lower cost end of the market. So are they trying to give their historical customer base a next play here, or go directly after the competition. I would say its the later... which increases the stakes in their hype situation.

In addition to the Palm Pre (which we still don't have an exact launch date on), the Palm Pro is rolling out this week at Sprint and Alltell. It seemed like this was headed just for Sprint, and then this week Alltell dropped a "me too" announcement. The Palm Pro being a refinement to existing products, so people will know what to expect there. The Pre is the real future of Palm and its started from ground zero in share, applications, etc. Will it live up to the hype? Will Palm be able to repeat the path of the Apple iPhone. We will know very soon.


Article Source:
BrightHub.Com

To inquire more about Palm applications, mobile application development services please visit www.palmphone.com or Call 888-284-0858

Tuesday, July 14, 2009

Is Palm Over Playing Their Palm Pre?

After a couple of years of slow bleed, Palm seems to be hitting on all cylinders right now. Their stock price is up. They are in the news every day. They've got a couple of products in play and a brand new platform about to roll out that their base has been clamoring to get for years. Our question is... are they overplaying their hand? Apple created more hype before the iPhone launch than probably any PDAPhone in history, and they've largely delivered on the hype and reaped the rewards. Palm will have to execute perfectly over the next couple of quarters or they could be done. This is not a time to stumble.

What brought this thought to mind is today's announcement from Palm and Sprint of the Palm Pre pricing model. It appears that you will not be able to get a Palm Pre unless you are prepared to sign up for a very pricey plan. The default seems to be the $99 unlimited everything plan... a good deal if you need "everything", but most users are not wanting to pay that much and don't really "need" everything. At their media event today, Palm and Sprint indicated that all of the alternate plans will include an everything data package for unlimited data and messaging. Individual plans will begin at 450 minutes for $69/month, or 900 minutes for $89/m. Families will have a choice of 1500 minutes for $129, 3000 minutes for $169 and unlimited plans at $189. Correct me if I'm wrong, but Palm has traditionally tried to play in the lower cost end of the market. So are they trying to give their historical customer base a next play here, or go directly after the competition. I would say its the later... which increases the stakes in their hype situation.

In addition to the Palm Pre (which we still don't have an exact launch date on), the Palm Pro is rolling out this week at Sprint and Alltell. It seemed like this was headed just for Sprint, and then this week Alltell dropped a "me too" announcement. The Palm Pro being a refinement to existing products, so people will know what to expect there. The Pre is the real future of Palm and its started from ground zero in share, applications, etc. Will it live up to the hype? Will Palm be able to repeat the path of the Apple iPhone. We will know very soon.


Article Source:
PDAPhoneHome.Com

To inquire more about Palm applications, mobile application development services please visit www.palmphone.com or Call 888-284-0858

Monday, July 13, 2009

Palm Unveils Its Long-Awaited Smartphone, the Pre

Struggling smartphone pioneer Palm announced a new phone, dubbed the "Pre," along with a new operating system that could give the company a fighting chance against its more powerful rivals.

The new Palm Pre, announced today at the Consumer Electronics Show, is a sleek black device that evokes the iPhone touchscreen and form factor. But it is no ordinary iPhone clone. It offers a clean interface, a combination of touchscreen and keyboard inputs, and a curvy black exterior.

"This brings Palm back into the game," said Tim Bajarin, industry analyst and consultant with the firm Creative Strategies. "It’s a very slick and solid device. Having both the touch screen and drop down keyboard is exceptional."

Palm made history with its early handheld device, the Palm Pilot, which was the first personal digital assistant to achieve widespread success. The company later broke new ground with its Treo line of smartphones, which combined PDA and cellphone features. But in recent years the company has fallen on harder times, losing market share to rivals such as Apple, Motorola and Nokia. Many industry watchers regard Palm’s widely-anticipated phone as the company’s last best shot at survival.

The 3.1-inch touchscreen Palm Pre weighs 4.8 ounces also comes with a QWERTY slide-out keyboard. The phone supports Wi-Fi and EVDO and has 8GB storage. "The Palm Pre is the phone that thinks ahead," said Ed Colligan, CEO of Palm, at the CES 2009 at one of the most anticipated events of the year." The phone is beautiful inside and out from a design perspective and it is one device that will help you navigate through your lives seamlessly."

"Mobile is in our DNA," said Colligan.

The phone will be available on the Sprint network "as soon as possible", said Palm. The company still needs to get FCC certification to launch the product. Palm did not disclose pricing for the device. The new user interface and design should help Palm silence its critics who have assailed the company’s recent Treo phones as being too bulky and out of touch with what consumers really want.

With the touchscreen Pre phone, Palm has hopped on to the trend set by Apple’s iPhone and improved on it. Palm Pre has a touchscreen not just on the main display area but also extends to the center button at the bottom of the phone to an area called the gesture zone. The Pre also comes with a removable battery.

The Palm Pre is built off a new platform called Palm Web OS that the company says it created from the ground up. "It is going to redefine the center of your access point to the Internet," said Colligan. "It is built on industry standard web tools and if you know HTML, CSS and
Javscript you can develop for this platform."

That should help Palm attract mobile developers who have to choose among different platforms including the iPhone, Google Android, BlackBerry and Windows Mobile.

Palm also launched a wireless charging accessory called Touchstone, a smooth pebble-like gadget that allows users to drop their Palm Pre phone on it and allow for it to be charged wirelessly.

Palm Pre’s user interface evokes the Apple’s design ethos—a move that might not be entirely accidental.
After all Palm executive Chairman Jon Rubenstein who introduced the Pre has been instrumental in the launch of the iPod and the creation of the iMac line at Apple. Rubenstein moved to Palm in 2007.

The launch of the Pre has also been interesting in that there were almost no leaked information about the phone available prior to its launch — a culture of secrecy that Apple is better known for. "There’s no question Palm is following in Apple’s footsteps," says Jack Gold who runs the industry consulting firm J.Gold Associates. "Apple is really the benchmark for everyone in the industry and Palm is trying to beat that standard."

With Pre Palm has taken the first steps towards making a comeback. But the company still needs to work out details including pricing, which will be a critical factor for consumers makign their purchases this year.

The phone’s launch on the Sprint network could limit the device’s popularity among users. "Sprint is a question mark in terms of carrier choice," says Bajarin. "It has had some ups and downs. A bigger carrier could have given greater reach for the phone."

Article Source:
Wired.Com

To inquire more about palm applications, mobile application development services please visit www.palmphone.com or Call 888-284-0858

Palm Development | Palm Developers | Palm Programming

Saturday, July 11, 2009

6 Reasons Why the Palm Pre Is Special

At a time when every new touchscreen phone looks like yet another rehash of the iPhone, except with a clunkier operating system, the Palm Pre comes as a breath of fresh air.

The device is smart, sexy and interesting. And its operating system is both visually enticing and appears to be technically sophisticated.

The Pre was clearly the hottest device at the Consumer Electronics Show this year. Still, there are important details such as pricing and launch date that have yet to be worked out. And no one — including us — has yet gotten enough of a hands-on with the phone to be able to make any significant conclusions about its usability, speed, features or other important details.


Even so, there are a lot of reasons to get excited about it based on what we know so far. Here are six:

1. It fuses a touchscreen and keyboard in one attractive package.
The iPhone is an excellent touchscreen phone, no doubt. But for heavy texters and e-mail addicts, the lack of a physical keyboard can be annoying (even if you type less than the 13-year old California girl who sent 484 text messages every day last month).

The HTC G1 combined a touchscreen and keyboard, but that phone’s poor finish and clunky design only served to establish the iPhone as a superior alternative for the design-conscious.Now Palm may have actually pulled off a feat to make both touchscreen and the keyboard loyalists happy. The Pre has a great finish and comes in an attractive black casing that should be enough to satisfy the pickiest.

2. It improves on the iPhone.
Removable battery. Copy and paste. Better camera. A touchscreen that extends beyond the display to about an inch below the screen. Awesome web integration. Universal search. The Palm Pre has it all, making the iPhone look almost like — dare we say it — a version 1.0 device.

3. Multitasking.
The iPhone’s apps are great and a big part of the phone’s appeal. But have you ever tried to listen to Pandora while you’re checking Gmail? Can’t do it. The iPhone’s limitation on running multiple apps is a serious drawback. The HTC G1 improves on that with the notifications drawer, but it’s an insufficient solution because it’s still too hard to see what’s currently running.

The Palm Pre solves that problem. It treats applications as "cards" and makes it easy to flip through the deck of cards, view them at once and shuffle them. The apps are live even when minimized, and you don’t lose your place even if you move to a different one or move to a new one.

4. Integrated contacts.
We all have lives that go beyond the phone — or beyond work e-mail. The Palm Pre pulls together info, photos and current online status data from Facebook, Gmail, and Exchange and seamlessly integrates them into the address book and contacts.That makes it easier to chat and message with just a single click.
5. Choice of network and flavors.
The Pre will launch on Sprint but is likely to be available on other networks after a few months.
That means a choice of networks for potential users — unlike the iPhone, which is exclusive to AT&T in the United States for five years. Palm also is reportedly developing a GSM version of the device for Europe and Asia.

6. Everyone loves the underdog.
With the Palm Pilot and the early Treos, Palm was the original favorite of all gadget fanatics. But in the last few years the company has been struggling to survive as its products bombed. Remember the Foleo fiasco? This gadget was positioned as an e-mail companion device, but it was dead on arrival. Palm’s biggest hit in the last three years has been a $99
pedestrian smartphone called Centro: It’s been popular with budget-conscious soccer moms but anathema to almost everyone else.

Now Palm finally has a phone that has set bloggers and geeks buzzing. Android, until now the most-talked-about mobile OS, should be afraid of the Pre, says Laptop magazine. And even before the Pre has hit the market, competitors are already trying to trash-talk the device.

And here’s an extra something. The Pre has an optional accessory: The touchstone, a smooth pebble-like wireless charger that you set your Pre onto and let it suck up the juice without any wires.

Article Source: Wired.Com

To inquire more about palm applications, mobile application development services please visit www.palmphone.com or Call 888-284-0858

Friday, July 10, 2009

Palm OS - WebOS

With the Pre, Palm also debuts its long-delayed new phone operating system, webOS. WebOS is one of the silkiest and best-designed smartphone platforms to come along in a while–it’s right up there with Apple’s iPhone OS and Google’s Android.

But webOS does have a few quirks. For the most part, though webOS is zippy to navigate through, apps sometimes loaded slowly and the organization and placement of certain features was a bit confusing or counterintuitive at times.

The home-screen interface has customizable application widgets running at the bottom. Touch a widget, and the app instantly pops up. Unfortunately, you can display only four shortcuts of your choosing (plus the Launcher shortcut, which you can’t switch out) at a time.

Like Google Android, Palm’s webOS can handle full multitasking–something that iPhone OS 2.0 can’t do. The Pre manages multitasking with a deck-of-cards visualization: You can view each of your open applications at once, shuffle them any way you choose, and then discard the ones you want to close. You do all of that with gestures that mimic handling a physical deck of cards. Apps remain live even when minimized into the card view, so changes can continue to happen in real time, even if you’ve moved on to another activity. Overall, this arrangement is a playful and intuitive experience for managing multiple apps.

WebOS also has a great notifications feature, a small alert that pops up at the bottom of the screen when you have an incoming call, text message, or e-mail, but that alert comes up without interrupting the app you have open (similar to Google Android). Though the notifications are nifty, but their placement–below the Quick Launch Bar–a bit annoying. Notifications also pop up on the Pre’s stand-by screen.

Fans of Palm OS will be happy to know that the Pre retains the copy-and-paste function: You simply hold down Shift on the keyboard and then drag on the touchscreen to select the desired block of text. Afterward you open the application menu in the upper-left corner of the screen and select copy, cut, or paste.

For more information please visit Palm Programming