www.astatech.com Products Asta PocketStudio Support





Asta Technology Group
Welcome to the world of wireless enabled web services
advanced search
ASTA in 60 seconds
ASTA in action
Developer details
Free Internet tools
Demos
Business views
White papers
Tutorial center
Testimonials
Asta online help
ASTA PocketStudio Support

Palm Side

The Complete ASTA Handheld Architecture is explained On Line at the ASTA SkyWire Site ASTA has released "ASTA Objects" for use with PocketStudio as part of the SmartClient toolkit. This "object" like wrapper provides developers an elegant way to create Wireless Enabled Palm Applications. Download an evaluation including full Tutorials and sample servers. Smart Client Toolkit includes not only Palm but PocketPC support also..

Files included Description Comment
AstaLib.prc Shared Library that contains the implementation of the ASTA Palm Library that must be loaded on the Palm or in POSE. Currently needs to reside in the directory of your PocketStudio Project.
AstaLib.pas PocketStudio interface library for AstaLib.prc. Currently needs to reside in the directory of your PocketStudio Project.
AstaStart.ppr Template ASTA client that shows how to connect to a server. Also shows how to save the Ipaddress and Port in the palm preferences.
PalmSQL.ppr PocketStudio sample project showing how to query a remote ASTA Server Shows how to use the AstaNestedParamList DataType that provides a string only Row/Column DataStructure similar to a TDataSet so that multiple rows can be fetched from a remote server.
AstaFileTest.ppr Sample application that can fetch a text file from the AstaSkyWireDebug Server Shows how to use blob calls with AstaParamLists and to write the text file to a palm memo.
AstaSkyWireServer An Asta SkyWire Debug Server that doesn't use a database and logs all messages from remote PDA clients. See the screen shot below of the debug server running. Allows the server to be secured so that username/passwords can v be defined and tested.

Download latest ASTA PocketStudio Evaluation.

Getting Started Tips

Make sure AstaLib.pas and AstaLib.prc are in the directory where your project is. Current versions of PocketStudio require a copy of AstaLib.prc and AstaLib.pas in the directory of any project using AstaLib.prc. In future versions of PocketStudio this will not be required.
Make sure that AstaLib.prc is loaded in POSE or on the Palm.  
Set POSE to be tcp/ip enabled. Right click on the Palm Emulator and then go to Settings/Properties and make sure that the checkbox Redirect NetLib calls to TCP/IP is checked.

Server Side

The TAstaPDAServerSocket, which descends from the TAstaServerSocket, provides support for Palm, WinCE and Linux PDA Clients. Below is a description of the additional events available for the TAstaPDAServerSocket.

There are several additional events coded on the AstaPDAServerSocket in order to support remote PDA Clients.

OnPdaParamList

This is the most important event as all the SendParamList calls from PDA clients will flow through this event. The MsgToken comes from the remote Client call and if there is any kind of Error on the server just send a non-zero value back in PdaSendParamList.

procedure TForm1.AstaServerSocket1PDAParamList(Sender: TObject;
ClientSocket: TCustomWinSocket; PDAid, MsgID, MsgToken: Integer;
P: TAstaParamList);
var
  Error:Integer;
begin
  Error:=0;
  case MsgToken of
    1001: Error:=DoPDAServerTime(ClientSocket, P);
    1003: Error:=DoPalmSQLSelect(ClientSocket, P);
    1004: Error:=DoPDATables(ClientSocket, P);
    1005: Error:=DoPalmExecSQL(Clientsocket,p);
    1006: Error:=DoPDAFields(ClientSocket, P);
    1010: Error:=DoPalmMultiSQLSelect(ClientSocket, P);
    1011: Error:=DoPDASelect(ClientSocket, P);
    1012: Error:=DoPalmExecSQLParamList(ClientSocket,p);
    else Error:=DoPDAServerTime(ClientSocket, P);
  end;
  AstaServerSocket1.PDASendParamList(Error, ClientSocket, P);
end;

Client Side Example

View screenshot of SkyWire Server

Below is a small code example of creating an AstaConnection and connecting to a remote Asta SkyWire server just to see if it is available. Note: the UserName and Password is being set.

Var
  Conversation : Pointer;
  OK : boolean;
  BoolRes : boolean;
begin
  OK := false;
  AstaConnCreate(RefLib, Conversation);
  AstaConnSetTimeout(RefLib,Conversation,1000);
  AstaConnSetAuthorizationOn(RefLib,Conversation,'Asta','Password',False);
  AstaConnOpen(RefLib, Conversation, Connection.IPAddr, Connection.Port, BoolRes);
  //try the server and see if it is available
  if BoolRes then
  begin
    AstaConnClose(RefLib, Conversation, BoolRes);
    Ok := true;
  end;
  . . .
end;

 

 

Last modified: 7/14/2003 9:43:44 AM
Copyright © 2001-2002 Asta Technology Group, Inc. Terms & Conditions     Privacy Policy     Site Map