File tree Expand file tree Collapse file tree
pythonforandroid/bootstraps/webview/build/templates Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,32 +18,29 @@ public class WebViewLoader {
1818 public static void testConnection () {
1919
2020 while (true ) {
21- if (WebViewLoader .pingHost ("localhost" , 5000 , 100 )) {
22- Log .v (TAG , "Cuccessfully pinged localhost:5000 " );
21+ if (WebViewLoader .pingHost ("localhost" , {{ args . port }} , 100 )) {
22+ Log .v (TAG , "Successfully pinged localhost:{{ args.port }} " );
2323 Handler mainHandler = new Handler (PythonActivity .mActivity .getMainLooper ());
2424
2525 Runnable myRunnable = new Runnable () {
2626 @ Override
2727 public void run () {
28- PythonActivity .mActivity .mWebView .loadUrl ("http://127.0.0.1:5000 /" );
28+ PythonActivity .mActivity .mWebView .loadUrl ("http://127.0.0.1:{{ args.port }} /" );
2929 Log .v (TAG , "Loaded webserver in webview" );
3030 }
3131 };
3232 mainHandler .post (myRunnable );
3333 break ;
3434
3535 } else {
36- Log .v (TAG , "Could not ping localhost:5000 " );
36+ Log .v (TAG , "Could not ping localhost:{{ args.port }} " );
3737 try {
3838 Thread .sleep (100 );
3939 } catch (InterruptedException e ) {
4040 Log .v (TAG , "InterruptedException occurred when sleeping" );
4141 }
4242 }
4343 }
44-
45- Log .v (TAG , "testConnection finished" );
46-
4744 }
4845
4946 public static boolean pingHost (String host , int port , int timeout ) {
You can’t perform that action at this time.
0 commit comments