<%@ 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>

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



Google
 
PalmProgramming