android 来电监听 kivy,查看android上使用kivy kivy launch打印语句的输出

使用adb logcat获取应用程序的输出,或者使用在线提供的帮助显示日志和grep for'Python'的应用程序之一。在

以上详细步骤:

在设备上启用开发者选项(谷歌是你的朋友)。

然后启用usb调试。在

然后使用usb电缆将设备连接到pc,然后在控制台中键入adb devices。

它应该显示您的设备(可能会出现提示,要求您获得连接到计算机的权限)。在

一种更简单的方法是在小部件上使用视觉指示,而不是在控制台上打印。

你可以为你的应用程序创建一个函数bubprintfrom kivy.core.window import Window

from kivy.clock import Clock

from kivy.factory import Factory

from kivy.lang import Builder

Builder.load_string('''

# declare our message StringProperty

message: 'empty message'

# let the bubble be of 200 device pixels

# and expand as necessary on the height

# depending on the message + 20 dp of padding.

size_hint: None, None

show_arrow: False

pos_hint: {'top': 1, 'right': 1}

size: dp(200), lbl.texture_size[1] + dp(20)

Label:

id: lbl

text: root.message

# constraint the text to be displayed within

# the bubble width and have it be unrestricted

# on the height.

text_size: root.width - dp(20), None

''')

def bubbprint(self, message):

message = repr(message)

if not self.info_bubble:

self.info_bubble = Factory.InfoBubble()

self.info_bubble.message = message

# Check if bubble is not already on screen

if not self.info_bubble.parent:

Window.add_widget(self.info_bubble)

# Remove bubble after 2 secs

Clock.schedule_once(lambda dt:

Window.remove_widget(self.info_bubble), 2)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值