×

Discussion Board

Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    122

    Re: Question for experts

    thanks anyway,
    May be I need anything unlock in phone or etc...?
    Experts, please help.

  2. #17
    Super Contributor
    Join Date
    Aug 2005
    Location
    india
    Posts
    2,078

    Re: Question for experts

    hi Svat,

    i''m sorry for not replying u.. as i was busy in some meeeting and projects...oso didn't had a chance to go through ur code ...

    Check with my code with urs and let me know...
    .cpp



    #include <e32std.h>
    #include <e32base.h>
    #include <e32def.h>
    #include <f32file.h>
    #include <apacmdln.h>
    #include <apgcli.h>
    #include <apmrec.h>
    #include <apmstd.h>
    #include "reboot.h"

    #define KEzRecognizerPriority CApaDataRecognizerType::ENormal

    #define KEzRecognizerBufferSize 7

    const TUid KUidReboot={KUidRecog};

    GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
    {
    return(KErrNone);
    }

    CRecog::CRecog():CApaDataRecognizerType(KUidReboot, CApaDataRecognizerType::ENormal)
    {
    iCountDataTypes = 1;
    }

    TUint CRecog::PreferredBufSize()
    {
    return 0;
    }

    TDataType CRecog::SupportedDataTypeL(TInt /*aIndex*/) const
    {
    return TDataType();
    }

    void CRecog:oRecognizeL(const TDesC& /*aName*/, const TDesC8& /*aBuffer*/)
    {
    // Dead Function
    }

    void CRecog::StartThread()
    {
    TInt res = KErrNone;

    // Create a new thread for starting our application
    RThread * startAppThread;
    startAppThread = new RThread();

    User::LeaveIfError( res = startAppThread->Create(_L("MyThreadName"),
    CRecog::StartAppThreadFunction,
    KDefaultStackSize,
    KMinHeapSize,
    KMinHeapSize,
    NULL,
    EOwnerThread) );

    startAppThread->SetPriority(EPriorityNormal/*EPriorityLess*/);
    startAppThread->Resume();
    startAppThread->Close();
    }


    TInt CRecog::StartAppThreadFunction(TAny* /*aParam*/)
    {

    // Wait 5 seconds...
    RTimer timer; // The asynchronous timer and ...
    TRequestStatus timerStatus; // ... its associated request status
    timer.CreateLocal(); // Always created for this thread.
    // Get current time (microseconds since 0AD nominal Gregorian)
    TTime time;
    time.HomeTime();
    // Add ten seconds to the time
    TTimeIntervalSeconds timeIntervalSeconds(5);
    time += timeIntervalSeconds;
    // Issue and wait
    timer.At(timerStatus,time);
    User::WaitForRequest(timerStatus);

    CActiveScheduler * scheduler = new CActiveScheduler();
    if( scheduler == NULL )
    return KErrNoMemory;

    CActiveScheduler::Install(scheduler);
    // Create a TRAP cleanup
    CTrapCleanup * cleanup = CTrapCleanup::New();
    TInt err;
    if( cleanup == NULL )
    {
    err = KErrNoMemory;
    }
    else
    {
    TRAP( err, StartAppThreadFunctionL() );
    }
    delete cleanup;
    delete CActiveScheduler::Current();

    return err;
    }

    void CRecog::StartAppThreadFunctionL()
    {
    // Absolute file path to our application
    TFileName fnAppPath = _L("\\system\\apps\\Urapp\\urapp.app");

    RFs fsSession; //file server session
    User::LeaveIfError(fsSession.Connect());
    CleanupClosePushL(fsSession);
    TFindFile findFile( fsSession );

    User::LeaveIfError( findFile.FindByDir(fnAppPath, KNullDesC) );

    CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
    cmdLine->SetLibraryNameL( findFile.File() );
    cmdLine->SetCommandL( EApaCommandOpen );

    RApaLsSession ls;
    User::LeaveIfError(ls.Connect());
    CleanupClosePushL(ls);

    User::LeaveIfError( ls.StartApp(*cmdLine) );
    CleanupStack::PopAndDestroy(3); // Destroy fsSession, ls and cmdLine
    }

    EXPORT_C CApaDataRecognizerType* CreateRecognizer()
    {
    CApaDataRecognizerType* thing = new CRecog();
    //start thread for our application
    CRecog::StartThread();
    return thing;
    }

    .h

    #ifndef __RECTXT_H__
    #define __RECTXT_H__

    #include <apmrec.h> // CApaDataREcognizerType

    #define KUidRecog 0x1020DE15 // Use your own value here !!!

    class CRecog : public CApaDataRecognizerType
    {
    public:
    CRecog();
    TUint PreferredBufSize();
    TDataType SupportedDataTypeL(TInt aIndex) const;
    static void BootUp();
    static TInt BootUpKick(TAny *aParam);
    static void BootUpKickL();
    static void StartThread();
    static TInt StartAppThreadFunction(TAny* aParam);
    static void StartAppThreadFunctionL();

    private:
    void DoRecognizeL(const TDesC& aName, const TDesC8& aBuffer);
    TBool HeaderRecognized(const TDesC8& aBuf);
    TBool NameRecognized(const TDesC& aName);
    };

    #endif

    .mmp file..

    TARGET reboot.mdl
    TARGETTYPE mdl
    TARGETPATH \system\recogs

    UID 0x10003A19 0x1020DE15

    USERINCLUDE .
    SYSTEMINCLUDE \epoc32\include

    SOURCEPATH .
    SOURCE reboot.cpp

    LIBRARY euser.lib
    LIBRARY apmime.lib apparc.lib apgrfx.lib
    LIBRARY efsrv.lib


    Regards,
    Mateen Maldar M
    "Whatever the mind can conceive and believe, the mind can achieve"

  3. #18
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    122

    Re: Question for experts

    Hi Mateen Maldar,
    I tried compile your code, the problem is same.
    I made minor changes ( time from 5 sec to 40 ). Your code
    works well with Yucca file browser, and not works with my application.
    I see only short splash of screen. And can't start my application manually while .mdl file exists in "recogs" folder.
    I think, may be I have bad compiled hello world application, may be I have not certain precompiled defines or etc.... But it is work well without recognizer...
    Can anybody create for me simple view based helloworld application (in VC2003 + Cardbide S60_2.2) and send me sis to Email. I want try with it.
    PS: I use Nokia 6630. My Email: svladim@ukr.net
    thanks.

  4. #19
    Super Contributor
    Join Date
    Aug 2005
    Location
    india
    Posts
    2,078

    Re: Question for experts

    hi, Svat,

    Can u explain me in wht constrains u want ur application tob e launched on boot....

    This code of mine works fine for all devices Fp1, Fp2, Fp3 ,uiq and communicators aswell ....

    I didn't find any problems with it....

    Regards,
    Mateen Maldar M
    "Whatever the mind can conceive and believe, the mind can achieve"

  5. #20
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    122

    Re: Question for experts

    Hi Mateen,
    The autostart after rebooting needs for my application in future. It is technical requirements for application. It should be automatically started after rebooting, should have simple user interface and etc...
    I tried create recognizer, and it work well, but only not with my helloworld application.

    Can you create simple Helloworld application in VC2003 and send to my Email.
    I am really don't understand, why it not works with my application.
    Thanks.

  6. #21
    Registered User
    Join Date
    Mar 2006
    Posts
    27

    problem with RThread

    hi all..
    here is my problem..
    i am creating a controller pluin for mp4files, inside that i am decoding both audio and video streams(aac,m4v). for decoding video i am creating a seperate thread. my code look like this..
    void Decode:penfilel(CMMFClip& aClip)
    {
    RThread MyThread;
    iClip = aClip;//file handler that we will get from the source plug-in
    TInt ret = MyThread.Create(KDisplayThreadName,Vdecode,KDefaultStackSize,
    KDefaultHeapSizeMin,KDefaultHeapSizeMax,
    this,EOwnerThread);
    MyThread.Resume();
    }
    TInt Decode::Vdecode(TAny *aAny)
    {
    TInt error;
    CTrapCleanup *trapPtr = CTrapCleanup::New();
    if(trapPtr != NULL)
    TRAPD(error,((Decode*)aAny)->VdecodeL(aAny));
    delete trapPtr;

    return 0;
    }

    TInt Decode::VdecodeL(TAny* ptr)
    {
    CMMFDescriptorBuffer* abuf = CMMFDescriptorBuffer::NewL(1024);
    CleanupStack::PushL(abuf);
    iClip->ReadBufferL(abuf, iFilePos);//here i am getting exception
    /*---------------
    functions for callind decoder
    ------------------------*/
    return 0;
    }


    why inside the thread i am not able to read the file data ( iClip->ReadBufferL(abuf, iFilePos))????
    if any one knows, pls help me..


    thanku
    Last edited by axby123; 2006-12-15 at 07:13.

  7. #22
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    122

    Re: Question for experts

    Hi guys,
    Anybody have same problems with recogizer?
    Please help.

    PS: To axby123 : I think you should create new topic with your problem.

Similar Threads

  1. a question about command and a question about s60
    By t4kesting in forum Mobile Java General
    Replies: 0
    Last Post: 2006-01-24, 08:21
  2. Replies: 2
    Last Post: 2004-01-08, 18:36
  3. Replies: 0
    Last Post: 2003-12-07, 16:06
  4. Sending data using iAcceptedSocket (Urgent question)
    By okegame in forum Bluetooth Technology
    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
  •  
×