Nov

16

New Hourglass application released!

By Diego Lopes

Hi All!

This is our new Hourglass! The application simulates a real hourglass with N95 acceleromenter, as the other Hourglass but with a better interface, performance and new themes.

some pics:



Authors: Diego Soares Lopes and Tiago Abreu Tavares de Sousa

Advisors: Kyller Gorgônio and Olympio Cipriano

Designer: GID (Graphical Interface Designer)

Download the application: NewHourglassApp

Sep

17

Error: the file ‘ wlancdbcols.h ‘ cannot be opened.

By rscorreia

Some WLAN libraries present in previous Symbian SDK, are missing in the latest SDKs.

To Fix this problem, follow these steps:

Download this package from forum Nokia:

*Note: You should have the register of forum Nokia.

http://www.forum.nokia.com/info/sw.nokia.com/id/53439e01-f605-4491-96f4-62d003bd4c0c/S60_3rd_SDK_MR_API_Plug-In_Pack1.zip.html

After downloading the file WLANSettingsUI.ZIP, open the folder : WLANSettingsUI -> Epoc32 -> include.

Copy the wlancdbcols.h to: “your SDK folder” -> Epoc32 -> include.

Re-build your Project !!!

Sep

17

TouchScreen Position Capture

By rscorreia

First, you need Carbide.C++ and Symbian 5th Edition SDK installed.

* If you don’t handle with exact position, the super-class CCoeControl provides a handler of touch screen events.

When you create a new project, on AppView class, carbide fills the method HandlePointerEventL with a super-class call: CCoeControl::HandlePointerEventL(aPointerEvent); .

If you want to create a new Handler of touch screen events you must override HandlePointerEventL.

// Carbide generated method

void CTouchExempleAppView::HandlePointerEventL(
        const TPointerEvent& aPointerEvent)
    {
    
    // Call base class HandlePointerEventL()
    CCoeControl::HandlePointerEventL(aPointerEvent);
    }

In the AppView.h add a private TPoint

private:
    
    TPoint iTouchedPoint;

In the HandlePointerEventL we add a manual capture of pointer touched, and update iTouchPoint TPoint


void CTouchExempleAppView::HandlePointerEventL(
        const TPointerEvent& aPointerEvent)
    {
    iTouchedPoint = aPointerEvent.iPosition;
    DrawNow();
    
    // Call base class HandlePointerEventL()
    CCoeControl::HandlePointerEventL(aPointerEvent);
    }

Then, we print on the screen the position upgrading the Draw method:

void CTouchExempleAppView::Draw(const TRect& /*aRect*/) const
{
// Get the standard graphics context
CWindowGc& gc = SystemGc();
// Gets the control's extent
TRect drawRect(Rect());
// Clears the screen
gc.Clear(drawRect);
//Take a Font
gc.UseFont(CEikonEnv::Static()->TitleFont());
//Set Text Color
gc.SetPenColor(KRgbBlack);
TBuf<255> bufferX;
TBuf<255> bufferY;
_LIT(KXPos, "X: %d");
_LIT(KYPos, "Y: %d");
bufferX.Format(KXPos, iTouchedPoint.iX);
bufferY.Format(KYPos, iTouchedPoint.iY);
//Draw text on screen
gc.DrawText(bufferX, TPoint(30,30));
gc.DrawText(bufferY, TPoint(30,70));
gc.DiscardFont();
}

Then the application running:

The .sisx file for download

If you want to FullScreen Application, write SetExtentToWholeScreen(); in ConstructL. But, when using full screen app, The Options menu are not visible, include the exit option.

To fix this problem, you can use the Log Tap Detector to close window and exit the application.

First, in AppView.h, insert the include:

#include <aknlongtapdetector.h>

and in the class declaration, extends from CAknLongTapDetectorCallBack too:

// CLASS DECLARATION
class CTouchExempleAppView : public CCoeControl, public MAknLongTapDetectorCallBack
{

Add private attribute

CAknLongTapDetector* iLongTapDetector;

and private method declaration:

void HandleLongTapEventL( const TPoint& aPenEventLocation,
const TPoint& aPenEventScreenLocation );

in AppView.cpp, at ConstructL add:

iLongTapDetector = CAknLongTapDetector::NewL(this);

and in the HandlePointerEventL method, add:

iLongTapDetector->PointerEventL(aPointerEvent);

at last, add a long tap handler method:

// this method runs when the long tap is pressed.

void CTouchExempleAppView::HandleLongTapEventL( const TPoint&
aPenEventLocation, const TPoint& aPenEventScreenLocation )
{
//Close the fullscreen windos
CloseWindow();

}

Runnig:

File to Download

Sep

17

ProfileEnginee (Beta)

By Ruy Nóbrega

What is?

This application enables the user to control the changes of the profiles easier. The user can configure the application to change from a profile to another in a certain delay time or in a certain GPS location as the user wishes.

Why should I use it?

If you’re at a meeting you don’t want you cell ringing on the room but also, you don’t want it in silent after the meeting. Forgot to change profile after the meeting? This application helps you with this.
If, at work, you want your profile always in Silent but, at home, in General, this application do it for you.

This is a BETA version! In this version some functions are not available. Also the graphics has not been finished.

To use the delay time mode:

- Click on “Options > Timer Mode” to set the delay time as active mode
- Click on “Options > Set Time” and type the delay (in minutes)
- Click on “Options > Set Profile” and type the number of the profile (0 = General, 1 = Silent, etc.)
- Clicl on “Options > Activate” and done! When delay time is over, your profile will change to the profile that you selected!

To use the GPS mode:

- Fisrt of all, if this is the first time you’re using this mode, you’ll need to create a spot. This spot is the place where you want to change the profile (i.e. if you’re at work and you want the cell phone on silent mode always when you there, you add a spot when you’re there)
- Click on “Options > GPS Mode” to set the GPS mode as active mode
- Click on “Options > Add Spot” and set the radius and the deafult profile in that place. The radius is the range os the spot, in meters.
- Click on “Options > Activate” and done! You can add more spots in another places as you wish

Note: Once added a spot, you don’t have to add again when reopen the application. The edit/delete functions of spots are not implemented yet.

Note: Don’t close the application! Just minimize it.

Download: ProfileEnginee

Help us to improve this application. Give your comments.

May

11

C++ Bluetooth API for Symbian OS

By Diego Lopes

C++ Bluetooth API for Symbian OS

Hello fellows,

The importance of this API remains on the fact that Qt extensions for S60 doesn’t provide any API to access Bluetooth feature of the devices. The C++ Bluetooth API tries to fill this gap.

Bluetooth API provides an easy access of the bluetooth available resources on Symbian OS devices, it requires no Symbian/C++ knowleadge. Qt and OpenC/C++ programmers can use bluetooth communication easily on their projects.

NOTE: This is the first version of the API. It may change with your contribution. So, if you have any comments about the API, please let us know.

The C++ Bluetooth API.rar package contains some files that you’ll need to use BluetoothAPI:

  • Binaries generated (dll and dso files)
  • BluetoothAPI source code
  • Example
  • Doxygen with API documentation

If you need more info about BluetoothAPI go to doc folder in BluetoothAPI.rar and read “release-notes.txt”.

The following snippet shows how to use BluetoothAPI.h in your source code to connect as Client:

 //BluetoothAPI header
#include "Bluetooth.h"
 
class ExampleClient: public BluetoothAPIListener
  {
	public:
 
	/**
	 * C++ default constructor
	 */
	ExampleClient();
 
	/**
         * Example virtual destructor
	 */
	virtual ~ExampleClient();
 
	/**
	 * callback functions for receiving data events,
         * Inherited from BluetoothAPIListener interface
         */
	void devicesDiscoverFinished( vector&amp; discoveredDeviceList );
        void servicesDiscoverFinished( vector&amp; discoveredDeviceList );
	void serverConnected();
	void serverDisconnected();
	void clientConnected();
	void clientDisconnected();
	void messageReceived( char * message);
	void messageSent();
	void errorOcurred(int err);
 
	private: //ATRIBUTES
 
        BluetoothAPI *bluetooth; //Provides access to BluetoothAPI methods
	vector deviceList; // vector with to save the discovered devices
	vector serviceList; // vector with to save the devices with the service
 
};
//CPP FILE
 
//Example header file
#include "ExampleClient.h" 
 
ExampleClient::ExampleClient()
{
 	bluetooth = BluetoothAPI::create(this);
        bluetooth-&gt;searchServices(KBTServiceUUID);
}
 
void ExampleClient::servicesDiscoverFinished( vector&amp; discoveredDeviceList )
{
	//...
       if (discoveredDeviceList.capacity() &gt; 1) // if there's just one device with the desired service it
							   //connects automaticaly
      		bluetooth-&gt;connectToServer(discoveredDeviceList[1]); // connect with the 2th device on
											  //the vector
	//...
}
 
void ExampleClient::clientConnected()
{
	bluetooth-&gt;sendMessage("Hello World"); // Client must send the first message
}
 
void ExampleClient::messageReceived( char * message)
{
	//...
        bluetooth-&gt;sendMessage("Symbian Effort");
	//...
}
 
ExampleClient::~ExampleClient()
{
      if ( bluetooth )
	{
		delete bluetooth; //delete bluetooth pointer
		bluetooth = NULL;
	}
}
//In .pkg file
"$(EPOCROOT)Epoc32\release\$(PLATFORM)\$(TARGET)\BluetoothAPI.dll"
- "!:\sys\bin\BluetoothAPI.dll"
//In .mmp file
LIBRARY		   BluetoothAPI.lib
CAPABILITY	  	  ReadUserData LocalServices

The following snippet shows how to use BluetoothAPI.h in your source code to connect as Server:

 //BluetoothAPI header
#include "Bluetooth.h"
 
class ExampleServer: public BluetoothAPIListener
  {
	public:
 
	/**
	 * C++ default constructor
	 */
	ExampleServer();
 
	/**
         * Example virtual destructor
	 */
	virtual ~ExampleServer();
 
	/**
	 * function that must be invoked before when closing the application, but before the destructor
         */
	void functionBeforeDestructor();
 
	/**
	 * callback functions for receiving data events,
         * Inherited from BluetoothAPIListener interface
         */
	void devicesDiscoverFinished( vector&amp; discoveredDeviceList );
        void servicesDiscoverFinished( vector&amp; discoveredDeviceList );
	void serverConnected();
	void serverDisconnected();
	void clientConnected();
	void clientDisconnected();
	void messageReceived( char * message);
	void messageSent();
	void errorOcurred(int err);
 
	private: //ATRIBUTES
 
        BluetoothAPI *bluetooth; //Provides access to BluetoothAPI methods 
 
};
//CPP FILE
 
//Example header file
#include "ExampleServer.h" 
 
ExampleServer::ExampleServer()
{
 	bluetooth = BluetoothAPI::create(this);
        bluetooth-&gt;startAdvertising(KBTServiceUUID, "BTExample");
}
 
void ExampleServer::serverConnected()
{
	// don't send messages, the first message must be sent by the client
}
 
void ExampleServer::messageReceived( char * message)
{
	//...
        bluetooth-&gt;sendMessage("Symbian Effort");
	//...
}
 
void ExampleServer::functionBeforeDestructor(){
	bluetooth-&gt;stopServerAndAdvertising(); //This function must be called always that a service is 										//advertised, or the device can continue advertise
								//after the application is closed.
								//It may be called before the application is destroyed, 									//so: DON'T CALL IT IN DESTRUCTOR!!!
}
 
ExampleServer::~ExampleServer()
{
      if ( bluetooth )
	{
		delete bluetooth; //delete bluetooth pointer
		bluetooth = NULL;
	}
}
//In .pkg file
"$(EPOCROOT)Epoc32\release\$(PLATFORM)\$(TARGET)\BluetoothAPI.dll"
- "!:\sys\bin\BluetoothAPI.dll"
//In .mmp file
LIBRARY		   BluetoothAPI.lib
CAPABILITY	  	  ReadUserData LocalServices

Any doubts? Please leave a comment. We hope you enjoy it!

Feb

12

SMSBasic

By Ruy Nóbrega

SMSBasic

SMSBasic has an useful and easy interface for those who want to handle messages(sms). It provides to the C/C++ programmer functions to handle the basic events from the Message Server without any knowledge about Symbian components.

The SMSBasic.rar package contains some files that you’ll need to use SystemAPI:

  • Binaries generated (dll and dso files)
  • SMSBasic source code
  • Example
  • Doxygen with API documentation

See release-notes.txt for more information.

SMSBasic works with events that happen on the Symbian Message Server and, when one of those events occurs, a function of the observer is called. All you have to do is edit the observer like the code below.

For the observer, create a class derivate from SMSObserver:

class MyObserver : public SMSObserver
{
   public:
      /* class methods */
   public:
      /* Observer implementation */
      void onMessageReceived(const char* message, const char* sender);
      void onClose();
      void onError();
};

Now, for it works, create a pointer SmsEngine object and an observer in the project:

SMSEngine* engine;
MyObserver* obs;

And on a constructor function, initialize them:

obs = new MyObserver;
engine = SMSEngine::Create();
engine-&gt;setObserver( obs );

And now the message server is running!

Enjoy it.

Jan

5

SystemAPI

By Diego Lopes

System API

SystemAPI provides easy access to informations about battery’s level and signal’s strength on Symbian OS devices, without Symbian/C++ coding conventions knowledge. Qt and OpenC/C++ programmers can benefit from this API to get easy access to battery’s and signal’s status and level on their projects. Contributions are welcome.

The SystemAPI.rar package contains some files that you’ll need to use SystemAPI:

  • Binaries generated (dll and dso files)
  • SystemAPI source code
  • Example
  • Doxygen with API documentation

If you need more info about SystemAPI go to doc folder in SystemAPI.rar and read “release-notes.txt”.

The following snippet shows how to use SystemAPI.h in your source code:

 //SystemAPI header
#include "SystemAPI.h"
 
class Example: public SystemAPIObserver
  {
	public:
 
	/**
	 * C++ default constructor
	 */
	Example();
 
	/**
         * Example virtual destructor
	 */
	virtual ~Example();
 
	/**
	 * callback functions for receiving data events,
         * Inherited from SystemAPIObserver interface
         */
	void batteryLevelCheck(BatteryInfo battery, int err) ;
        void signalStatusCheck( SignalInfo signal, int err ); 
 
	private: //ATRIBUTES
 
        SystemAPI*  system; //Provide access to SystemAPI methods 
	BatteryInfo battery; //struct with battery info
	SignalInfo signal;   // struct with signal info
 
 
};
//CPP FILE
 
//Example header file
#include "Example.h" 
 
Example::Example()
{
 	system = SystemAPI::create();
 
	system->notifyBatteryChange(this);
	system->notifySignalChange(this);
}
 
Example::~Example()
{
 
      if(system)
         {
               delete system; //delete system pointer
               system = NULL;
         }
}
//In .pkg file
"$(EPOCROOT)Epoc32\release\$(PLATFORM)\$(TARGET)\SystemAPI.dll"
-"!:\sys\bin\SystemAPI.dll"
//In .mmp file
LIBRARY		   SystemAPI.lib

Any doubts? Please leave a comment. We hope you enjoy it!

Dec

3

LocationAPI

By joaor

Location API

The Location C++ API is another effort to get ride of Symbian/C++ coding conventions knowledge. It provides easy access to Location information on Symbian OS devices. Qt and OpenC/C++ programmers can benefit from this API to create LBS enabled applications. Of course this is only the first step. Contributions are welcome.

The Location.rar package contains some files that you’ll need to use Location Api:

  • Binaries generated (dll and dso files)
  • Location API source code
  • Example
  • Doxygen with API documentation

If you need more info about Location API go to doc folder in Location.zip and read “release-notes.txt”.

The following snippet shows how to use Location.h in your source code:

 //Location header
#include &lt;LocationIntf.h&gt;
 
class Example: public PositionListener
  {
  public:
	/**
	 * C++ default constructor
	 */
	Example();
 
	/**
         * Example virtual destructor
	 */
	virtual ~Example();
 
	/**
	 * Callback function for receiving data events
         * Inherited from PositionListener interface
         */
	void receivePos( PositionData ); 
 
  private: //ATRIBUTES
        Position *iPosis;
        Location *iPositioner;
};
//CPP FILE
 
//Example header file
#include "Example.h" 
 
Example::Example()
{
     iPositioner = Location::create();
     iPositioner-&gt;start( this );
}
 
Example::~Example()
{
     if ( iPositioner )
     {
        iPositioner-&gt;stop();
	delete iPositioner;
	iPositioner = NULL;
     }
}
 
void Example::receivePos( PositionData )
{
     //do sth with GPS data
}
//In .pkg file
  "$(EPOCROOT)Epoc32\release\$(PLATFORM)\$(TARGET)\Location.dll"
-"!:\sys\bin\Location.dll"
//In .mmp file
LIBRARY		   Location.lib

If you have any doubts leave a comment or send an e-mail to olympio[hairy a]embedded.ufcg.edu.br.

Nov

12

AccelerometerApi

By Diego Lopes

What is it?

An C++ API that provides easy access to Acceleromenter Sensor of Symbian OS devices. It requires no knowleadge of Symbian/C++ coding conventions. Qt and OpenC/C++ programmers can benefit from this API to get easy access to accelerometer’s device on their projects.

The Accelerometer.rar package contains some files that you’ll need to use AccelerometerApi:

  • Binaries generated from AccelerometerApi
  • AccelerometerApi source code
  • Doxygen with API documentarion

If you need more info about AccelerometerApi go to doc folder in Accelerometer.zip and read “release-notes.txt”.

The following snippet shows how to use AccelerometerApi.h in your source code:

 //AccelerometerApi header
#include "AccelerometerApiIntf.h"
 
class Example: public AccelerometerObserver
  {
	public:
 
	/**
	 * C++ default constructor
	 */
	Example();
 
	/**
         * Example virtual destructor
	 */
	virtual ~Example();
 
	/**
	 * callback function for receiving data events,
         * Inherited from AccelerometerObserver interface
         */
	void accelInfoUpdater(AccelerationInfo aAcelInfo,
                              SensorInfo aSensorInfo);
 
	private: //ATRIBUTES
 
        AccelerometerApi* iSensorApi;  //AccelerometerApi pointer thats provide
                                       //an access to Accelerometer
 
};
//CPP FILE
 
//Example header file
#include "Example.h" 
 
Example::Example()
{
     	vector sensorInfoArray;
 
        /**
         * static function that find the availble sensors in device
         */
	AccelerometerApi::findSensors(sensorInfoArray);
 
   //Test if exist an available sensor in sensorInfoArray
	if(sensorInfoArray.size()  &gt;  0)
		{
                 //Creating iSensorApi with one sensor from sensorInfoArray
		     iSensorApi-&gt;create(sensorInfoArray[1]);
                 //Using setDataObserver to register a newObserver
                 //that colect data from sensors.
		     iSensorApi-&gt;setDataObserver(this);
		}
 
}
 
Example::~Example()
{
 
      if(iSensorApi)
         {
               delete iSensorApi; //delete iSensorApi pointer
               iSensorApi = NULL;
         }
}
//In .pkg file
"$(EPOCROOT)Epoc32\release\$(PLATFORM)\$(TARGET)\AccelerometerApi.dll"
-"!:\sys\bin\AccelerometerApi.dll"
//In .mmp file
LIBRARY		   AccelerometerApi.lib

If you have any doubts please leave a comment. We hope you enjoy it!

Aug

27

HourGlass for N95

By Diego Lopes

Hourglass application released!

The application simulates a real hourglass with N95 acceleromenter. You can use it with board games or just to count regressively a particular time.

Some pics:

Authors: Diego Soares Lopes and Tiago Abreu Tavares de Sousa

Advisors: Kyller Gorgônio and Olympio Cipriano

Designer: Isabelle Gurgel

Here you can see the application running: Demo video

Download the application: HourGlass