×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Aug 2010
    Posts
    20

    Need help inorder to save the data to my cell phone"N97" from Phonecompass applicatio

    Hello All

    I need some help from you guys. I found one application on wiki that is for the magnetometer/compass and application is tested in Nokia N97 successfully "http://wiki.forum.nokia.com/index.php/How_to_turn_the_N97_into_a_Magnetic_Compass". full source code is available and the program is written in C++

    I installed this application on my N97 and working fine. But the additional output that I want from the application is to store that displayed data in my cellphone, so latter I can see those values after stopping the application.

    The values application is displaying on its Application User interface are angle, accuracy. I want to save these values.

    Please share your ideas and give me some suggestions about how to proceed with my question
    Last edited by abdul_qudoos2003; 2010-11-10 at 11:05.

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: Need help inorder to save the data to my cell phone"N97" from Phonecompass applic

    Check where you get the values from, and then just implement a file saving functionality there. Basically the actual method would be depending on how you would want to save the data. You could for exmaple use RFile for making simple plain text files, or you could use for example RDbNamedDatabase for storing the data into the database..

    Anyway, how are you planning to use the data later on ?

  3. #3
    Registered User
    Join Date
    Aug 2010
    Posts
    20

    Re: Need help inorder to save the data to my cell phone"N97" from Phonecompass applic

    Quote Originally Posted by symbianyucca View Post
    Check where you get the values from, and then just implement a file saving functionality there. Basically the actual method would be depending on how you would want to save the data. You could for exmaple use RFile for making simple plain text files, or you could use for example RDbNamedDatabase for storing the data into the database..

    Anyway, how are you planning to use the data later on ?
    Hello

    Yes the data is coming from the magnetometer sensor of the cellphoneand the displayed at the application user interface that data is "angle and accurace" and I want to use the simple plain text file for storing data. Can you please give me more idea about the "RFile method" so that I can proceed with my problem.

    By the way I want to anyalyse from the stored data that in which direction I moved and later on I can interpret that data on graphical represnetation for further analysis.
    Regards
    Abdul

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: Need help inorder to save the data to my cell phone"N97" from Phonecompass applic


  5. #5
    Registered User
    Join Date
    Aug 2010
    Posts
    20

    Re: Need help inorder to save the data to my cell phone"N97" from Phonecompass applic

    hello

    can you guide me in detail, I read the article as far as I understand this article is working for both reading and writing "am I correct".

    If yes then, I have to write the data only in Nokia N97 buffer. Below is the code for Phone COmpas "can you give me hint where to edit this program in order to save the displayed data". I will b vey much thankful to you.


    /*
    * sensorchecking.cpp
    *
    * Created on: Nov 9, 2009
    * Author: mrahman
    */

    #include "sensorchecking.h"




    CSensorchecking* CSensorchecking::NewL( MMagneticSensrDataReceiver & aAppView )
    {

    CSensorchecking* self = new ( ELeave ) CSensorchecking( aAppView );
    CleanupStack::PushL(self);
    self->ConstructL();
    CleanupStack::Pop(self);
    return self;
    }

    void CSensorchecking::ConstructL()
    {

    CSensrvChannelFinder* ChannelFinder = CSensrvChannelFinder::NewL();

    CleanupStack::PushL(ChannelFinder);
    //List of found channels.
    RSensrvChannelInfoList ChannelInfoList;
    TSensrvChannelInfo ChannelInfo;

    ChannelInfo.iChannelType = KSensrvChannelTypeIdMagneticNorthData;
    ChannelFinder->FindChannelsL( ChannelInfoList, ChannelInfo );

    for(TInt i = 0; i< ChannelInfoList.Count(); i++)
    {
    ChannelInfo = ChannelInfoList[i];
    if(ChannelInfo.iChannelType == KSensrvChannelTypeIdMagneticNorthData)
    {
    iMagneticNorthSensor = CSensrvChannel::NewL( ChannelInfoList[ i ] );
    iMagneticNorthSensor->OpenChannelL();
    iMagneticNorthSensor->StartDataListeningL( this,1,1,0 );
    }

    }

    CleanupStack::Pop(ChannelFinder);
    delete ChannelFinder;
    ChannelFinder = NULL;

    }

    // -----------------------------------------------------------------------------
    // CSensorchecking::CSensorchecking()
    // C++ default constructor can NOT contain any code, that might leave.
    // -----------------------------------------------------------------------------
    //
    CSensorchecking::CSensorchecking( MMagneticSensrDataReceiver & aAppView )
    : iDataObserver( aAppView )
    {

    iMagnetometerCalibrationLevel = 0;
    iMagnetometerAngleFromNorth = 0;
    // No implementation required
    }

    // -----------------------------------------------------------------------------
    // CSensorchecking::~CSensorchecking()
    // Destructor.
    // -----------------------------------------------------------------------------
    //
    CSensorchecking::~CSensorchecking()
    {

    if( iMagneticNorthSensor )
    {
    iMagneticNorthSensor->StopDataListening();
    iMagneticNorthSensor->CloseChannel();
    delete iMagneticNorthSensor;
    iMagneticNorthSensor = NULL;
    }



    }

    // -----------------------------------------------------------------------------
    // CSensorchecking:ataReceived
    // New data is available in the receiving buffer.
    // -----------------------------------------------------------------------------
    //
    void CSensorchecking:ataReceived( CSensrvChannel& aChannel,
    TInt /*aCount*/,
    TInt /*aDataLost*/ )
    {

    TSensrvChannelInfo Channelinfo = aChannel.GetChannelInfo();
    if (Channelinfo.iChannelType == KSensrvChannelTypeIdMagneticNorthData)
    {
    //TSensrvMagnetometerAxisData
    TSensrvMagneticNorthData magNorthData;
    TPckg<TSensrvMagneticNorthData> magNorthPackage(magNorthData);
    aChannel.GetData(magNorthPackage);
    iMagnetometerAngleFromNorth = magNorthData.iAngleFromMagneticNorth;
    TSensrvProperty calibration;
    aChannel.GetPropertyL(KSensrvPropCalibrationLevel,0,calibration);
    calibration.GetValue(iMagnetometerCalibrationLevel);
    if(iMagnetometerCalibrationLevel > 0)
    {
    TRAPD(err, iDataObserver.AngleAndAccuracyReceivedL(iMagnetometerAngleFromNorth, iMagnetometerCalibrationLevel));
    }
    }

    }


    // -----------------------------------------------------------------------------
    // CSensorchecking:ataReceived
    // Data listening failed.
    // -----------------------------------------------------------------------------
    //
    void CSensorchecking:ataError( CSensrvChannel& /*aChannel*/,
    TSensrvErrorSeverity /*aError*/ )
    {

    }

    // -----------------------------------------------------------------------------
    // CSensorchecking::GetDataListenerInterfaceL
    // Get supported interface.
    // -----------------------------------------------------------------------------
    //
    void CSensorchecking::GetDataListenerInterfaceL(
    TUid /*aInterfaceUid*/, TAny*& aInterface )
    {

    // Set interface as NULL to indicate only default interface currently supported.
    // If new interface(s) is being introduced and application wants to support that
    // aInterfaceUid must be checked and aInterface set accordingly.
    aInterface = NULL;
    }

  6. #6
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: Need help inorder to save the data to my cell phone"N97" from Phonecompass applic

    I suppose the function AngleAndAccuracyReceivedL gets the data as it comes in. And yes the wiki example appears to have both reading & writing parts.

  7. #7
    Registered User
    Join Date
    Aug 2010
    Posts
    20

    please guide me throughout the process

    Hi all

    Actually I am using Phone compass "http://wiki.forum.nokia.com/index.php/How_to_turn_the_N97_into_a_Magnetic_Compass" application in Nokia N97 but its not storing the values in the cell phone that values are "angle and accuracy".

    So I want to store these value by using filelogger.
    I downloaded the file logger and installed the Y browser in Nokia N97 and create folder in C:\logs\nt.

    My question is how to compile the file logger, please guide me through this process so I can Proceed further.

  8. #8
    Nokia Developer Champion
    Join Date
    Jul 2004
    Posts
    2,015

    Re: please guide me throughout the process

    What do you mean by the filelogger? Where did you download it from? I can't see anything called filelogger on that web page.

  9. #9
    Registered User
    Join Date
    Aug 2010
    Posts
    20

    Re: please guide me throughout the process

    Quote Originally Posted by hotcheese View Post
    What do you mean by the filelogger? Where did you download it from? I can't see anything called filelogger on that web page.
    Here you can find the file logger "http://wiki.forum.nokia.com/index.php/File_logger" how I can proceed with the file logger to save the values from MagnetometerCompass sensor.

    this the application for COmpass "http://wiki.forum.nokia.com/index.php/How_to_turn_the_N97_into_a_Magnetic_Compass" code is freely available.

Similar Threads

  1. Replies: 6
    Last Post: 2011-05-20, 10:43
  2. Is there a way to "edit" and "save" the "texts" of received SMS messages?
    By pamir_yasti in forum General Development Questions
    Replies: 1
    Last Post: 2010-07-16, 10:15
  3. Replies: 11
    Last Post: 2008-06-26, 05:54
  4. N70 stuck on "Not allowed" on "Edit user data"
    By andreigheorghe in forum Mobile Java General
    Replies: 1
    Last Post: 2006-09-01, 18:55
  5. Replies: 1
    Last Post: 1970-01-01, 02:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×