quick_recipes (779892), страница 48

Файл №779892 quick_recipes (Symbian Books) 48 страницаquick_recipes (779892) страница 482018-01-10СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 48)

You can then answer the incoming call by usingthe AnswerIncomingCall() function. When the call is answered,RunL() will be called and the error code can be retrieved from the usualiStatus variable.In order to hang up a currently active call (one that has been answered),simply call the Hangup() function, which will cause the call to beterminated.

Once again, RunL() will be called and the error code canbe retrieved from the iStatus variable.TELEPHONY269What may go wrong when you do this: Your phone operator canoverride the restriction settings, so changing them to anything elsethan EIdRestrictDefault could lead to situations where thecall does not get through on certain networks (this behavior hasbeen observed in Thailand with AIS & DTAC networks in August2007).4.8.1.2Send DTMF Tones to the Phone LineAmount of time required: 15 minutesLocation of example code: \Telephony\Telephony_DialerRequired library(s): etel3rdparty.libRequired header file(s): etel3rdparty.hRequired platform security capability(s): NetworkServicesProblem: You want to send DTMF tones on a line with an active call.Solution: The CTelephonyAppUi class shows how to use the Send_DTMF code.To be able to send DTMF tones you need to call CTelephony::SendDTMFTones(), passing in a string of DTMF tones.

The DTMF toneswill be transmitted to all currently active voice calls, which means youwill also need to check the status of the line before trying to send anytones.After calling the SendDTMFTones() function, all DTMF tones areplayed in sequence, after which RunL() will be called and any possibleerrors can be checked from the iStatus variable.Tip: Displaying the DTMF tones that are played on the screen makesfor a better user interface.

For more information about graphics anddrawing to the screen, please see the recipes in Section 4.5.Tip: CTelephony does not let you control how long each DTMF toneis played when you send a DTMF string. You may want to send thetones one-by-one and always wait for the callback before sending thenext one.4.8.1.3Observe the Phone Line StateAmount of time required: 15 minutesLocation of example code: \Telephony\Telephony_DialerRequired library(s): etel3rdparty.lib270SYMBIAN C++ RECIPESRequired header file(s): etel3rdparty.hRequired platform security capability(s): NoneProblem: You want to monitor incoming calls and call states.Solution: The CTelephonyAppUi class shows how to use the Call_Observer code.In order to monitor the status of your phone, you need to call CTelephony::NotifyChange().

Each status change will then trigger a callto RunL() and the error code can be retrieved from its iStatus variable. If the error code is KErrNone, the line status information will bestored in the TCallStatusV1 variable given to NotifyChange().All possible line status values are defined in TCallStatus and areas follows:• EStatusUnknown (status is not known).• EStatusIdle (line is idle, i.e., no activity at all).• EStatusDialling (line is dialing an outgoing call).• EStatusRinging (line is ringing, i.e., either incoming call is ringing,or outgoing call is ringing on the other end).• EStatusAnswering (line is currently being answered).• EStatusConnecting (a call is being connected).• EStatusConnected (call is connected, i.e., we have an activephone call).• EStatusReconnectPending (a call is undergoing temporary channel loss and it may or may not be reconnected).• EStatusDisconnecting (a call is being disconnected).• EStatusHold (call is on hold state).• EStatusTransferring (call is being transferred).• EStatusTransferAlerting (a call is alerting the remote party ofa transfer).What may go wrong when you do this: State change events can be lostif you don’t exit your RunL() method quickly enough, particularlyif you trigger a change in your RunL() method.

We advise usingseparate active objects to implement the logic of your application andonly using the original NotifyChange() callback to trigger theirexecution.TELEPHONY4.8.1.4271Retrieve the Network Signal StrengthAmount of time required: 10 minutesLocation of example code: \Telephony\Telephony_Monitor1Required library(s): etel3rdparty.libRequired header file(s): etel3rdparty.hRequired platform security capability(s): NoneProblem: You want to know the signal strength for the telephone network.Solution: The CTelephonyAppUi class shows how to use the Signal_Observer code.Discussion: You need to call CTelephony::GetSignalStrength().When the initial signal strength has been retrieved, RunL() will becalled.In order to monitor the signal strength, use the NotifyChange()function with the second parameter set to ESignalStrengthChange.Since we are using the same active object for two different requests,we keep track of what is currently being done using the iMonitoringvariable.

The importance of this becomes clear when implementing theDoCancel() function to determine which request needs to be cancelled.The signal strength values are stored in a TSignalStrengthV1variable (if iStatus is KErrNone), with which you can get the actualsignal strength value (stored as dBm in iSignalStrength) and the barvalues (stored in iBar) that should be used when drawing the signal barson the screen.4.8.1.5Retrieve the Battery StatusAmount of time required: 10 minutesLocation of example code: \Telephony\Telephony_monitor1Required library(s): etel3rdparty.libRequired header file(s): etel3rdparty.hRequired platform security capability(s): NoneProblem: You want to know the battery level (that is, how much chargeis left in it).Solution: The CTelephonyAppUi class shows how to use the Battery_Observer code.Discussion: You need to call CTelephony::GetBatteryInfo().When the initial battery status has been retrieved, RunL() will becalled.272SYMBIAN C++ RECIPESIn order to monitor the battery status, use the NotifyChange()function with the second parameter set to EBatteryInfoChange.Since we are using the same active object for two different requests,we keep track of what is currently being done using the iMonitoringBattery variable.

The importance of this becomes clear when implementing the DoCancel() function to determine which request needs tobe cancelled.The battery status values are stored in a TBatteryInfoV1 variable,with which you can get the actual battery status value (stored in iStatus,which indicates for example whether the charger is connected) and thecurrent charge level of the battery (stored in iChargeLevel).4.8.1.6Retrieve the IMEI Number of the DeviceAmount of time required: 15 minutesLocation of example code: \Telephony\Telephony_Monitor1Required library(s): etel3rdparty.libRequired header file(s): etel3rdparty.hRequired platform security capability(s): NoneProblem: You want to get the device’s identifier number (IMEI).Solution: The CTelephonyAppUi class shows how to use the GetIMEIcode.Discussion: You need to call CTelephony::GetPhoneId().

Whenthe IMEI number of the device has been retrieved, RunL() will be calledand the error code can be retrieved from the iStatus variable.The IMEI number is stored in a TPhoneIdV1 variable (if iStatus isKErrNone), which contains three buffer variables:• iManufacturer (indentifies the manufacturer).• iModel (identifies the model).• iSerialNumber (the actual IMEI number of the device).Tip: The IMEI number can be used to generate registration keys, andthus to check if the application is correctly registered, you often needthe IMEI number before giving the user access to the full application.Basically, in order to make this work well, you could have a splashscreen shown first when the application is started and then use a timerto change it to the normal startup screen.

When you start the splashscreen, you could construct and start CMyImeiGetter.TELEPHONY4.8.1.7273Retrieve the Current Network NameAmount of time required: 10 minutesLocation of example code: \Telephony\Telephony_Monitor1Required library(s): etel3rdparty.libRequired header file(s): etel3rdparty.hRequired platform security capability(s): NoneProblem: You want to get the current network name.Solution: The CTelephonyAppUi class shows how to use the NetWorkName code.Discussion: You need to call CTelephony::GetCurrentNetworkName(). When the current network name has been retrieved, RunL()will be called and the error code can be retrieved from the iStatusvariable.The network name is stored in a TNetworkNameV1 variable (ifiStatus is KErrNone), which only has one buffer variable iNetworkName, where the name for the currently used network is stored.What may go wrong when you do this: Some networks do not publishtheir name, and thus you might get an empty string when using thisclass.

Характеристики

Тип файла
PDF-файл
Размер
1,59 Mb
Материал
Тип материала
Высшее учебное заведение

Список файлов книги

Свежие статьи
Популярно сейчас
Как Вы думаете, сколько людей до Вас делали точно такое же задание? 99% студентов выполняют точно такие же задания, как и их предшественники год назад. Найдите нужный учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6392
Авторов
на СтудИзбе
307
Средний доход
с одного платного файла
Обучение Подробнее