Access javascript file locally in Xamarin forms

0

I have a question about how to access a .js file in my application mobile (Andriod) using xamarin forms, as below:

var htmlSource = new HtmlWebViewSource();

htmlSource.Html =
           @"<html>
                <head>
                    <script type='text/javascript'>

                     function LaunchSCO(organizationItemID,href) {
                        alert(""Ola"");
                        windows.API = new teste();
                    }
                    </script>
                  </head>
                  <body>
                        <a href=""javascript:LaunchSCO('4020','');"" style='text-decoration:none;'>Abrir cursoooooS</a>
                        <div id='divCurso'>

                        </div>
                  <--Aqui é o arquivo que eu quero abrir localmente-->
                  <script src=""js/teste.js""></script>
                  </body>
            </html>";

WebView1.Source = htmlSource;

My problem is where do I store this file and how do I access it when I generate my APK.

Note: I looked for File in Xamarin but I did not find a practical way to save and read js file.

    
asked by anonymous 23.05.2018 / 15:38

0 answers