使用Buildozer部署Kivy到移动设备上
在安装好Buildozer软件之后,我们在包含main.py的文件夹下运行buildozer init这个命令,然后我们就会看到在该文件夹下有一个buildozer.spec这个文件,这个文件主要是用来配置一系列设置用的,使用文本编辑器,Linux下使用vim编辑器打开。
下面是个例子: [app]
# (str) Title of your application 更改1
title = Test
# (str) Package name 更改2
package.name = test
# (str) Package domain (needed for android/ios packaging)
package.domain = org.example
# (str) Source code where the main.py live
source.dir = .
# (list) Source files to include (let empty to include all the files)
source.include_exts = py,png,jpg,kv,atlas
# (list) Source files to exclude (let empty to not exclude anything)
#source.exclude_exts = spec
# (list) List of directory to exclude (let empty to not exclude anything)
#source.exclude_dirs = tests, bin
# (list) List of exclusions using pattern matching
#source.exclude_patterns = license,images/*/*.jpg
# (str) Application versioning (method 1)
# version.regex = __version__ = '(.*)'
# version.filename = %(source.dir)s/main.py
# (str) Application versioning (method 2) 更改3
version = 0.1
# (list) Application requirements 更改4
requirements = kivy
# (str) Presplash of the application 更改5
presplash.filename = %(source.dir)s/data/presplash.png
# (str) Icon of the application 更改6
icon.filename = %(source.dir)s/data/icon.png
# (str) Supported orientation (one of landscape, portrait or all) 更改7
orientation = all
# (bool) Indicate if the application should be fullscreen or not 更改8
fullscreen = 0 #
# Android specific 更改9
#
# (list) Permissions
android.permissions = INTERNET
# (int) Android API to use 更改10
android.api = 19
# (int) Minimum API required (8 = Android 2.2 devices)
# 更改11
android.minapi = 9
# (int) Android SDK version to use 更改12
android.sdk = 20
# (str) Android NDK version to use 更改13
android.ndk = 9c
# (bool) Use --private data storage (True) or --dir public storage (False)
android.private_storage = True
# (str) Android NDK directory (if empty, it will be automatically downloaded.)
#android.ndk_path =
# (str) Android SDK directory (if empty, it will be automatically downloaded.)
#android.sdk_path =
# (str) Android entry point, default is ok for Kivy-based app
#android.entrypoint = org.renpy.android.PythonActivity
# (list) List of Java .jar files to add to the libs so that pyjnius can access
# their classes. Don't add jars that you do not need, since extra jars can slow
# down the build process. Allows wildcards matching, for example:
# OUYA-ODK/libs/*.jar
#android.add_jars = foo.jar,bar.jar,path/to/more/*.jar
# (list) List of Java files to add to the android project (can be java or a
# directory containing the files)
#android.add_src =
# (str) python-for-android branch to use, if not master, useful to try
# not yet merged features.
#android.branch = master
# (str) OUYA Console category. Should be one of GAME or APP
# If you leave this blank, OUYA support will not be enabled
#android.ouya.category = APP
# (str) Filename of OUYA Console icon. It must be a 732x412 png image.
#android.ouya.icon.filename = %(source.dir)s/data/ouya_icon.png
# (str) XML file to include as an intent filters in <activity> tag
#android.manifest.intent_filters =
# (list) Android additionnal libraries to copy into libs/armeabi
#android.add_libs_armeabi = libs/android/*.so
# (bool) Indicate whether the screen should stay on
# Don't forget to add the WAKE_LOCK permission if you set this to True
#android.wakelock = False
# (list) Android application meta-data to set (key=value format)
#android.meta_data =
# (list) Android library project to add (will be added in the
# project.properties automatically.)
#android.library_references =
#
# iOS specific
#
# (str) Name of the certificate to use for signing the debug version
# Get a list of available identities: buildozer ios list_identities
#ios.codesign.debug = "iPhone Developer: <lastname> <firstname> (<hexstring>)"
# (str) Name of the certificate to use for signing the release version
#ios.codesign.release = %(ios.codesign.debug)s [buildozer] # (int) Log level (0 = error only, 1 = info, 2 = debug (with command output)) 更改14
log_level = 2
# -----------------------------------------------------------------------------
# List as sections
#
# You can define all the "list" as [section:key].
# Each line will be considered as a option to the list.
# Let's take [app] / source.exclude_patterns.
# Instead of doing:
#
# [app]
# source.exclude_patterns = license,data/audio/*.wav,data/images/original/*
#
# This can be translated into:
#
# [app:source.exclude_patterns]
# license
# data/audio/*.wav
# data/images/original/*
#
# -----------------------------------------------------------------------------
# Profiles
#
# You can extend section / key with a profile
# For example, you want to deploy a demo version of your application without
# HD content. You could first change the title to add "(demo)" in the name
# and extend the excluded directories to remove the HD content.
#
# [app@demo]
# title = My Application (demo)
#
# [app:source.exclude_patterns@demo]
# images/hd/*
#
# Then, invoke the command line with the "demo" profile:
#
# buildozer --profile demo android debug
总共做了14个更改。 title
为了避免某些字符可能引起的不工作,最好避免过长的标题,太长的标题到时候也可能不适应在App的图标下。 package.name
package.name只能是一个单词,只能是由ASCII字符或数字组成,不应该包含特殊字符。比如说,如果你的应用叫Test One,那么package name就应该写成 testone。 package.domain
这个应该填写的是制作这个App的公司或个人的名称,domain+name将会成为该应用对于Android 或iOS的标识。 source.dir
填写包含main.py这些文件的目录路径,默认是在buildozer.spec所在的目录。 source.include_exts
设置将扩展名符合该规则的文件包含进来。如果想将所有属于你自己的扩展名文件包含进来,直接将该值设置为空值,这样就能将所有东西包含进来了。 source.exclude_exts
跟上面相对应的,这里设置的是不将符合该规则扩展名的文件包含进来。 source.exclude_dirs
这里设置的是不将符合该规则的目录包含进来。比如说,如果不想将tests和bin目录包含进来的话,就进行如下设置。 source.exclude_dirs = tests, bin
version.regex
使用正则表达式去捕捉version.filename文件内的version信息。默认的捕捉方法是在main.py里面查找类似下面一行的内容。
__version__ = "1.0"
version.filename
默认是指main.py文件 version
用来自己手动设置version,如果你不想用捕捉的方法获取到version的话,你可以将version.regex 和 version.filename给注释掉,然后给version赋一个值,例如。 # version.regex =
# version.filename =
version = 1.0
requirements
填写该App所需要的Python的模块或扩展模块 presplash.filename
Presplash是应用刚打开加载时显示的图像,对于不同的平台presplash可能会有不同的要求,目前Buildozer在该方面对于Android的支持要好于iOS。图片的类型必须是JPG或PNG的,最好是2次幂的尺寸,比如说512X512类型的图片对于所有的机器运行都很好。Presplash图片是不会自己适应、伸缩屏幕的,如果提供在尺寸的图片,可能就不适合在小屏幕的机器上显示。 icon.filename
应用的图标,作为图标的图片必须是512X512而且是PNG格式的,这样才能够适应很多平台的要求。 orientation
指明该App支持的显示方向,默认是landscape(横向显示),也可以更改为portrait(竖向显示)或者是全部。 fullscreen
该值为布尔类型的,默认是true,这样App就会运行在全屏的状态了,意味着状态栏将会被隐藏。如果想要让用户能够看到状态栏、时间、通知等内容的话,就应该将该值设置为0。
使用Buildozer部署Kivy到移动设备上的更多相关文章
- 不通过App Store,在iOS设备上直接安装应用程序(转)
今天在iOS设备上安装天翼云存储app,在safari上直接打开http://cloud.189.cn/wap/index.jsp,点击“点击免费安装”,如下图: 神奇的事情发生了,设备上直接下载ap ...
- 如何在云端部署SAP HANA实战, Azure 上的 SAP HANA(大型实例)概述和体系结构
什么是 Azure 上的 SAP HANA(大型实例)? Azure 上的 SAP HANA(大型实例)是一种针对 Azure 的独特解决方案. 除了提供 Azure 虚拟机以用于部署和运行 SAP ...
- android设备上运行i-jetty服务
android设备上运行i-jetty服务: 1) i-jetty安装 本人小菜一个,i-jetty源码有好几个文件,不知道怎么运行起来,于是找了一个现成可运行的i-jetty工程(感谢这位同学的分享 ...
- 不通过AppStore,在iOS设备上直接安装应用程序的原理
本文转载至 http://mobile.51cto.com/hot-439095.htm 通过itms-services协议,可以通过safari浏览器直接在iOS设备上安装应用程序.利用这种方式, ...
- 【Abode Air程序开发】在设备上进行安装
在设备上进行安装 在 Google Android 设备上安装应用程序 在 Apple iOS 设备上安装应用程序 在 Google Android 设备上安装应用程序 在项目的开发.测试和部署阶段, ...
- 前端搭建Linux云服务器,Nginx配置详解及部署自己项目到服务器上
目录 搭建Linux云服务器 购买与基本配置 链接linux服务器 目录结构 基本命令 软件安装 Linux 系统启动 启动过程 运行级别 Nginx详解 1.安装 方式一:yum安装 方式二:自定义 ...
- 在本地调试移动设备上的页面——神器weinre介绍
平时写代码,最喜欢用chrome的developer Tool调试页面了,基本是离不了的工具.但是当页面需要在移动设备上使用,尤其是被嵌入到Hybird APP中时,由于移动版的chrome没有dev ...
- 如何在移动设备上调试html5开发的网页
在我们用phoengap+html5做的移动app中,经常遇到的问题就是 本地网页兼容但是到了app出现不兼容的情况,原因是手机端页面,大多运行在webkit内核的浏览器上,但还是会因平台.厂商的不同 ...
- XE6 & IOS开发之免证书真机调试(3):生成iPA文件并安装到其它苹果设备上(有图有真相)
网上能找到的关于Delphi XE系列的移动开发的相关文章甚少,本文尽量以详细的图文内容.傻瓜式的表达来告诉你想要的答案. 原创作品,请尊重作者劳动成果,转载请注明出处!!! 1.既然我们已经在真机上 ...
随机推荐
- Hibernate之关联关系映射(一对一主键映射和一对一外键映射)
1:Hibernate的关联关系映射的一对一外键映射: 1.1:第一首先引包,省略 1.2:第二创建实体类: 这里使用用户信息和身份证信息的关系,用户的主键编号既可以做身份证信息的主键又可以做身份证信 ...
- lldp学习
http://support.huawei.com/enterprise/docinforeader!loadDocument1.action?contentId=DOC1000088818& ...
- Android的简单应用(二)——使用dispatchKeyEvent双击退出程序
原文:https://www.cnblogs.com/cpacm/archive/2014/11/10/4087070.html Android系统按键操作最先是在dispatchKeyEvent ...
- [转]svn检出的时候报 Unable to connect to a repository at URL错误
昨天晚上遇到的问题: 在同一个SVN地址下,很多子目录,各种目录各种权限,现在因为业务,需要下载各种目录下的文件. 第一次遇到这个问题..现象是: 1)在web浏览器下可用: 2)在本地创建的目录下c ...
- 第四章: 4.1 logging模块 | 正则表达式
修改json数据然后写入json文件中 f = open('1234.json','r',encoding='utf-8') data = f.read() data1 = json.loads(da ...
- Jedis入门
一:介绍 1.Jedis的官网 2.使用 这个可以从上面的连接进入github. https://github.com/xetorthio/jedis 3.使用方式 或者使用jar包,不过这里我使用官 ...
- Python 扩展技术总结(转)
一般来说,所有能被整合或导入到其他Python脚本中的代码,都可以称为扩展.你可以用纯Python来写扩展,也可以用C/C++之类的编译型语言来写扩展,甚至可以用java,C都可以来写 python扩 ...
- Linux学习之文件系统常用命令(七)
Linux文件系统常用命令 目录 df命令 du命令 fsck命令 dump2fs命令 df命令 df命令 统计文件系统的占有情况,分区用了多少空间,还剩多少空间 df [选项] [挂载点] 选项: ...
- Python + Selenium操作一:截图详解
在做测试的时候,空口无凭都是白掐,特别是自动化测试的时候,更需要图片来佐证自己发现的问题 话不多说,直接进入主题,技术就是这么直白 Webdriver自带截图功能,get_screenshot_as_ ...
- emlog编辑器探寻之旅
本文同步于我的个人博客 emlog编辑器探寻之旅 一直想要寻找一个好用的emlog文本编辑器,寻觅了很久,从默认的KindEditor编辑器开始,用了几天就感觉特别难用,很多需求根本满足不了.后来想要 ...