Creating Apps in Kivy.pdf

所需积分/C币:16 2016-11-17 15:54:07 7.93MB PDF
收藏 收藏 1
举报

Creating Apps in Kivy
Creating Apps in Kivy Dusty phillips Beijing· Cambridge.mham·Kh· Sebastopol. TokyoOREILLY Creating Apps in Kivy Dusty phill y Copyright o 2014 Dusty Phillips. All rights reserved Printed in the United States of america Published by o reilly media, InC., 1005 Gravenstein Highway North, Sebastopol, CA 95472 OReilly books may be purchased for educational,business, or sales promotional use. Online editions are alsoavailableformosttitles(http://my.safaribooksonline.com).fOrmoreinformation,contactourcorporate institutionalsalesdepartment800-998-9938orcorporate@oreilly.com Editors: Meghan Blanchette and Rachel Roumeliotis Indexer: Judy Mcconville Production Editor: Nicole Shelby Cover Designer: Randy Comer Copyeditor: Rachel Monaghan Interior Designer: David Futato Proofreader: rachel head strator: Rebecca demarest April 2014 First edition Revision History for the First Edition: 2014-04-08: First release Seehttp://oreilly.com/catalog/errata.csp?isbn=9781491946671forreleasedetails Nutshell Handbook, the Nutshell Handbook logo, and the O Reilly logo are registered trademarks ofO Reilly Media, InC. Creating Apps in Kivy, the image of a kiang, and related trade dress are trademarks of O reilly Media inc Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O Reilly Media, Inc was aware ofa trademark claim, the designations have been printed in caps or initial caps While every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein ISBN:978-1-491-94667-1 Table of contents Pref 1. Introducing Kivy...... Dependencies: The Hard Part Installing on Mac OS Installing on Windows Writing Code: The Easy Part Introducing the KV Language User Interface Design 12345679 idgets The KV Language Root Widget Creating a Custom Widget Adjusting Widget Size File It All Away 02381 2. Events and Properties What Is an Event? 21 Adding Logic to a Custom Widget 22 Responding to Events 23 Accessing Properties of Kv Language Widgets 24 Populating the Search Result List 27 File It All Away 32 3. Manipulating Widgets..... 35 A More Extensible root widget 35 List view Adapters 36 Responding to list View Item Events 39 Swappable Widgets 41 Switching Forms 43 File It All away 4. Iterative Development. 45 Improving the add Location Form Caching widgets Storing actual Locations and Converting arguments 49 Retrieving Weather Data 5 File It All Away 56 5. Kivy GraphicS A Conditions widget 59 Dynamic Conditions 61 Abstracting Common Widgets Basic animation 67 Using icons instead 70 File It All away 6. Kivy Storage 73 Maintaining a List of Locations 73 Storing the location list 75 The User Settings Dialog File It All away 82 7. Gestures The Forecast Tab 83 Recording gestures 87 Touch Events 89 Recognizing gestures 91 Firing Events 92 File It All away 93 8. Advanced Widgets............. C arouse 5 The Modal view widget Completing the refactor 99 Adding an Action Bar 101 File It All Away 103 9. Releasing to Android and iOS. 105 Getting bulldozer 105 Deploying Your Application 106 Deploying to ios 113 Table of contents Android Bonus: Accessing the GPS 115 Keeping It Running 117 File It All away 117 Index ,119 Table of content Preface This book introduces Kivy, an exciting new graphical user interface library that finally allows Python to be used to code cross-platform applications on most traditional and mobile operating systems. Im happy you're here to study Kivy with me and hope that you'll enjoy reading it as much as I have enjoyed writing it. I am confident that you will be happy with the app you develop and deploy in this book and that it will lead you to develop many new applications of your own design. I look forward to seeing yo our Kivy Apps on the android and itunes market in the near future Who should read this book This book is primarily targeted to fairly new programmers who have read the Pyth non tutorial, but havent done a lot of real-world coding. In addition to instructing you in Kivy, this book introduces you to the programming workflow. Each chapter builds on the previous chapter to help you create a fully functional mobile application. You will learn the steps you need to follow to design and implement your own apps It will also be applicable to programmers who have not worked with Python before but want to use Kivy for its amazing API, integrated multitouch support, or cross-platform deployment. You will probably want to review the Python tutorial to get a leg up on the language's syntax before reading this book. You may be able to skim some sections of the text if you already understand the culture of coding Technology Used in This Book The examples in this book all target Python 3. All but three of them also run seamlessly on Python 2. 7. Those three examples have been highlighted in sidebars that include simple workarounds you can use to make the code run on both Python 2.7 and python 3. Then, any future examples that use the same code will always use the version that works on both Pythons I encourage you to use Python 3 if possible, as it is a more enjoyable language to work with, provides nicer APIs, and is slowly being adopted by the entire Python community That said, depending on what operating system you use, python 2 may be easier to deploy and develop against at this time. You will have no trouble using Python 2. 7 with the examples in this book if you prefer it This book was written entirely against Kivy 1.8, which is the first version of Kivy to support Python 3. The examples have been tested somewhat against Kivy 1.7, and it works with all the chapters except Chapter 6. Please use Kivy 1.8 or later if you can The Kivy developers move very fast and the newest version is always far better than the previous one in all dimensions: speed, stability, and features Conventions Used in this book The following typographical conventions are used in this book italic Indicates new terms, URLs. email addresses, filenames, and file extensions Constant width Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables statements, and keywords. Also used for commands and command-line options Constant width bold Shows commands or other text that should be typed literally by the user Constant width italic Shows text that should be replaced with user-supplied values or by values deter mined by context This element signifies a tip or suggestion This element signifies a general note Preface

...展开详情
试读 127P Creating Apps in Kivy.pdf
立即下载 低至0.43元/次 身份认证VIP会员低至7折
抢沙发
一个资源只可评论一次,评论内容不能少于5个字
关注 私信 TA的资源
上传资源赚积分,得勋章
最新推荐
Creating Apps in Kivy.pdf 16积分/C币 立即下载
1/127
Creating Apps in Kivy.pdf第1页
Creating Apps in Kivy.pdf第2页
Creating Apps in Kivy.pdf第3页
Creating Apps in Kivy.pdf第4页
Creating Apps in Kivy.pdf第5页
Creating Apps in Kivy.pdf第6页
Creating Apps in Kivy.pdf第7页
Creating Apps in Kivy.pdf第8页
Creating Apps in Kivy.pdf第9页
Creating Apps in Kivy.pdf第10页
Creating Apps in Kivy.pdf第11页
Creating Apps in Kivy.pdf第12页
Creating Apps in Kivy.pdf第13页
Creating Apps in Kivy.pdf第14页
Creating Apps in Kivy.pdf第15页
Creating Apps in Kivy.pdf第16页
Creating Apps in Kivy.pdf第17页
Creating Apps in Kivy.pdf第18页
Creating Apps in Kivy.pdf第19页
Creating Apps in Kivy.pdf第20页

试读结束, 可继续阅读

16积分/C币 立即下载 >