download the sdk that is for your version of palm os at the palm dev site.


Please note that the INetlib is only available to palm os's that have the
"Wireless Internet Feature Set" as noted in the palm api reference.  that
means only the VII, VIIx and i705 can use the INet Library.

Otherwise you need to use the net library.



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Yogaramanan
Sent: Wednesday, May 22, 2002 2:09 AM
To: Palm Developer Forum
Subject: INetLib......?.......mo questions


Thanks Colleen Dong for ur answer!

I'm using CodeWarrior 6.
b coz of that i had some errors.
i solved several but excecpt one, that is "undefined identifier
'sysFileCClipper' "
it isn't defined in any of the header files (in CW 6)

INetLow sample works (just works , not getting any pages) in palm 505.
My question is
1) how can get a page in palm m105 or IIIx with the palm os higher than 3.5
version ?
   palm documents says, palm with more than 128kb and OS 3.5 INetLib will be
possible.

2) if INetLib isn't possible then how can i connect to the web and get a
page using palm 105 or IIIx models ?

Pls can any one help me ?

by
yogaramanan

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Colleen
Dong
Sent: Wednesday, May 22, 2002 12:02 PM
To: Palm Developer Forum
Subject: RE: INetLib.............?


I strongly recommend that you get the palm web applications written by ben
combee et al.

other wise here is the code that you will need in order to capture a web
site

hope this helps

colleen

#define SERVER_URL "http://www.palm.com/webbrowser/";
static Err CacheURL()
{
    MemHandle   inetHan, inetSockH;
        Char            *responsePtr;
        UInt32 value=0;
        INetURLInfoType inetinfo;
    UInt16 AppINetRefnum=0,cfgIndex;
        UInt32          totalBytes, bytesRead, reqestedBytes=0, offset = 0;
  UInt32        downloadSize = MAX_RESPONSE_SIZE;
  UInt32        algorithm = ctpConvNone; /* no conversion */
   DmSearchStateType searchState;
   UInt16 cardNo;
   LocalID dbID;
   Err error;
   DmOpenRef localRef;
   INetConfigNameType cfgName  = { inetCfgNameCTPDefault };


        error = DmGetNextDatabaseByTypeCreator(true,&searchState,
                sysFileTApplication,sysFileCClipper, true,
                &cardNo, &dbID);

        if (error)
        {
                return error;
        }
                localRef =
DmOpenDatabaseByTypeCreator(sysFileTApplication,sysFileCClipper,
dmModeWrite);
                if (!localRef)
                        return DmGetLastErr();
                /* allocate memory to hold the file retrieved */
                responsePtr = MemPtrNew(MAX_RESPONSE_SIZE);
                if (error)
                        return false;

                /* choose whether to use wireline connection or wireless */
                error = INetLibConfigIndexFromName(AppINetRefnum, &cfgName,
                                        &cfgIndex);
                if (error)
                        return false;

        /* open the library */
                error = INetLibOpen(AppINetRefnum, cfgIndex, 0,localRef ,  
reqestedBytes,
&inetHan);
                if (error)
                        return false;
                /* Set the default settings for buffer size and conversion
                 * algorithm to be used */
            error = INetLibSettingSet(AppINetRefnum, inetHan,
                        inetSettingMaxRspSize, (UInt8*)&downloadSize,
                        sizeof(downloadSize));
                if (error) return false;
                error = INetLibSettingSet(AppINetRefnum, inetHan,
                                inetSettingConvAlgorithm, (UInt8*)&algorithm,
                sizeof(algorithm));
                if (error) return false;
                error = INetLibSettingSet(AppINetRefnum, inetHan,
                                inetSettingCacheSize, (UInt8*)&algorithm,
                sizeof(algorithm));
                if (error) return false;

                /* start the fetch of URL. This command merely "starts" the
                 * the communication, you should read the result explicitly
                 * from the socket by making another call.
                 */
                error = INetLibURLOpen(AppINetRefnum, inetHan,
                                        (UInt8 *)SERVER_URL,(UInt8 *)SERVER_URL, 
&inetSockH,
                                        evtWaitForever, inetOpenURLFlagKeepInCache);
                if (error) return false;


                reqestedBytes = 4096;
                totalBytes = bytesRead = 0;
                do
                {
                        /* read something from the socket - blocking call */
                error = INetLibSockRead(AppINetRefnum, inetSockH,
                                                responsePtr + totalBytes,
                                                reqestedBytes - totalBytes,
                                                &bytesRead, 20 * SysTicksPerSecond());

                        /* update our pointers for the next write */
                        offset += bytesRead;
                        totalBytes += bytesRead;

        } while (
                                        (bytesRead != 0) && /* until the peer is done 
*/
                                        !error &&                       /* or until 
the first error */
                                        /* or we downloaded     too much already */
                                        (totalBytes < MAX_RESPONSE_SIZE)
                                );

                if (totalBytes > 0) /* got something? */
                {
                        responsePtr[totalBytes] = 0;
//                      FrmCustomAlert(ServerResponse, responsePtr, NULL, NULL);
                }
                else
//                      FrmCustomAlert(ConnectionError, "No response from server", 
NULL, NULL);
                /* final cleanup code */
                error = INetLibURLGetInfo (AppINetRefnum,inetHan, /*(UInt8 
*)responsePtr
*/ (UInt8 *)SERVER_URL ,&inetinfo);
                if (error) return false;
                MemPtrFree(responsePtr);
                error = DmCloseDatabase (localRef);
                if (error) return false;
                INetLibSockClose(AppINetRefnum, inetSockH);
                INetLibClose(AppINetRefnum, inetHan);

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Yogaramanan
Sent: Tuesday, May 21, 2002 10:39 PM
To: Palm Developer Forum
Subject: INetLib.............?


Is it possible to connect to internet through palm which can be earlier than
m505 ? if so how ?

I need to connect to internet and just get the html page in string format.
it is not intended to display the page to the user.
how to do and what are the requirements for this ? pls help !
can any body provide a little source code demonstrating this ?
thanks in advance.

by
yogaramanan


--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/


--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/


--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to