hi,
I would like an application to get the current value of signal strength in the mobile. I have seen that this can be achieved with the class ctelephony from symbian, any application that can be done and move to mobile?
thanks![]()
hi,
I would like an application to get the current value of signal strength in the mobile. I have seen that this can be achieved with the class ctelephony from symbian, any application that can be done and move to mobile?
thanks![]()
Have you checked the Wiki for exmaples already: http://wiki.forum.nokia.com/index.ph...ith_CTelephony
These articles in Wiki may be helpful for you:
- Measuring signal strength using CTelephony
- Monitoring signal strength with CTelephony
hi,
thanks for the links. I used the code of "Measuring signal strength using CTelephony"
and now I don't know where to find the values of signal strength, where the package TSignalStrength is saved.
Can I see the results in the emulator? How?
Use the another article instead: Monitoring signal strength with CTelephony
It is implemented as Active Object. After issuing asynchronous service GetSignalStrength, you will be notified in the RunL method. There you will get results into iSignalStrength and iBar. This is what you are looking for.
PS: Emulator is not a phone, hence it does not have SIM card in it, thus it is not connected with real network. So you cannot retrieve such information on emulator. You should better try on real device.
All the best.
Nokia Developer Wiki Moderation team
hi! I used the code of the article "Monitoring signal strength with CTelephony" as you said me. Also I have put in AppUi.h class Cproyecto2AppUi: public CAknAppUi
{
.
.
void SignalStatus (TInt32 aStrength, TInt8 aBars);
.
.
}
Too I added:
CNwSignalCheck * iNwSignalCheck;
and later:
delete iNwSignalCheck;
I want to display on screen the values stored in signalstrength and for this I put a new case in the function "HandleCommandL" but I don't know the parameters to pass to the function.
how can I do?
thank you very much for the help!
In this example, observer pattern has been used. SignalStatus is a callback function and you will get notification in the registered class.
Let me explain it in more detail:
1 )You need to inherit mixin class in, let's say, AppUi class, as follows:
2) You have to give implementation of SignalStatus in your AppUI.cpp fileCode:class Cproyecto2AppUi: public CAknAppUi, public MNwSignalObserver { // From MNwSignalObserver public: void SignalStatus(TInt32 aStrength,TInt8 aBars); ... ... };
3) You need to instantiate CNwSignalCheck object and register your class for an observer so that that class will receive notification.Code:// You will automatically get notification in the following function from RunL() from CNwSignalCheck as shown in the article. void Cproyecto2AppUi::SignalStatus(TInt32 aStrength,TInt8 aBars) { ... }
4) Call GetSignalInfo() from wherever you wish. Let's say from HandleCommandLCode:void Cproyecto2AppUi::ConstructL() { iNwSignalCheck = new (ELeave) CNwSignalCheck(*this); // Register AppUI class as an interested party for receiving notification ... ... }
5) You will automatically get notification in your SignalStatus which we implemented in step 2)Code:void Cproyecto2AppUi::HandleCommandL(TInt aCommand) { ... ... case ECommand1: iNwSignalCheck->GetSignalInfo(); break; ... }
6) Delete iNwSignalCheck in the destructor.
That's it. I hope that will help you. Let me know if you still have any confusion.Code:Cproyecto2AppUi::~Cproyecto2AppUi() { if (iNwSignalCheck) { delete iNwSignalCheck; iNwSignalCheck= NULL; } .... .... }
Nokia Developer Wiki Moderation team
thank you so much. This is very useful to me.
Until next week I can not see the results in a real mobile, so I don't know if actually shown on screen the signalstrength.
I have got two warnings, so my only question is: Do I have to make the function "signalstatus" or no implementation required in AppUi.cpp? if I have to make, where can i find? is it in any library?
you need to implement the "signalstatus", since it is the callback which with you are given the values from the monitoring class.
See, I have explained it step by step and as already said by Jukka, it is a callback function and you need to implement it anyhow. Because you inherit from MNwSignalObserver class which has that method as pure virtual and hence you have to implement it.
By the way I don't understand(like) why did you ask the same question again in some other thread while you are already getting reply in this thread!!!
Nokia Developer Wiki Moderation team
hi
i have made it but have to finish
here the event of press a menu opton
TBool CLUILBHCISContainerView::HandleSignal_StrengthMenuItemSelectedL( TInt aCommand )
{
iNwSignalCheck->GetSignalInfo();
_LIT(x,"Signal Strenght is : ");
TBuf<30>y(x);
y.AppendNum(iStrength);
iEikonEnv->AlertWin(y);
// TODO: implement selected event handler
return ETrue;
}
and i have declare iStrength as public and the implementation of the SignalStatus
void CLUILBHCISContainerView::SignalStatus(TInt32 aStrength,TInt8 aBars)
{
iStrength = aStrength;
iBars = aBars;
}
but when i run emulator and choose the menu option the programm is terimnated and a message say App. Closed: appear
what i have to do?
What you made and what you want to finish???Originally Posted by zohirey2
First of all check what is the pacnic code.
http://wiki.forum.nokia.com/index.ph...ded_panic_code
Second you can try working example from wiki (i guess you are trying to get signal strength).
http://wiki.forum.nokia.com/index.ph...ith_CTelephony
i still can't solve this problem
TBool CLUILBHCISContainerView::HandleMenuItemSelectedL( TInt aCommand )
{
iNwSignalCheck->GetSignalInfo();
// TODO: implement selected event handler
return ETrue;
}
the application is closed and show me a message
App. closed:
LULBHCIS
i saw saw article
http://wiki.forum.nokia.com/index.ph...ded_panic_code
but
my emulator refused to show Tools -> Preferences
when i disable the line code
iNwSignalCheck->GetSignalInfo();
the program work so good when chose blank option menu!
Yes, I well received your e-mail just now.
My utmost guess would be KERN-EXEC 3 panic.
Check this: http://wiki.forum.nokia.com/index.ph...ge_in_emulator
Solution: Have you instantiated iNwSignalCheck somewhere prior to calling its function? Please show the code where you have instantiated the class object iNwSignalCheck.
Nokia Developer Wiki Moderation team
ok
all what i have done is:
1-declare
void SignalStatus(TInt32 aStrength, TInt8 aBars);
CNwSignalCheck* iNwSignalCheck;
in the LUILBHCISContainerView.h
and then
2-implement the function SignalStatus
in LUILBHCISContainerView.cpp
as follow
void CLUILBHCISContainerView::SignalStatus(TInt32 aStrength, TInt8 aBars)
{
TBuf<30>m;
_LIT(n,"Signal Strength: ");
m.Append(n);
m.AppendNum(aStrength);
iLUILBHCISContainer->Set1(m);
}
3- i call the function as follow
iNwSignalCheck->GetSignalInfo();
in the event of chossing some option menu
only this
what can i do??
KERN-EXEC 3
this is the panic