×
Namespaces

Variants
Actions
Revision as of 05:16, 2 February 2012 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Adaptive History List API

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Code Example
Source file: Media:AhleUsage.zip
Compatibility
Platform(s):
FNWiki
Article
Created: ltomuta (16 Jun 2007)
Last edited: hamishwillee (02 Feb 2012)


Note.pngNote: :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

 

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×