kivy webview android apk

234 views
Skip to first unread message

Ajay Kumar

unread,
Jul 23, 2016, 5:37:11 AM7/23/16
to Kivy users support
hi Im trying to create a webview app in kivy and I got this reference https://github.com/kivy/kivy/wiki/Android-native-embedded-browser and tried with this 
import kivy                                                                                     
from kivy.app import App                                                                        
from kivy.lang import Builder                                                                   
from kivy.utils import platform                                                                 
from kivy.uix.widget import Widget                                                              
from kivy.clock import Clock                                                                    
from jnius import autoclass                                                                     
from android.runnable import run_on_ui_thread                                                   

WebView = autoclass('android.webkit.WebView')                                                   
WebViewClient = autoclass('android.webkit.WebViewClient')                                       
activity = autoclass('org.renpy.android.PythonActivity').mActivity                              

class Wv(Widget):                                                                               
    def __init__(self, **kwargs):                                                               
        super(Wv, self).__init__(**kwargs)                                                      
        Clock.schedule_once(self.create_webview, 0)                                             

    @run_on_ui_thread                                                                           
    def create_webview(self, *args):                                                            
        webview = WebView(activity)                                                             
        webview.getSettings().setJavaScriptEnabled(True)                                        
        wvc = WebViewClient();                                                                  
        webview.setWebViewClient(wvc);                                                          
        activity.setContentView(webview)                                                        
        webview.loadUrl('http://www.google.com')

class ServiceApp(App):                                                                          
    def build(self):                                                                            
        return Wv()                                                                             

if __name__ == '__main__':                                                                      
    ServiceApp().run()

I did package for android with buildozer and tried in android device , but getting err: erroe_cache_miss
I dono what i have missed can any one suggest me for this to run. Thanks in advance

Alexander Taylor

unread,
Jul 23, 2016, 4:24:08 PM7/23/16
to Kivy users support
Can you post the full logcat output with log_level=2?

Ajay Kumar

unread,
Jul 24, 2016, 1:55:19 PM7/24/16
to kivy-...@googlegroups.com
HI Alexander Taylor, I solved this issue, I missed to enable the Internet permission in spec file, now it is working well , thanks 

--
You received this message because you are subscribed to a topic in the Google Groups "Kivy users support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kivy-users/WJuUL9Q9Hys/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kivy-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages