You Are Here:

Community: Wiki


Adaptive History List API

From Forum Nokia Wiki

Reviewer Approved   
Note!
This API is not part of the public SDK. It can be found in the SDK API Plug-in.


API Purpose

Adaptive History List API can be used to keep track of the browser activity. One can retrieve the name as well as the URL of the recently visited sites.

Use cases

  1. To retrieve the URL address and the name of the websites visted using the browser.These contents will be written into a file named "History.txt"
  2. To clear the cache which contains the details like the URL address.


Example code

One can get to know of the recently visited links by following the steps mentioned below.

Header Files:

#include <AhleClientObserver.h> 
#include <Ahle.h>

Link against:

LIBRARY    AhleClient.lib

Capabilities Required:

CAPABILITY    ReadUserData WriteUserData



1) Derive your class from MAHLEClientObserver.

2) Create a CAhle object preferably in the constructL

iAhle  = CAHLE::NewL();
iAhle->SetObserverL(this);

3) Implement AdaptiveListChangedL( ) method. It is a pure virtual method defined in MAHLEClientObserver.

void AdaptiveListChanged(TInt aError)
{
TRAPD(err,DoAdaptiveListChangedL())
if(err)
{
//handle error here
}
}
void DoAdaptiveListChangedL()
{
RFs myFileSession;
RFile myFileObject;
 
CDesC16ArrayFlat* itemsArray = new(ELeave) CDesC16ArrayFlat(8);
CDesC16ArrayFlat* itemsNameArray = new(ELeave) CDesC16ArrayFlat(8);
 
CleanupStack::PushL(itemsArray);
CleanupStack::PushL(itemsNameArray);
 
CleanupClosePushL(myFileSession);
CleanupClosePushL(myFileObject);
 
myFileSession.Connect();
 
myFileObject.Replace(myFileSession,_L("C:\\History.txt"),EFileWrite);
 
TRAPD(err,iAhle->AdaptiveListL(*itemsArray,*itemsNameArray,TUint(100),
_L(""),EAHLEAdaptiveSiteDetails));
 
TBuf8<500> tempBuffer;
//writes the recently visited links to a buffer
for(TInt i=0;i<itemsNameArray->Count();i++)
{
tempBuffer.Append(itemsNameArray->MdcaPoint(i));
tempBuffer.Append(_L8("-"));
tempBuffer.Append(itemsArray->MdcaPoint(i));
tempBuffer.Append(_L8("\n"));
}
//logs the contents of the buffer into a file
myFileObject.Write(tempBuffer);
 
tempBuffer.Zero();
CleanupStack::PopAndDestroy(4);
}

4) To clear the cache which contains the browser activity details.

void ClearAdaptiveList()
{
TInt retval;
retval=iAhle->Clear();
 
if(retval)
{
//handle error here
}
 
}

Example Application

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fFileE3aMicrokernelE5fArchitectureE2eGIFX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ