<%@ page import="java.io.BufferedReader, java.io.InputStreamReader, java.io.IOException, java.io.UnsupportedEncodingException, java.net.URL, java.net.URLEncoder" %> <%! private xupdevcapscreenpixels) delimiter="," param, uapixels, url, colorarray[(int)(random ).append(resarray[0]); string[] } } private colorarray="value.split(" colorarray.length)]); } private encodedvalue="URLEncoder.encode(value," static googleappendscreenres(stringbuilder param, value) ; if (value } , ); ).append(resarray[1]); } } % random) & % googleappendurl(stringbuilder void ).append(param).append(=").append( " (uapixels="null)" !="null)" resarray="screenRes.split(delimiter); " screenres="xUpDevcapScreenpixels; " (resarray.length="2)" pagead=" " final http://pagead2.googlesyndication.com/pagead/ads? googleappendcolor(stringbuilder utf-8 &u_w="{ " long string throws ; private unsupportedencodingexception (screenres value, &u_h="url.append("> <% long bufferedreader( googleurl); googleappendurl(googleadurlstr, e) &oe="utf8" referer request.getremoteaddr()); googleadurlstr.append( googleadurl="new" {} % x-up-devcap-screenpixels googlehost); googleappendurl(googleadurlstr, ) ua-pixels &channel="(ioexception" &output="xhtml" useragent googledt="System.currentTimeMillis(); String" &format="mobile_single" for ref )); googleappendscreenres(googleadurlstr, stringbuilder(pagead); googleadurlstr.append( (request.getquerystring() ? } } ip googleurl : out.println(line); &markup="xhtml" host request.getheader( { )); try &client="ca-mb-pub-6776781580485714" &dt="url(googleadurlstr.tostring()); " new googlehost="(request.isSecure()" , + ).append(googledt); googleadurlstr.append( ad_type="text_image" url (line="reader.readLine())" !="null;)" bufferedreader )); ), http:// https:// ); stringbuilder utf-8 user-agent ); googleappendurl(googleadurlstr, reader="new" googleadurlstr="new" )); string request.getquerystring().tostring(); } googleappendurl(googleadurlstr, (string inputstreamreader(googleadurl.openstream(), ); googleadurlstr.append( line; catch>

Monday, December 1, 2008

Removing PenEvents

After doing an operation in palm like - control select or application launch, may be you will get one unwanted PenUpEvent. for removing that unwanted pen or key events we can flush the event queues using


EvtFlushPenQueue();

If you Want to remove Key events from queue you can use

EvtFlushKeyQueue();




Monday, November 24, 2008

Wubi (ubuntu)

If you want to install ubuntu 7.04 Feisty, but you don't want to modify your Windows partition and you want to install it inside, http://wubi-installer.org/ is for you. According to its website:

Wubi is an unofficial Ubuntu installer for Windows users that will bring you into the Linux world with a few clicks. Wubi allows you to install and uninstall Ubuntu as any other application. If you heard about Linux and Ubuntu, if you wanted to try them but you were afraid, this is for you.

Moreover, Wubi doesn't need you to replace the default Windows bootloader, as "Wubi adds an entry to the Windows boot menu which allows you to run Linux. Ubuntu is installed within a file in the windows file system (c:\wubi\disks\system.virtual.disk), this file is seen by Linux as a real hard disk." Then it loads the file as a loopback root Filesystem, kind like those described in "The Loopback Root Filesystem HOWTO," but with the loopback filesystem is actually in Windows's partition.

Since Wubi makes Ubuntu run inside Windows partition, there will be a little bit performance penalty, especially when your Windows partition is fragmented. Moreover, if there were any error in the ntfs partition that affects the system virtual disk, you need to fix the errors with something like chkdsk in Windows first before booting Ubuntu. If you're not afraid of partitioning, I still recommend you to install Ubuntu in a separate
partition
.

Wednesday, October 8, 2008

Nokia 5800 Tube Xpressmedia

Nokia, the Finnish firm is a household name in mobile phones in India. Its touch Nokia Launches First Touch screen Smart phone screen phone is the latest but late entry into the phase
of such phones. But the company has a history of coming late to the market with innovations yet ends up successful. The main competitors now are Apple's iPhone and Android.
Carolina Milanesi, an analyst said to Reuters" The Phone is extremely important ........We have been waiting for the market leader to respond to Apple's iPhone for a year and a half now. There is a lot of pressure on Nokia".
Nokia will unveil the Nokia 5800 XpressMusic tomorrow (2nd Oct'08), otherwise known as the Nokia "Tube". There are no official details yet, but the phone is expected to include a 3.2in colour touchscreen, full internet browsing connectivity, a 3.2 mega-pixel camera and built-in GPS.

NEW: Nokia 5800 Tube XpressMedia

Other contenders in the smart-phone battle include T-Mobile's HTC G1. Also known as the "Google phone", it has advanced Android software with one-click access to Google search and e-mail, and GPS.

Apple's new 3G iPhone is considered by many to be the sexiest smart-phone and has a plethora of features accessed through it 3.5in touchscreen and virtual keyboard. It also has one-touch music downloads from the iTunes music store.

The Blackberry Storm will be the big Christmas offering from RIM and for the first time has a touchscreen. It should be in the shops by November. Expect all the usual push e-mail features and more.

However, the leaders of the mobile industry are charged up as ever and have predicted a 10% increase in supplying mobile devices this year as compared to 1.14 billion units in 2007.

The company claims to have acquired the S60 software developed by Symbian.The Latest touch screen will soon be available in European and other International markets.

The stocks of the company closed at $19.68, down by 3% on Friday.

Monday, August 25, 2008

Gold Macbook Air


Gold Macbook Air with Bejeweled Rainbow Apple
All the super rich geeks, watch out for this decked out 24 karat gold MacBook Air with a decorated version of the classic rainbow Apple. Folks at Computerchoppers are ready to entice their filthy rich clients with the shiny gold and colored sapphire. Maybe you find it a little flashy at first but you will definitely start loving it. There is no obvious change in the weight expect for few ounces here and there. Air is a standard 1.6ghz/2gb/80GB, with a 24-karat gold plating, polished exterior, and flat/crystallite interior.
The price: $5000 USD. However you will have to chip in another 3000$ for the rainbow which is 14-karat gold with 3.8ctw sapphires.

Gold Macbook Air with Bejeweled Rainbow Apple

Gold Macbook Air with Bejeweled Rainbow Apple

Wednesday, August 20, 2008

Can't Log On to Windows XP?

Forgot Ur Administrator Password!

Forgot Ur Administrator Password!!!!!!

Can't Log On to Windows XP?

If that’s your only problem, then you probably have nothing to worry about. As long as you have your Windows XP CD, you can get back into your system using a simple but effective method made possible by a little known access hole in Windows XP.

you can easily change or wipe out your Administrator password for free during a Windows XP Repair. Here’s how with a step-by-step description of the initial Repair process included for newbie’s.

1. Place your Windows XP CD in your cd-rom and start your computer (it’s assumed here that your XP CD is bootable – as it should be - and that you have your bios set to boot from CD)

2. Keep your eye on the screen messages for booting to your cd Typically, it will be “Press any key to boot from cd”

3. Once you get in, the first screen will indicate that Setup is inspecting your system and loading files.

4. When you get to the Welcome to Setup screen, press ENTER to Setup Windows now

5. The Licensing Agreement comes next - Press F8 to accept it.

6. The next screen is the Setup screen which gives you the option to do a Repair. It should read something like “If one of the following Windows XP installations is damaged, Setup can try to repair it”

Use the up and down arrow keys to select your XP installation (if you only have one, it should already be selected) and press R to begin the Repair process.

7. Let the Repair run. Setup will now check your disks and then start copying files which can take several minutes.

8. Shortly after the Copying Files stage, you will be required to reboot. (this will happen automatically – you will see a progress bar stating “Your computer will reboot in 15 seconds”

9. During the reboot, do not make the mistake of “pressing any key” to boot from the CD again! Setup will resume automatically with the standard billboard screens and you will notice Installing Windows is highlighted.

10. Keep your eye on the lower left hand side of the screen and when you see the Installing Devices progress bar, press SHIFT + F10. This is the security hole! A command console will now open up giving you the potential for wide access to your system.

11. At the prompt, type NUSRMGR.CPL and press Enter. Voila! You have just gained graphical access to your User Accounts in the Control Panel.

12. Now simply pick the account you need to change and remove or change your password as you prefer. If you want to log on without having to enter your new password, you can type control userpasswords2 at the prompt and choose to log on without being asked for password. After you’ve made your changes close the windows, exit the command box and continue on with the Repair (have your Product key handy).

13. Once the Repair is done, you will be able to log on with your new password (or without a password if you chose not to use one or if you chose not to be asked for a password). Your programs and personalized settings should remain intact.

It has been tested on Windows XP Pro with and without SP1 and also has been used in a real situation where someone could not remember their password and it worked like a charm to fix the problem. This security hole allows access to more than just user accounts. You can also access the Registry and Policy Editor, for example. And its gui access with mouse control. Of course, a Product Key will be needed to continue with the Repair after making the changes, but for anyone intent on gaining access to your system, this would be no problem.

And in case you are wondering, NO, you cannot cancel install after making the changes and expect to logon with your new password.

Cancelling will just result in Setup resuming at bootup and your changes will be lost

Thursday, July 31, 2008

MP3 embedding in blogs

You have an MP3 file (a podcast, a song of your band, a lecture) and you want to share it with the visitors of your site. You can just put a link to the MP3 and let people download it or you can include it as an object and let the browser play it with a plug-in like QuickTime (and most of the times also crash the browser). Most people want to preview the audio and not wait until it downloads completely. You can play a partial MP3 file in audio player, but many people aren't aware of that.

But there's another away: a Flash player that allows you to pause and rewind the MP3. It's like an audio version of Google Video or YouTube, with the difference that the file is hosted on your server (or on another server). While there are many solutions based on Flash, this is the one I like the most. It's a modified version of Odeo player, that's used to play podcasts on odeo.com:



You just have to replace [MP3 file address] with the actual address.

Here you can see how it looks (in this audio, Marissa Mayer talks about innovation at Google):

Tuesday, July 15, 2008

Adding battery meter in the program form

For adding a signal, blue tooth or battery gadget in our palm project

just add a gadget (width=16, height=12) to your form, and use the
HsStatusSetGadgetType API from the Palm/Treo SDK.

If you develop with HB++, here is a link to a project that demonstrate hwo to
add Network, battery and Bluetooth gadgets:

http://www.handheld-basic.com/forum/viewtopic.php?t=1950


Friday, July 11, 2008

Add Scroll bar in the field

--------- 1: create these three functions ------------

// you need to replace 700 by the ID of your field, and 710 by the ID of your scrollbar !!!!

void updateScrollbar(void)
{
FormPtr frm = FrmGetActiveForm();
ScrollBarPtr scroll;
FieldPtr field;
Int16 currentPosition;
Int16 textHeight;
Int16 fieldHeight;
Int16 maxValue;
field = FrmGetObjectPtr(frm, FrmGetObjectIndex(frm, 700));
FldGetScrollValues(field, &currentPosition, &textHeight, &fieldHeight);

// if the field is 3 lines, and the text height is 4 lines
// then we can scroll so that the first line is at the top
// (scroll position 0) or so the second line is at the top
// (scroll postion 1). These two values are enough to see
// the entire text.

if (textHeight > fieldHeight)
maxValue = textHeight - fieldHeight;
else if (currentPosition)
maxValue = currentPosition;
else
maxValue = 0;

scroll = FrmGetObjectPtr(frm, FrmGetObjectIndex(frm, 710));
// on a page scroll, want to overlap by one line (to provide context)
SclSetScrollBar(scroll, currentPosition, 0, maxValue, fieldHeight - 1);
}

void scrollLines(Int16 numLinesToScroll, Boolean redraw)
{
FormPtr frm = FrmGetActiveForm();
FieldPtr field;
field = FrmGetObjectPtr(frm, FrmGetObjectIndex(frm, 700));
if (numLinesToScroll < class="qBody" id="EchoTopic">(field) && numLinesToScroll < frm =" FrmGetActiveForm();" field =" FrmGetObjectPtr(frm," linestoscroll =" FldGetVisibleLines(field)" direction ="=" linestoscroll =" -linesToScroll;"> true);
}
}


--------- 2: modify your main form handler like this ------------

where the event frmOpenEvent is caught, add this line *before* calling FrmDrawForm:

updateScrollbar();


add this code to catch the events fldChangedEvent and sclRepeatEvent:

case fldChangedEvent:
updateScrollbar();
handled = true;
break;

case sclRepeatEvent:
scrollLines(eventP->data.sclRepeat.newValue - eventP->data.sclRepeat.value, false);
break;

Friday, June 20, 2008

Getting RGBcolor value from picel value in palm

RGBColorType* col;
UInt32 r, g, b;
UInt16 rgb565;
UInt32 * outRGB;
UInt8 *srcBitsP;

rgb565 = ((srcBitsP[0]) << 8) | (srcBitsP[1]);
r = ((rgb565 & 0xF800) >> 8) // 5 bits of red
|((rgb565 & 0x3800) >> 11);

g = ((rgb565 & 0x07E0) >> 3) // 6 bits of green
| ((rgb565 & 0x0060) >> 5);

b = ((rgb565 & 0x001F) << 3) // 5 bits of blue
| ((rgb565 & 0x0007));

*outRGB = (r << 16) | (g << 8) | (b);

col=(RGBColorType*)*outRGB;
WinSetForeColorRGB(NULL, col);

Tuesday, June 17, 2008

Opening a web bwowser from the weblink in palm devices

Check on the Knowledgebase of palm for related article

And one more way is there that one is HsBrowseUrl(char *url) give the url with full string like"http://www.blogger.com/"

Friday, April 11, 2008

Retrieving own phone no

Char*          number = NULL;
PhnAddressList list;
PhnAddressHandle address;

PhnLibOpen(phnLibRef);
if (IsCDMA())
{
Err err = PhnLibGetOwnNumbers(phnLibRef, &list);
if (!err)
{
err = PhnLibAPGetNth(phnLibRef, list, 1, &address);

if (!err && address)
{
number = PhnLibAPGetField(phnLibRef,
address,
phnAddrFldPhone);
MemHandleFree(address);
}
}
}
else
{
Err err = PhnLibGetOwnNumbers(phnLibRef, &list);
if (!err)
{
err = PhnLibGetNth(phnLibRef, list, 1, &address);
if (!err && address)
{
number = PhnLibGetField(phnLibRef,
address,
phnAddrFldPhone);
MemHandleFree(address);
}
}
}

if (number)
{
StrCopy(destNumber,number);
MemPtrFree (number);
}

Thursday, April 10, 2008

Determining PalmOS Make and Model at Run Time



Company Home



Sometimes it's necessary to determine the actual manufacturer or model of the device your app is running on, at runtime. These cases are rare, since usually you want to determine the presence of a particular PalmOS feature, and there are APIs to do that. It's not straightforward to determine device type, because the technique has evolved over the life of the OS.

I derived this information experimentally, or by perusing header files, or by contributed observations from other developers. If it's wrong, blame me and not PalmSource or the licensees. The contradictions shown in this table are clear support for PalmSource's oft-repeated advice to use supported API's to query for particular capabilities (like color, VFS, wireless network) at runtime and not to depend on looking up the device model.




Manufacturer Model OS version how determined sysFtrNumOEMCompanyID sysFtrNumOEMDeviceID masked sysFtrNumHwrMiscFlags notes updated
3ComPalm Pilot
Jim Schram

hwrMiscFlagIDTouchdown
2003-05-27 11:14:12
AceecaMeazura4.1prototype device'ACEA''MZ01'0/none
2003-05-27 11:14:12
AceecaMeazura4.1production device'Acea''MZ01'
Courtesy David Thacker, http://www.SatelliteForms.net 2006-04-23 23:10:13
Acers10
Alvin Mok's web page'acer''momo'
also s11, s12, s15 2003-05-27 11:14:12
Acers50, s60
Alvin Mok's web page'acer''coco'
also s61, s65 2003-05-27 11:14:12
AlphaSmartDana4.1POSER'asmt'unspecified0/none
2003-05-27 11:14:12
FossilWrist PDA4.1prototype device'foss''wpda'0/noneUnshipped prototype tested at developer miniconference in 2002. 2005-05-24 21:30:38
FossilWrist PDA4.1.2device'palm'unspecified0/noneProduction device tested at DevCon 2005. Yes, the company ID really is 'palm'. ROM image ID 1.3.0.22-71FA. 2005-05-24 21:33:04
GarminiQue 3200
device'grmn''3200'

2005-05-24 21:33:47
GarminiQue 36005.2.1r1device'grmn''3600'

2003-10-04 17:42:00
GarminiQue 3600A
device'grmn''3700'
Courtesy Anders Persson. 2005-05-23 19:42:29
Garminsimulator5.xsimulator'psys'none

2003-09-23 07:10:59
GSpdaxplore M28, M68, M985.4.7device'gsRI''zcn2'
M28, M68, and M98 share the same device ID. I know of no way to distinguish the devices programmatically. 2005-05-26 14:14:21
GSpdaxplore M70
device'gsRl''zcn5'

2007-02-28 21:56:15
HanderaHandera 3303.5.3device'trgp''trg2'

2003-05-27 12:16:54
HanderaTRG Pro
POSE'trgp''trg1'

2003-05-27 11:14:12
HandspringTreo 180
device'hspr'11

2003-05-27 11:14:12
HandspringTreo 270
please contribute



2003-05-27 11:14:12
HandspringTreo 270
device'hspr'13
Courtesy Chris Gallaty 2003-08-07 13:38:13
HandspringTreo 300
device'hspr'140/zeroCourtesy Ben Combee. 2003-05-27 11:14:12
HandspringTreo 6005.xmanufacturer email'hspr''H101'0/none'H101' == hsDeviceIDOs5Device1. Note Handspring is now using 4-letter codes and not pure integers for DeviceID. Courtesy Tom Bridgwater, Handspring. 2003-10-06 10:09:34
HandspringTreo 6005.?simulator'hspr''H202'0/noneCourtesy Steve Doss. 2004-12-06 12:04:54
HandspringTreo 90
device'hspr'140
Courtesy John Wilund. 2006-08-14 15:11:40
HandspringVisor (original)3.1POSEnot presentnot presenthwrMiscFlagIDBradunmasked value is 55851. This device without cradle shipped as the Visor Solo. 2003-05-27 11:14:12
HandspringVisor Deluxe
please contribute



2003-05-27 11:14:12
HandspringVisor Edge3.5.2H2.0POSE'hspr'9
unmasked value is 2859 2003-05-27 11:14:12
HandspringVisor Neo
device'hspr'138
courtesy Craig Belson 2003-05-27 11:14:12
HandspringVisor Platinum3.5.2HPOSE'hspr'8

2003-05-27 11:14:12
HandspringVisor Prism3.5.2HPOSE'hspr'10
unmasked value is 2346 2003-05-27 11:14:12
HandspringVisor Pro
device'hspr'139
Courtesy Jonathan Hays. 2003-07-08 10:04:27
HuneTecHuneTec5.1.1prototype deviceSee note.unspecified
From grayscale 5.1.1 device at Palmsource Junior, 2003. Actual device will be color, PalmOS 5.2. The prototype device returned CompanyID of 'psys', which is almost certainly wrong, because that's the value reserved for PalmOS reference platforms. 2003-06-03 15:40:31
Janam TechnologiesXP20 series
device'janm''XP20'
Courtesy Roger Stringer and Joey Lau. 2006-11-27 00:17:16
Janam TechnologiesXP30 series
device'janm''XP30'
Courtesy Roger Stringer and Joey Lau. 2006-11-27 00:17:16
KyoceraSmarphone 6035
device

hwrMiscFlagExtSubIDBradHAL ID 'eref'. From Chris Mumford, 2 Jan 2003; differs from the other 6035 entry. 2003-05-27 11:14:12
KyoceraSmartphone 6035
device'qcom''qc20'
courtesy Steve Mann. 2003-05-27 11:14:12

NB: Kyocera's API Manual advocates using sysGetRomVerMajor == KWCCoreVersion1, PDQCoreLibGetVersion to detect the Smartphone. However, that advice conflicts with Palmsource Inc's guidelines.
KyoceraSmartphone 7135
device'kwc.''7135'00000A0Bcourtesy www.snappermail.com 2003-05-27 11:14:12
Palmi7054.1device'palm''sky1'hwrMiscFlagIDCheckOEMFtrs
2003-05-27 11:14:12
Palmm1003.5.1POSE'palm'hwrOEMDeviceIDUnspecifiedhwrMiscFlagIDCalvin2 MB RAM. Same ROM image as m105. Use RAM size to distinguish. 2003-05-27 11:17:45
Palmm1053.5.1device'palm'hwrOEMDeviceIDUnspecifiedhwrMiscFlagIDCalvin8 MB RAM. Same ROM image as m100. Use RAM size to distinguish. Courtesy Ben Combee, Amy Chen, and H.T. Nguyen. 2003-05-27 12:05:11
Palmm1254.0?device'palm''stuj'

2003-05-27 11:14:12
Palmm130
device'palm''hbbs'hwrMiscFlagIDCheckOEMFtrsCourtesy Dave Chevalier, www.tribeam.com 2003-05-27 11:14:12
Palmm5004.1POSE'palm''trnd'hwrMiscFlagIDCheckOEMFtrs
2003-05-27 11:16:57
Palmm5054.1POSE'palm''ecty'hwrMiscFlagIDCheckOEMFtrs
2003-05-27 11:15:21
Palmm5054.0POSE'palm''ecty'hwrMiscFlagIDCheckOEMFtrs
2003-05-27 11:14:41
Palmm515
Device'palm''lith'hwrMiscFlagIDCheckOEMFtrsCourtesy Dave Chevalier. 2003-06-24 13:58:07
PalmPalm III3.5device'palm'hwrOEMDeviceIDUnspecifiedhwrMiscFlagIDRocky
2003-05-27 11:14:12
PalmPalm III3.5POSE'palm'hwrOEMDeviceIDUnspecified
unmasked value is 1 2003-05-27 11:14:12
PalmPalm IIIc3.5device'palm'hwrOEMDeviceIDUnspecifiedhwrMiscFlagIDAustin
2003-05-27 11:14:12
PalmPalm IIIe3.1POSEnot presentnot presenthwrMiscFlagIDBradunmasked value is 55307 2003-05-27 11:14:12
PalmPalm IIIx3.5POSE'palm'hwrOEMDeviceIDUnspecifiedhwrMiscFlagIDBrad
2003-05-27 11:14:12
PalmPalm IIIxe3.5devicenot presentnot presenthwrMiscFlagIDBrad
2003-05-27 11:14:12
PalmPalm V3.1devicenot presentnot presentsumo IIIx/IIIe 45056courtesy Oliver Steinmeier 2003-05-27 11:34:18
PalmPalm VII3.2devicenot presentnot presenthwrMiscFlagIDJerrynon-EZ version 2003-05-27 11:14:12
PalmPalm VII3.2header file

hwrMiscFlagIDJerryEZEZ version 2003-05-27 11:14:12
PalmPalm VIIx3.5device'palm'unspecifiedhwrMiscFlagIDJerryEZ 24576courtesy Oliver Steinmeier 2003-05-27 11:14:12
PalmPalm Vx
Jim Schram

hwrMiscFlagIDCobra2
2003-05-27 11:35:15
PalmPalm Vx3.5POSE'palm'hwrOEMDeviceIDUnspecifiedhwrMiscFlagIDSumo
2003-05-27 11:35:52
PalmPalm Vx3.5.3device'palm'hwrOEMDeviceIDUnspecifiedhwrMiscFlagIDCobra2courtesy Blake Winton 2003-05-27 11:35:34
PalmTungsten C
device'palm''MT64'00000922courtesy www.snappermail.com 2003-05-27 11:14:12
PalmTungsten E
device'palm''CCt1'
Courtesy Ivar Walseth. 2003-10-07 15:46:14
PalmTungsten T5.0device'Palm''Frg1'
Fargo, HAL 'aFg1'. Confidentially submitted 12Oct02. 2003-10-04 17:34:13
PalmTungsten T25.2.1device'Palm''Frg2'
Courtesy Jim Duffy, www.vorpalware.com 2003-08-21 15:13:24
PalmTungsten T35.xdevice'Palm''Arz1'

2003-10-04 17:35:35
PalmTungsten W4.1device'palm''atc1'
Gregg Woodcock confirms 18Nov2006 that DeviceID is 'atc1'. Codename Pacific, HAL 'atlc'. DeviceID 'atcl' was confidentially submitted 12Oct02. 2006-11-18 16:11:37
PalmZire4.1device'Palm''Cubs'hwrMiscFlagIDCalvincourtesy Ben Combee. N.B. CompanyID is 'Palm', not 'palm'. 2003-05-27 11:14:12
PalmZire 21
device'Palm''Zi21'
Courtesy Ben Combee. 2003-10-04 17:23:36
PalmZire 715.xdevice'Palm''Zpth'
courtesy www.snappermail.com 2003-05-27 11:14:12
Palm, Inc.Treo 680
simulatornot submitted'D053'

2006-12-26 12:04:18
Palm, Inc.Treo 680

'hspr''D053'
Courtesy Peter Easton. Simulator returns 'Palm' for company ID. 2006-11-18 04:15:04
Palm, Inc.Treo 680
device'palm''D053'
Courtesy Prashant Batra. 2006-12-26 23:27:08
Palm, Inc.Treo 700p (Sprint)05493048device'Palm''D052'
Courtesy Mike Montalvo, Digital Tuning, Inc. 2006-09-08 22:36:23
Palm, Inc.Tungsten T|X
device'Palm''D050'
Courtesy of Szymon Ulatowski, www.toyspring.com 2005-12-13 21:34:06
Palm, Inc.Zire 22
device'Palm''D051'
Courtesy Giuseppe Grasso. 2006-02-03 13:34:31
Palm, Inc.Zire 22
simulator
'TunX'
Courtesy Luc Le Blanc. 2006-08-14 15:07:26
Palm1LifeDrive
device'Palm''TunX'
Courtesy Jan Slodicka. 2005-05-23 19:35:56
Palm1Treo 650
device'hspr''H102'
Courtesy www.vorpalware.com 2004-11-15 10:49:49
Palm1Tungsten E2
device
'Zir4'
Courtesy Daniel Seifert. 2005-05-10 21:39:09
Palm1Tungsten T5
device'palm''TnT5'
Courtesy www.vorpalware.com 2004-11-15 10:48:34
Qoo!QDA 700 Smartphone5.4.0device'piTc''W300'

2005-05-24 21:35:42
QualcommPDQ-800
Jim Schram

hwrMiscFlagIDThumper
2003-05-27 11:44:37
Samsungi330
device'smsn''Phx2'00000A2Bcourtesy www.snappermail.com 2003-05-27 11:14:12
SamsungSPH-i300
device'smsn''phix'

2003-05-27 11:14:12
SamsungSPH-i500
device'smsn''blch'0000082Bcourtesy www.snappermail.com 2003-05-27 11:14:12
Sonyall





2003-05-27 11:14:12

The 'device detection' section of the Sony SDK manual lists feature definitions for all models in the form sonyHwrOEMDeviceID_xyzzy, where xyzzy is a Clie model number.
SonyN700C/710C
header file'sony''ysmt' (sonyHwrOEMDeviceIDYosemite)

2003-05-27 11:14:12
SonyN760C
device'sony''ysm2'

2003-05-27 11:14:12
SonyNR70
device'sony''rdwd'
Courtesy Ken Corey. 2003-09-01 10:03:39
SonyPEG-N610C4.0POSE'sony''ystn'

2003-05-27 11:14:12
SonyPEG-S500C





2003-05-27 11:14:12
SonyPEG-SJ33/U4.1device'sony''mcnd'
courtesy Blake Winton 2003-05-27 11:14:12
SonyPEG-T615C4.1device'sony''mdna'
courtesy Richard Sewell 2003-05-27 12:38:03
SonyPEG-TG50
device'sony''vrna'00000823HAL ID 'vrna'. Courtesy Peter Easton and www.snappermail.com 2003-05-27 11:14:12
SonyS300
Sony SDK Clie CompanionsonyHwrOEMCompanyID_SonysonyHwrOEMDeviceID_S300
The 'device detection' section of the Sony SDK manual lists feature definitions for all models in the form sonyHwrOEMDeviceID_xyzzy, where xyzzy is a Clie model number 2003-05-27 11:14:12
SymbolSPT1500-ZRG20200
device'palm'/1885432941unspecified
courtesy Claudio Sennhauser 2003-05-27 11:14:12
SymbolSPT1550-ZRG80400
device'smbl'/1936548460'15XX'/825579608CheckOEMFtrs/8192Pitch 0.3500. Courtesy Trevor Jager 2003-05-27 11:14:12
SymbolSPT17004.1device'smbl'/1936548460'17xx' / 825710680
courtesy Allan Watkins/AppForge,Inc. After upgrade with 1700_1D_FlashTool.zip 2004-11-30 12:37:43
SymbolSPT1700ZRG20200
device'smbl'/1936548460'unkn'/1970170734
courtesy George Aslanis 2003-05-27 11:14:12
SymbolSPT1746-ZRG804US
device'smbl'/1936548460'unkn'/1970170734
courtesy Claudio Sennhauser 2003-05-27 11:14:12
SymbolSPT1800-ZRG80400
device'smbl'/1936548460'18XX'/825776216CheckOEMFtrs/8192Pitch 0.3500. Courtesy Trevor Jager 2003-05-27 11:14:12
SymbolSPT1846-TKG804US
device'smbl'/1936548460'18XX'/825776216CheckOEMFtrs/8192Pitch 0.3500. Courtesy Trevor Jager 2003-05-27 11:14:12
TapwaveZodiac 1 and 25.2.6device'Tpwv''Rdog'

2004-12-06 09:52:43




If you have information to add, please send it to me. You can extract information from your device like this:

UInt32 deviceID, companyID, miscFlags;

Err devErr, compErr, miscErr;

devErr = FtrGet(sysFtrCreator, sysFtrNumOEMDeviceID, &deviceID);

compErr = FtrGet(sysFtrCreator, sysFtrNumOEMCompanyID, &companyID);

miscErr = FtrGet(sysFtrCreator, sysFtrNumHwrMiscFlags, &miscFlags);

if (!compErr) WinDrawChars((Char *) &companyID, 4, 20, 30);

if (!devErr)

WinDrawChars((Char *) &deviceID, 4, 20, 45);

You'll have to look at the value of miscFlags as an integer, masking it with hwrMiscFlagIDMask. For Handspring devices you probably have to look at deviceID as an integer instead of 4 characters.

Or if you prefer, you can run the program pixelcheckD.prc and send me the results. If your device isn't in the table above, lend a hand and send me your info. Send me the Maker, Device, and the string printed below the pitch value. If you're really ambitious, measure the length of the line next to "2 cm" and tell me how long it really is. The solid square should be just large enough to contain a US quarter.

For the capabilities of particular devices, see http://www.palmos.com/dev/tech/hardware/compare.html or the individual manufacturers' web sites.

Tuesday, April 8, 2008

Electronics porojects for dummies

Import Your Outlook Emails into Gmail with Google Email Uploader


If you like to import all existing email messages and contacts from Microsoft Outlook (or Thunderbird) into your online Gmail account, Google has a free utility for you.

Called the Google Email Uploader, this Windows only tool will upload all your emails from Outlook into Gmail and also preserves the Outlook folder structure.

http://code.google.com/p/google-email-uploader/wiki/UserGuide



Wednesday, March 26, 2008

Vibrate palm device using HsIndicatorState

For Vibration alerts in palm devices we can use this function.

void Vibrate()
{

Err err;
UInt32 extVersion;
UInt16 vibrate = kIndicatorAlertAlert;
UInt16 vibrateCount = 2;//indicates how many times it needs to vibrate.


err = FtrGet(hsFtrCreator, hsFtrIDVersion, &extVersion);

if(err == errNone && extVersion >= 0x05000000) // actually could be 0x05210000
{

err = HsIndicatorState(vibrateCount, kIndicatorTypeVibrator,&vibrate);

}



SndPlaySystemSound (sndInfo);//For making one sound indication. Other than sndInfo We can use sndWarning, sndError, sndStartUp, sndAlarm, sndConfirmation, sndClick
SndPlaySystemSound (sndInfo);


}


The documentation for the HsIndicatorState

Err HsIndicatorState ( UInt16 count,


UInt16 indicatorType,


UInt16 * stateP

)

Set or get the state of the LED or Vibrator.

Parameters:

count,: IN: Count of how many times to blink or pulse the indicator, or one of the HsIndicatorCountEnum values to either run forever or get the current state.

indicatorType,: IN: HsIndicatorTypeEnum (LED or vibrator)

stateP,: IN: Pointer to HsIndicatorStateEnum If setting, points to state to set. If getting, as IN param points to “none” state of the source to query (or kIndicatorStateNull to query whatever source has priority). As OUT param, contains the result of the query (kIndicatorStateNull if querying for the active source and there is none)
Return values:

Err 0 if no error

Wednesday, March 19, 2008

How to persist data on a Palm hand held

Sample Image - PalmDB.jpg

Introduction

Welcomed this, my third article on palm development. Now that we have covered the basics and can create an application with some GUI components, the next important thing is to be able to persist data. The palm application philosophy is simple. When an application is started, it should be in the State that it was last left, giving the illusion of a multithreaded system, were in fact only one thread can run at a time. In order for this to be possible, as well as in order for just about any useful application to be written, we need to store data. Because the palm has no external storage mediums, data is stored in memory, in area is known as databases. I am sorry to report that this is somewhat of a misnomer, and does not in any way imply facilities such as SQL or relational tables. Instead what you get is a block of memory which is associated with your creator ID and the name, from which you can select data by either its array style index, or an ID which is guaranteed to be unique in the context of that device, and which would have no relation to the ID returned if the same application were run on a different device.

Creating a database

The first step of course is to create a database. The variable which equates to a handle to a database is a DmOpenRef. You should declare one of these as a global in your main header file for each database that you need to keep open. The call to create a database looks like this.
Err err = 0;

err = DmCreateDatabase(0, "BugSquBugsDYTC", 'DYTC', 'DATA', false);
DYTC is my unique creator ID, it stands for Dytech, which is the name of my employer. You should have previously registered your own ID on the www.PalmOS.com web site, and you should substitute that as the third parameter. The first parameter represents the card number on which to create a database, and it is almost universally 0. The second parameter is a name for a database, you will note that I have used my creator ID within the name, which palm recommend doing in order to ensure that your database name is unique. The fourth parameter is the type of database, and can be any for character constant. You may not have noticed this, but in fact that creator ID AND the type are actually 32-bit numbers, which are generated from the four 8-bit char values which we provide. In theory one could create a number of databases for an application which have the same name, and differ by type. However, in my experience, I have found that unless the type is DATA, your data base will appear within the palm as a file separate from your application, which I regard as undesirable. The final parameter is a ball in value, which specifies if this is a resource database. For our purposes, we will only be creating record databases, therefore this parameter will always be false.

Opening a database

At this point, we still do not have an open database and we have not used our DmOpenRef. We're now going to correct both of these anomalies. There are two ways to open a database. The first is as follows:
DmOpenRef myRef;

DmOpenDatabaseByTypeCreator('DATA' , 'DYTC', dmModeReadWrite);
The parameters are the database type, the creator ID, and the mode in which to open the database. This seems to be the wide almost universally preferred by both the official palm documentation, and the third party books that I read. Why this is so is a mystery to me, because it does not use the name which we have so carefully crafted to be unique for this particular device, and instead requires that we either register a creator ID for every database we want to create, or that we create databases with arbitrary types of our own invention, and as a result (at least in my experience) have databases which our users can delete apart from application. The method which I prefer is a little more long-winded, but I believe it is superior nonetheless. It looks something like this:
Err err = 0;

LocalID dbID = DmFindDatabase(0,"BugSquBugsDYTC");


gDB = NULL;


if (dbID > 0) gDB = DmOpenDatabase(0, dbID, dmModeReadWrite);

if (!gDB) 

{

 err = DmCreateDatabase(0, "BugSquBugsDYTC", 'DYTC', 'DATA', false);


   if (err == 0)

 {

  gDB = DmOpenDatabase(0, DmFindDatabase(0,"BugSquBugsDYTC"), dmModeReadWrite);
The first API call we make it is DmFindDatabase, which takes the card number and the database name and returns a LocalID, which I presume to be a 32-bit number, on the basis that when I first tried it by used a UInt16 and it did not work. This ID when it is returned can be passed to DmOpenDatabase, which takes the card number again,our LocalID, and the open mode required. If it fails, the return value is null and so we continue to create our database both in the distance where it cannot be found, and where it cannot be opened. Assuming the database is successfully created, we then open it. Note that we need to call find database again, as the value returned the first time was invalid, all we would have not reached this point.

Creating records

So at this point we have a database on a palm, and a handle to it. Quite obviously the next step is to create some data records with the database, in particular it is likely that our newly created database should have some default values within it. The sample application is called Bug Squasher. It was written as a learning exercise, and in theory is designed to be part of a bug tracking system, where the desktop system updates a list of applications which can have bug reports, and the Palm creates bug reports which can then be uploaded to the main system. The simpler of the two databases simply stores a list of names, which equate to projects for which we can report bugs. The two default values are 'misc' ( for bugs on systems not in the Palm ) and 'BugSqu' ( so we can report bugs on the bug tracking system itself ). The functions we will need to create a record and fill it with data are DmNewRecord, which takes three parameters ( the database to operate on, the index of the record to create, and a length for the record ), and DmStrCopy, which takes a Char * ( derived from our record handle, as we will see ), a start position, and another Char *, which we will copy. Note that I capitalise the word Char, this is a common way for PalmOS to create it's own types, a Char is the type used by Palm, as opposed to char. That they are the same thing is immaterial, Palm create their own types to ensure all types are the same size across platforms. The other functions we will use are MemHandleLock, which returns a void *, and which we call on our new database record, casting the result to a Char *. Finally, MemPtrNew is the Palm equivelant of malloc, and is used to create our string, StrCopy is the equivelant of strcpy and is used to place a value in our string, and MemPtrFree is used to free the string we created. Here is the code:
Collapse
UInt16 index = dmMaxRecordIndex;


MemHandle h = DmNewRecord(gDBProj, &index, 5);


if (!h)

    err = DmGetLastErr();

else 

{

    Char * s = (Char *) MemHandleLock(h);

    

    Char * pChar = (Char*)MemPtrNew(5 * sizeof(Char*));

    StrCopy(pChar, "Misc\0");

    DmStrCopy(s, 0, pChar);

MemPtrFree( pChar);

    MemHandleUnlock(h);    

}


index = dmMaxRecordIndex;


h = DmNewRecord(gDBProj, &index, 6);


if (!h)

    err = DmGetLastErr();

else 

{

 Char * s = (Char *) MemHandleLock(h);

    

    Char * pChar = (Char*)MemPtrNew(6 * sizeof(Char*));

    StrCopy(pChar, "BugSq\0");

    DmStrCopy(s, 0, pChar);

MemPtrFree( pChar);

    MemHandleUnlock(h);    

}
dmMaxRecordIndex is a Palm defined constant which causes our record to be created at the end of the database. Note we need to set it twice, as when we pass it into DmNewRecord, it is set to be the actual index of the created record. It's not shown here, but DmReleaseRecord should be called to release the record as soon as it is no longer needed.

Well, that was easy, wasn't it ? But because the databases are just an area of memory and offer no real facilities beyond locking a record in terms of accessing items within a record, what do we do when we want to store more complex data ? The answer is to create a struct that defines our datatype. For example, if we had a strict that looks like this:

typedef struct {

  DateType DateEntered;

  UInt8 nBugSeverity;

  UInt8 nBugType; 

} BugRecord;
then we could simply use sizeof to get the size of our struct, and make our new records that size, and then write them using the DmWrite API, which has this prototype - Err DmWrite (void *recordP, UInt32 offset, const void *srcP, UInt32 bytes), where the void * is a pointer to our record, the offset indicates how far into the record to start writing, srcP points to the data, and the UInt32 indicates the number of bytes to write. An example would be as follows:
Char *s;

UInt16 offset = 0;

s = (Char *) MemHandleLock(DBEntry);

DmWrite(s, 0, br, sizeof(BugRecord));

MemHandleUnlock(DBEntry);
I'm sure that many of you spotted a problem. This isn't the full bug record, it does not contain a string. If you have to store data which does not involve strings, or the strings are of a fixed size, then life is easy. However, as I often say, space on the Palm is at a premium, and so if we have strings in our data, we must take steps to ensure that each record takes up the smallest amount of space possible. In order to do this, we need to undergo a process commonly referred to as 'packing' our struct into a record. In order to do this we create two struts, one which contains Char *'s, and the other which simply contains Char arrays with a length of 1. Here are the real structs from the Bug Squasher demo application.
typedef struct {

  DateType DateEntered;

  UInt8 nBugSeverity;

  UInt8 nBugType;   

  char * szBugDesc;

} BugRecord;


typedef struct

{

  DateType DateEntered;

  UInt8 nBugSeverity;

  UInt8 nBugType;   

  char szBugDesc[1];

} PackedBugRecord;
In this case we only have one string, but the example holds for as many strings as you would like. Because the only way to find the value of the nth string is to unpack all n strings, you should always place the most important strings at the top of the string list, and all non string information before that. Storing variable length records causes us to need another function, which we will use within a helpful function we write, called PackBug. The API function is called MemHandleResize, and it takes a record and a new length and like most Palm functions returns an Err which is 0 if there were no problems. Here is our PackBug function.
void PackBug(BugRecord *br, MemHandle DBEntry)

{

 UInt16 length = 0;

 Char *s;

 UInt16 offset = 0;

 length = (UInt16) (sizeof(BugRecord) + StrLen(br->szBugDesc) + 1);


 if (MemHandleResize(DBEntry, length) == errNone)

 {

  s = (Char *) MemHandleLock(DBEntry);

  DmWrite(s, 0, br, sizeof(*br));

  DmStrCopy(s, OffsetOf(PackedBugRecord, szBugDesc), br->szBugDesc);

  MemHandleUnlock(DBEntry);

 }

}
As you can see, we calculate the length of the record by the size of the struct and the length of the string, plus one for the null terminator. Obviously if you are storing more than one string then will need to store enough space to null terminate them all. Note also that the Palm API provides a function called OffsetOf, which allows us to find the offset within a struct of the string in question. The C standard library contains similar constructed called offsetof, and once again the Palm API provides an alternative which is easy to remember, and simply capitalises the words of the standard function.

Naturally having packed our bug, we also need to unpack it. This is simply a matter of assigning the right value to the variables within the struct. Obviously, if we had more than one string, we would need to use StrLength to figure out the right position for the start of each string in order to assign them. In The code looks like this.

void UnpackBug(BugRecord *bug, const PackedBugRecord *pBug)

{

 bug->DateEntered = pBug->DateEntered; 

 bug->nBugSeverity = pBug->nBugSeverity;

 bug->nBugType = pBug->nBugType;

 bug->szBugDesc = pBug->szBugDesc;

}

Reading back our records

In this example I have used a GUI component which we have not yet discussed, namely a list. The list has been set to be ownerdrawn, and a callback has been set which will be passed the index of the item to draw. The details of this will be covered in a future article. Our strategy is to use the index passed into the overdrawn function to retrieve the appropriate record from our database and render it. This has the advantage of saving us from making a copy of our entire database, saving both space and processor time. There are two ways to search for a record, by index or by unique ID. The unique ID is not as exciting as it sounds, the search is still sequential and therefore has linear growth in complexity. It's far more common to search by index, but if you have the ID, the API is DmFindRecordByID, and it takes a database, a unique ID and a pointer which returns the index of the item. The DmQueryRecord function takes a database and a record number and returns a record handle or NULL to indicate failure. Here is the full code we use in our list callback to read a record.
Err err = 0;

MemHandle myRecord = DmQueryRecord(gDB, itemNum);


if (!myRecord)

    err = DmGetLastErr();

else 

{

    PackedBugRecord *prec = (PackedBugRecord *) MemHandleLock(myRecord);


 BugRecord * rec = (BugRecord*) MemPtrNew(sizeof(BugRecord));

 

 UnpackBug(rec, prec);
After using WinDrawChars to render our data, we call MemHandleFree to free our records. We do not need to free the record data, because it was never copied out of the database.

Deleting Records

Deleting records is easy, just use DmRemoveRecord(gDB, nIndex), where gDB is your handle to a database, and nIndex is the record to delete.

Some other stuff

Records have a 64k limit, there is a way to overcome this, but I am not familiar with it. Each record also has a record attributes area, which is one byte in size and contains a deleted bit, a secret bit, a dirty bit, a busy bit and a 4 bit category. Records when they are deleted are not necesarily removed from the Palm. DmRemoveRecord deletes them entirely, DmDeleteRecord deletes the record but keeps the header and sets the bit, and DmArchiveRecord does not delete the record, but sets the bit. The reason for these differences is syncronisation, another future topic, which basically involves moving data between a Palm and a desktop application. Deleted records are moved to the end of the database and are not visible, even if they are still there. They are typically always removed at the next syncronisation.

Databases also have their own header, where data like the name, creator, and type is stored, along with some application specific data. This is the place to store data you want to keep only once for the entire database. Additionally, databases can be sorted, through the provided DmInsertionSort and DmQuickSort functions, both of which use a function pointer to allow the programmer to specify the sort order. Insertion while maintaining sort is provided by the DmFindSortPosition API, inserting into an existing record index causes all records below that one to be moved down accordingly.

Although I am unable to comment beyond what the Palm API can tell you about these functions, they seem worthwhile, we have a database at work with 40,000 records and without some sort of binary search, the search times are somewhat untenable.

Google
 
PalmProgramming