mirror of https://github.com/kivy/kivy.git
Page:
Deep Linking with iOS and Android
Pages
A draggable scrollbar using a slider
AdBuddiz Android advertisements integration for Kivy apps
Advanced Graphics: In Progress
An example of background Twisted server running on Android
Android Background Services
Android SDK NDK Information
Android SDK NDK Informations
Android native embedded browser
Android style menu app skeleton
Background Service using P4A android.service
Batch installer for windows(KivyInstaller)
Breaking changes in Kivy
Building Portable Package
Button(s) in settings panel
Buttons in Settings panel
Community Guidelines
Connecting Kivy with Anaconda (OSX)
Contextual Menus
Contextual menus
Control alpha of all the children
Create source distribution release on PyPI
Creating a Release APK
Data driven variables with kivy properties
Debugging widget sizes
Deep Linking with iOS and Android
Delayed Work using Clock
Drag and Drop Widgets
Dragable Widget
Draggable Scalable Button
Editable ComboBox
Editable Label
Embedding a Carousel inside a TabbedPanel
GestureBox
Home
Implementing Android Adaptive Icons
KEP001: Instantiate things other than widgets from kv
Kivy 2.0 api breaks
Kivy Blogs and Blog Posts
Kivy Python 2 Support Timeline
Kivy Technical FAQ
Kv language preprocessing
Linking ScreenManager to a different Widget
List of Kivy Projects
Markup Summary
Menu on long touch
Migration guide from legacy garden packages
Moving kivy.garden.xxx to kivy_garden.xxx and kivy.deps.xxx to kivy_deps.xxx
On touch current widget
On touch on current widget
Packaging Kivy apps written in Python 3, targeting Windows using Nuitka
Pyjnius Vibrator Example
Release Checklist
Release notes for 1.10.0
Release notes for 1.11.0
Sample Gestures
Scaler for Retina screen
Scollable Options in Settings panel
Scrollable Label
Setting Up Kivy with various popular IDE's
Setting up Pycharm on OSX (older versions)
Setting up garden with Mac Ports
Setting up kivy with various popular IDE
Simple slider with value in label
Snippet template
Snippets awaiting moderation
Snippets
Starting Kivy App and Service on bootup on Android
Styling a Spinner and SpinnerOption in KV
Talks and tutorials
Theming Kivy
Tiled Maps & Tile Based Movement
Tiling the background of a widget with an image, pixel perfect
Ubuntu Touch
Updating widget content from a items list
User Snippets
Using Asynchronous programming inside a Kivy application
Using Buildozer on windows 10 using WSL
Viewport with fixed resolution autofit to window
Windows RT
Working with Python threads inside a Kivy application
rand0m app
wiki_proposed
11
Deep Linking with iOS and Android
Olivier Boesch edited this page 2021-05-02 12:24:00 +02:00
There is an updated version in this repository: https://github.com/olivier-boesch/intent-demo-for-kivy I used the code below as a starting point
Summary
- author: Hunter Knight
- kivy: >= 1.9.1
Thanks to Python for Dads for the Android tips and ideas for how to handle simultaneous launch of on_resume and on_new_intent.
Also, for iOS you need to Register a Custom URL Scheme, and you'll want to read up on [securing inter-app communication] (https://developer.apple.com/library/content/documentation/Security/Conceptual/SecureCodingGuide/Articles/ValidatingInput.html#//apple_ref/doc/uid/TP40007246)
Please note that this is not a complete, working app demo. You need to integrate the functionality of these methods, and particularly the bindings at the bottom during initialization.
Usage
#!python
from kivy.app import App
from kivy.core.window import Window
from kivy.clock import Clock
class TestApp(App):
resuming = False
processing_uri = False
def on_pause(self):
#
# Handle pause behavior here
#
# set resuming to True so on_new_intent will definitely wait for on_resume
# to finish
self.resuming = True
# Important! on_dropfile events are not received while the event loop is
# paused! This ensures that the event loop will resume before any
# on_dropfile event is fired. Many Bothans died to bring us this information...
if platform == 'ios':
# Set this to True elsewhere in your code if you are pausing to wait for a
# deeplink redirect back to your app (e.g. after FB OAUTH)
if self.processing_uri:
self.processing_uri = False
Clock.schedule_once(self.resume_tasks, -1)
Clock.schedule_once(self.on_resume, -1)
return True
def resume_tasks(self, *args):
Window._pause_loop = False
def on_resume(self):
# In case on_resume and on_new_intent are triggered at launch
self.resuming = True
#
# Handle resume behavior here
#
self.resuming = False
def android_message(self, intent):
while self.resuming:
sleep(0.1)
intent_data = intent.getData()
uri = intent_data.toString()
# send full URI to a cross-platform function to process
self.process_deep_link(uri)
def ios_message(self, window, uri):
# send full URI to a cross-platform function to process
self.process_deep_link(uri)
def process_deep_link(self, uri):
# Validate, parse, do things...
pass
if __name__ == '__main__':
app_instance = TestApp()
if platform == 'android':
import android.activity
android.activity.bind(on_new_intent=app_instance.android_message)
elif platform == 'ios':
Window.bind(on_dropfile=app_instance.ios_message)
app_instance.run()