Главная » Просмотр файлов » Wiley.Mobile.Python.Rapid.prototyping.of.applications.on.the.mobile.platform.Dec.2007

Wiley.Mobile.Python.Rapid.prototyping.of.applications.on.the.mobile.platform.Dec.2007 (779889), страница 57

Файл №779889 Wiley.Mobile.Python.Rapid.prototyping.of.applications.on.the.mobile.platform.Dec.2007 (Symbian Books) 57 страницаWiley.Mobile.Python.Rapid.prototyping.of.applications.on.the.mobile.platform.Dec.2007 (779889) страница 572018-01-10СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

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

Custom modules andmodules used on the PC side are not included in this list. More informationabout these modules can be found in the PyS60 API documentation andin the Python Library Reference.Module NameDescriptionappuifwS60 user interface application framework;includes dialogs, notes, selection listsaudioRecording and playing of audio files andtext-to-speech enginecalendarCalendar services: reading, creating entries,setting alarmscameraTaking of photographs and starting and closing ofthe viewfindercontactsAddress book services: finding and adding contactinformatione32Utilities related to Symbian OS that are not relatedto the user interfacee32dbPhone’s internal relational database with arestricted SQL syntax318Module NamePYTHON FOR S60 MODULESDescriptione32dbmPhone’s internal database with simpledictionary-like syntaxglcanvasUser interface control for displaying OpenGL 3DgraphicsglesPython bindings to OpenGL ES 3D graphicsgraphics2D graphics primitives and image loading, saving,resizing and transformationhttplibLow-level access to HTTP and webinboxReading of incoming SMS messages and deletionof SMS messageskey codesIdentifiers for keyboard keyskeycaptureGlobal capturing of key eventslocationGSM Cell ID locationmd5MD5 cryptographic hash functionmessagingMessaging services for sending SMS and MMSosFunctions related to handling files and directoriesos.pathFunctions related to file namespositionPhone’s internal GPSrandomRandom number generatorsocketTCP/IP networking, Bluetooth, setting the defaultaccess pointsysinfoSystem information of an S60 mobile device suchas battery level, IMEI, signal strength or memoryspacetelephoneTelephone functionalities such as dial andhang-upPYTHON FOR S60 MODULESModule Name319DescriptionthreadThreads to handle concurrent processing ofseveral taskstimeTime and date functionstopwindowCreating windows that are shown on top of otherapplicationsurllibHigh-level access to HTTP and webIndex+= operator 472D graphics 92–53D graphics 99–100access pointselection dialog 169setting default 172address() function 68, 75animal sounds, recording 82–3APIs (Application ProgrammingInterfaces) 199–201append() function 39AppleScript, controllingapplications with 146–8application body 59application buildingapplication structure 52–6application body 59, 60application menu 56–9content handler 60tabs 59functions 49–52SMS game server 70–6application keys, Web API 199,207, 217application menu 56, 58–9appuifw module 27–8, 31–2app object 53–5multi query() function36–8multi selection list()function 43–4note() function 35–6popup menu() function40–1query() function 33–5selection list() function41–3uid() function 283ArduinoBT micro-controller board261–6asynchronous communication188–92audio modulefunctions 83–4open() function 78–9play() function 78–9, 81–2,83record() function 81, 82, 83say() function 78stop() function 80, 81, 82,83automatic updating 236–8bindingbind() function 54, 69, 88,139keycodes to callback functions86–8blit() function 92, 95, 96, 104,206Bluetoothclient–server chat application138–41connecting to external GPSreader 148–50connecting to other devices150–1creating Bluetooth servers144–6Max/MSP connection usingRFCOMM 266–71serial port, setting up 289–92using the Bluetooth console292–3break statement 45bugs, finding 298–9callback functions 54–5, 69, 79binding to keycodes 86–8capturing key events 91–2event callback() function88–91redraw callback() function92–5camerafunctions 100–1taking a photo 102–4viewfinder 101–2322Canvas object 85–6bind() function 54, 69, 88,139blit() function 92, 95, 96,104, 206double buffering 106event callback parameter88–9redraw callback parameter92, 94, 95size() function 94–5capabilities, Platform Security280–2certificates see devcerts(developer certificates)C++ extensions 236chat application 138–41client–server applicationsMobiLenin 245–52voting service 179–82code blocks, writing 28–9coding styles 241–3colorhexadecimal constants 94specified as Unicode strings 42communication protocols 166–7default access point, setting172HTTP client 169–70JSON client 170–1TCP client 167–9TCP/IP 159concurrent programs 241connect() function 139, 168,190, 269contacts module 151–2Content handler object 60,157, 213content() function 65–6continuation lines 29conversionsplain to Unicode text 121type 36, 60, 63, 64, 72, 140,144, 203custom modules 234–6databasescontacts database 151–2INDEXEventfu application 207–15local database 121–3MySQL database 261data encoding using JSON166–7, 170–1, 174data handling 111–12basic file operations 114–16dictionary data structure118–20error handling 113–14file organization 112–13finding sound, photo and videofiles 116–17local database 121–3log files 116reading and writing text117–18reading and writing Unicode text120–1debugging 295interpreting tracebacks 295–7logging output to file 116procedure for 298–9decode("utf-8") function121default access point, setting 172def keyword 51deployment of PyS60 programs287devcerts (developer certificates)capabilities 280, 281–2,283obtaining 285–6signing with 284, 285dial() function 151, 152dialog functions 27–8multi-query dialog 36–8note dialog 35–6single-field dialog, query 33–5dictionary object 118–19constructing 230–1event object 88–9JSON client 170–1, 174JSON gateway 185, 186and local databases 121–3reading contents from a file120writing contents to a file119–20directories 112–13creating 113protected 282–3dot notation 56double buffering 92, 106download plugin() function238–9drawing functions 95drive letters 113dynamic time 105–6e32dbm module 122–3e32db module 121e32 module 54lock object 55, 56, 69, 79,105sleep() function 105–6,110, 182timer object 97, 125–6,211–13, 214–15, 240yield() function 99, 106empty value 36emulator, using 30, 301–2encodingUnicode strings 34–5, 121,129, 211, 213urllib.urlencode()function 204using JSON 166–7, 170–1,174errorssee also debuggingduring installation 29–30exception handling 113–14,296–7event callback() function88event dictionary 88–9Eventfu application 207–9access point dialog 214constants, setting up 209–10description of event 214event form 208, 213preferences form 208, 209–10storing preferences 210–11UI functions 214–15updating events 211–13event handling functions 91INDEXevent loops 105events database see Eventfuapplicationexception handling 113–14,296–7File object 114–16file organization 112–13file system protection 282–3find() function 61, 62, 66for loop 44–5flickering, reducing by doublebuffering 106Flickr see InstaFlickr applicationfunctions, creating own 49–52gamescontrolling with event loops105double buffering 106dynamic time 105–6guess my number 145–6Hangman server 70–6Manhattan Story Mashup252–6random number generation106structure of 104–6UFO Zapper 104, 106–10glcanvas and gles modules, 3Dgraphics 99global variables 72–3, 83, 231,235–6GPS positioningexternal GPS over Bluetooth148–50using position module127graphical user interfacecustomizing, Max/MSPconnection 268–9native elements of PyS6031–45graphics 923-dimensional 99–100drawing graphics primitives92–5interactive 97–9GSM positioning 123–6hang up() function 151Hangman server game 70–6”Hello World” script, writing2nd Edition devices 25–73rd Edition devicesLinux Users 20–1MAC OS X Users 19Windows Users 15–18httplib module 157HTTP server 174–7HyperTerminal, Windows 292–3if statement 38–9image composition tool 256–61image filessee also photosreading 117uploading to Web 223,259–61image masks 96Image object 92, 106blit() function 92, 95, 96,104, 206drawing graphics primitives92–5loading and saving images 96map images 203–5MobileArtBlog 257–60taking screenshots 96–7viewfinder images 101–2importing modulesimport () function 239import statement 32Inbox object 64–5accessing messages 65bind() function 69forwarding messages 69–70receiving messages 68–9searching for messages 66sms messages() function65, 66, 67, 228, 229sorting messages 66–8indentation of code 28–9innovation 3323democratizing 8–11sharing of 9–10user-centered 9input verification 62–3InstaFlickr application 215–16constants 216–17data uploading 221–2progress bar 223–4result parsing 217signed calls 219–21taking photos 222–3token handling 217–19UI functions 224installation of PyS60 13–142nd Edition devices 21downloading install files21–2, 301–2installing files to phone 25sending files to phone 22–5writing and running a script25–73rd Edition devicesdownloading install files14–15, 301–2Linux users 19–21Mac OS X users 18–19Windows Users 15–18instant messaging 188–92interactive graphics 97–9Internet 159see also web servicesautomatic updating 236–8communication protocols166–72connecting to 158–65downloading data from 156–7,238–9plug-in mechanisms 238–9uploading data to 157–8,221–2interpreter for Python 7–8downloading and installing301–2signing with a devcert 285introspection 231–4IP addresses 159local IP address 162phone’s IP address 178finding server 163324join() function 72JSON (JavaScript Object Notation)166–7installing JSON module159–60JSON client 170–1JSON gateway 184–8JSON server 173–4keyboard keys 84–6binding keycodes to callbackfunctions 86–8capturing key events 91–2event callback() function88–9key pressed or held down89–91keycapture module 91–2keycodes 86–91key code module 86–91key events 50, 84–5capturing 50, 88–90, 91–2handling 85–6, 88–9key–value pairs 88–9, 118–20language tool application127–30lead users 5development of products 10innovation by 8–9motivation of 9len() function 61Linux usersinstalling PyS60 files 19–20,24–5IP addresses, finding 162RFCOMM setup 291–2writing first script 20–1list comprehensions 228–30lists 39list comprehensions 228–30multi-selection list 43–4selection list 41–3tuples 56–7local database 121–3local variables 72–3location application 124–6INDEXlock object 55, 56, 69, 79, 105loopsfor loop 44–5while loop 45lower() function 62MAC OS X usersAppleScript, controllingapplications with 146–8installing PyS60 files 18, 23–4IP addresses, finding 162RFCOMM setup 290–1writing first script 19makedirs() function 113makefile() function 140, 144,168–9Manhattan Story Mashup 252–6map explorer application seeMopyMaps! applicationmasks, image 96Max/MSP, controlling with a phone266Bluetooth RFCOMM connection266–71WiFi connection 271–3menusapplication menu 56, 58–9popup menus 40–1messagesaccessing 65receiving 68–9searching 66, 228–30sending 45–7sorting 66–8messaging module 45–7, 64,70, 71–2, 74micro-controller board, connectingphone to 261–6MIDI files, playing 79–80missing values, denoting 36MobileArtBlog 256–7client code 257–60inserting data into MySQLdatabase 261server-side PHP script 260–1mobile networking 155–6communication protocols166–7HTTP client 169–70JSON client 170–1setting default access point172TCP client 167–9development environment,setting up 158–62downloading from the Web156–7networking environments160–2peer-to-peer networking183–8testing network connection162–5uploading to the Web 157–8MobiLenin system 245–6mobile client code 249–52system architecture 246–9Mobile Web Server (MWS) 193modulescreating custom 234–6importing on the fly 238–9using built-in 31–2MopyMaps! application 201–2constants 202–3fetching map images 203–5result parsing 203UI functions 205–7MP3 files, playing 78–9multi-query dialog 36–8multi-selection list 43–4multi-user applications 252,273–4music video voting application245–52MySQL database, inserting datainto 261National Marine ElectronicsAssociation (NMEA) 148–9native UI elements 31multi-query dialog 36–8multi-selection list 43–4note 35–6popup menu 40–1query 33–5selection list 41–3INDEXnetworking environments 158,160–1finding local and server IPaddresses 162–3local wireless network 161phone Internet accessand external test server161–2, 163and external web server162, 163and PC as a server 161, 163setting default access point 172testing connection using a testserver 163–5Nokia phone models 302None, empty value 36note dialog 27–8, 35–6OBject EXchange (OBEX) 134–8objects 55–6OpenGL graphics API 99–100OpenSound Control (OSC)273–4open-source 5, 6, 7operating systems 6OSC see OpenSound ControlOSCmobile module 273–4os modulemakedirs() functionpath.exists() function113remove() function 81system() function 147output formatting 63–4packagescreating standalone 286–7running under Platform Security287–8signing 284–6parameters, function 28, 51pass statement 130pausing execution see sleep()functionPC, controlling remotely 146–8PC to phone communication141–8peer-to-peer networking 183–4instant messaging 199–91JSON gateway 184–8phone calls, recording 83phone to PC communication141–2AppleScript, controllingapplications with 146–8communicating with the PC142–4PySerial, creating BluetoothServers with 144–6phone to phone communication136using OBEX 136–8using RFCOMM 138–41phone providing a web service193–7phone-as-server, drawbacks of177–9photosInstaFlickr application 215–24Manhattan Story Mashup252–6MobileArtBlog 256–61sending 136–8taking 102–4PHP script 158, 249, 252,259–61placeholders 63plain text, conversion to Unicode121Platform Security 279–80capabilities 280–2file system protection 282–3running PyS60 under 287–8SIS package signing 284–7play() function 78–9, 81–2,83plug-in mechanism, automaticupdating 238–9popup menus 40–1popup notes 27–8, 35–6positioning 123GPS positioning 127, 148–50GSM cell ID mapper 123–6position module 127preferences, storing 210–11print statement 43325for writing to a file 115, 116private directory 116, 283program patterns 239–41prototyping with PyS60 1, 5, 7,10–11proxy server, phone as 194–5py2sis tool 286–7PySerial module, creatingBluetooth servers 133–6Python programming language 7,8Python for S60 (PyS60) 1–2,7–8see also installation of PyS60automatic updating 236–8coding styles 241–3deployment of 288distribution of 288extending using Symbian C++236potential users 5–6rapid prototyping tool 10–11reasons for using 3–4toolkit 10writing first program 27–8query() function 27–8, 33–5quit() function 54random number functions 106,108, 145range() function 44–5read() function 116, 117recording sounds 80–3redraw callback() function86, 92, 206relational databases seedatabasesremote control of PC 146–8replace() function 62resource directory 283return values, functions 51RFCOMMphone-to-phone communication138–41serial port, setting up 289–92RGB colors 94326robotics 274–7Roomba robotic vacuum cleaner275–7S60 software platform 6–7,302scancodes 86–7, 89scope of variables 72–3screenshots, taking 96–7screen size 59, 60security see Platform Securityselection list 41–2self-signed certificates, creating284serial communication, setting up289–92Serial object 145, 146server software 172–3HTTP server 174–7JSON server 173–4running on a phone 177–9shopping list assistant program46–7signal() function 55signing see SIS package signingsingle-field dialog 33–5SIS package signing 284developer certificates (devcerts)285–6keys and certificates, creating284signing PyS60 interpreter with adevcert 285standalone packages, creating286–7sleep() function 105–6, 110,182smartphones 3sms messages() function 65,66, 67, 228, 229SMS game server application70–6SMS messagesHangman game application70–6sending messages 45–7SMS inbox 64–5accessing 65INDEXforwarding messages 69–70receiving messages 68–9searching 66sorting 66–8socket module 172, 177–8SocketServer module 163–5,174, 185–6sort() function 66–8soundplaying MIDI files 79–80playing MP3 files 78–9reading files 117recording 80–3, 129, 151text-to-speech functionality77–8source code, sharing of 9–10split() function 63, 64standalone programs, creating286–7start viewfinder() function102startswith() function 62state() function, audio module84str() function 36string handlingaccessing parts of a string 61cleaning up input strings 62–3decision-making functions61–2defining strings 60–1formatting output 63–4strip() function 62substrings 61–2Symbian C++, extending Python236Symbian OS 6–7Platform Security 279–80SIS file signing 284–6symbol tables 231–4synchronous communication138sysinfo module 152–3system directory 282–3system information 152–3tabs, defining 59take photo() function 102–3,128, 137, 157, 196, 222–3TCP/IP 159, 166–7Max/MSP 271–3TCP client 167–9telephone module 151–2terminal emulator software, using144, 301–2terminology 7–8text editors 15, 19, 20, 25, 29text reading/writingdictionary key–value pairs118–20list items 117–18Unicode strings 120–1text-to-speech functionality 77–8threading 185–92, 212, 241timecurrent time 126, 171, 213dynamic time 105–6time() function 68timer object 97, 126, 211–13,214–15, 240toolkit for PyS60 10tracebacks, interpreting295–7translation application 127–30troubleshootingsee also debugginginstallation problems 29–30try – except block 113–14tuples 56–9type conversions 36, 60, 63, 64,72, 140, 144type parameters 33–4UFO Zapper game 106–10Unicode stringsencoding and decoding 34–5,121, 129, 211, 213reading and writing 120–1unread() function 68upper() function 62urban storytelling game 252–6urllib module 156–7, 170,171, 200, 204user interface (UI)see also appuifw modulecustom elements 254–6,268–9INDEXnative elements 31–45structure of 52–3UTF-8 encoding/decoding 121,129, 211, 213vacuum cleaner robot 275–7variables 36–3, 72–3video files, reading 117viewfinder 101–2, 103Vocabulector language-learningtool 127adding new entries 127–9boilerplate text 130–1displaying entries 129–30von Hippel, Eric 8–10voter application 63–4voting service, client–server179–82wait() function 55WAV files, recording 80–3web server, using phone as193–7web services (Web APIs) 199see also Internetapplication keys 199, 207, 217EventFu event finder 207–15InstaFlickr photo uploader215–24MopyMaps! mobile mapexplorer 201–7Representational State Transfer(REST) 200–1using Web APIs 200while loop 45white space 28–9WiFiconnecting phone to Max/MSP271–3327instant messenger application188–92security risks 220testing connection to wirelessnetwork 162Windows usersinstalling PyS60 files 15, 22–3IP addresses, finding 162RFCOMM serial port, setting up290writing first script 15–18write() function 115XML parsers 203, 216–17Yahoo! Maps 201–7yield() function 99, 106.

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

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

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

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