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

Thursday, February 21, 2008

Navigation in palm

1. Creat a file .r and go to the Settings to map the extension r with
PalmRez
2. This file .r has the header that looks like :

#define hsNavFlags defaultStartStateValue = 0x00000000, \
objectFocusStartState = 0x00000001, \
appFocusStartState = 0x00000002

#define hsNavObjectFlags none = 0x0000, \
skip = 0x0001, \
forceInteraction = 0x0002, \
bigButton = 0x8000
type 'fnav' {
unsigned integer = 1; /* resource version */
unsigned integer = $$Countof(ObjectArray);
unsigned integer = 20; /* size of header */
unsigned integer = 8; /* size of list elements */
unsigned longint hsNavFlags; /* navigation flags */
unsigned integer; /* ID of initial focus object */
unsigned integer = 0; /* hint ID of jump to object */
unsigned integer = 0; /* hint ID of bottom left object */
fill word;

array ObjectArray {
unsigned integer; /* ID of object */
unsigned integer hsNavObjectFlags; /* object flags */
unsigned integer; /* ID of above object */
unsigned integer; /* ID of below object */
};
};

resource 'fnav' ( MainForm )
{
objectFocusStartState,
MainFileTestButton,
{
MainFileTestButton, 0, 0, MainInputTestButton,
MainInputTestButton, 0, MainFileTestButton, MainLoopTestButton,
MainLoopTestButton, 0, MainInputTestButton, MainStopButton,
MainStopButton, 0, MainLoopTestButton, 0
}
};

Tuesday, February 19, 2008

Changing the Application name in palm

There are several places you need to replace the word "starter" with "NewName":


1. It's not required, but you might want to rename starter.c as NewName.c. If you do that, then you will have to add NewName.c to your project. Highlight Source in the project window, then click menu items Project, then Add Files... to add NewName.c to your project. Then you should delete starter.c from the project by selecting it and pressing the delete key.


2. You should change all of the following settings for the starter project. Select Edit, then Starter Settings from the menu, then:
a) Under Target Name, change the name from "Starter" to "NewName".
b) Under 68K Target, change the file name from "Starter.tmp" to "NewName.tmp".
c) Under PalmRez Post Linker, change the output file from "Starter.prc" to "NewName.prc".
d) Also under PalmRezPostLinker, change the Mac Resource Files from "Starter.tmp" to "newName.tmp". This file name must be the same as thefile name in step b.
e) click the Save button to save the project settings.

3. Finally, you need to change the name the launcher uses for your app. To do this, open starter.rsrc from the project window. Change the Application Icon Name from "Starter" to "NewName". (You might also want to change the name of the resource file. If you are using windows, that is slightly painful because the file is stored in two parts: \Rsc\Starter.rsrc and \Rsc\Resource.frk\starter.rsrc. So you have to rename both files, then add NewName.rsrc to your project.

4. One other thing you might want to rename is the header file generated by constructor, StarterRsc.h. To do that, open Constructor, rename "StarterRsc.h" to "NewName.h", and save the resource. Then you have to open NewName.c (formerly Starter.c) and change the line '#include "StarterRsc.h"' to '#include "NewName.h"'.

5. And, You probably should rename Starter.mcp to NewName.mcp The easiest way to do that is with Windows explorer. Alternatively, you could select File, then Save a Copy As... from the CodeWarrior menu to save the project file with the new name. But then you'd have two copies and would still have to delete starter.mcp.



And to change the default apps bitmap ( Icon )

Open your resource file with Constructor, then highlight Icons, and press ctrl-K to create a new icon. Give it a name. Make sure its ID is 1000. Then double-click it to open the icon editor. Draw your picture, close the editor, save the resource file, and compile your project. You can also make color icons using Icon Families instead of Icons. See the knowledge base at palmos.com for more info...


Google
 
PalmProgramming