WEBVIEW no longer work or suported. Need REST code.

Edward Benoit 1 Reputation point
2021-12-01T02:26:59.833+00:00

I need REST code to replace the below WEBVIEW code to execute my web site.
using Android.App;
using Android.OS;
using Android.Support.V7.App;
using Android.Runtime;
using Android.Widget;
// new code below
using System;
using System.IO;
using System.Net;
using System.Text;
using Android.Webkit;
using Android.Content.PM;
using Xamarin.Essentials;

namespace FirstPage_Shopping
{
// [Activity(Label = "@ hide /app_name", Theme = "@STYLE /AppTheme", MainLauncher = true)]
[Activity(Label = "Shopping List Manager", ConfigurationChanges = ConfigChanges.Orientation, MainLauncher = true)]

public class MainActivity : AppCompatActivity  
{  
    protected override void OnCreate(Bundle savedInstanceState)  
    {  
        base.OnCreate(savedInstanceState);  
        Xamarin.Essentials.Platform.Init(this, savedInstanceState);           
        SetContentView(Resource.Layout.activity_main);             
        // Get our UI controls from the loaded layout              
        Button Button1 = FindViewById<Button>(Resource.Id.signinbutton);  
        Button TheRegButton = FindViewById<Button>(Resource.Id.regbutton);  
                     
        Button1.Click += (sender, e) =>  
        {  

            Button1.Visibility = Android.Views.ViewStates.Gone;  
            TheRegButton.Visibility = Android.Views.ViewStates.Gone;  
              
            WebView webView = FindViewById<WebView>(Resource.Id.webView1);  
            webView.Settings.JavaScriptEnabled = true;  
                              
            webView.LoadUrl("https://www.smbudget3.com/shopping_signon.aspx"); // (ok now) err_connection_reset  
                                                                                                                                // webView.LoadUrl("https://www.smbudget3.com/budgetsignonandroid.aspx");  
        };  

        TheRegButton.Click += (sender, e) =>  
        {  

            Button1.Visibility = Android.Views.ViewStates.Gone;  
            TheRegButton.Visibility = Android.Views.ViewStates.Gone;  

            WebView webView = FindViewById<WebView>(Resource.Id.webView2);  
            webView.Settings.JavaScriptEnabled = true;  
            webView.LoadUrl("https://www.smbudget3.com/shopping_registration_Cell.aspx");  
        };  

        // new code copied above  
    }  
    public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)  
    {  
        Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);  

        base.OnRequestPermissionsResult(requestCode, permissions, grantResults);  
    }  
}  

}

Microsoft Partner Center API
Microsoft Partner Center API
Microsoft Partner Center: A Microsoft website for partners that provides access to product support, a partner community, and other partner services.API: A software intermediary that allows two applications to interact with each other.
303 questions
0 comments No comments
{count} votes