Coding a Xamarin Android App to Connect to a Cloud Hosted MySQL Database in C#

Поділитися
Вставка
  • Опубліковано 29 сер 2024

КОМЕНТАРІ • 30

  • @Roman-uy7qp
    @Roman-uy7qp Рік тому +2

    I love it when I find a video and it's just exactly what I have spent three days looking for.

  • @socialhits1239
    @socialhits1239 4 роки тому +7

    good video i wish you would explained the database tables and structures as well

  • @sohailhalaseh138
    @sohailhalaseh138 2 роки тому +1

    Thank you for the great and very clear video. You saved my time, thanks a lot

    • @indierevo3495
      @indierevo3495  2 роки тому

      Thanks for the feedback. I'm glad the video helped.

  • @siddragon5
    @siddragon5 4 роки тому +2

    hey! great video. Could you please make a video for the same using a cross platform and a little more insight on the sql database on the google cloud platform?

  • @motorparadise
    @motorparadise 3 роки тому +3

    can you provide a video describing the google cloud setup for this exact same video and the same database you used in this video.

  • @ghadahassen2093
    @ghadahassen2093 3 роки тому

    Great great video, very clear and helpful , thanks a lot.

  • @LyubomirLalovMulti
    @LyubomirLalovMulti 3 роки тому +3

    I need help. I cant connect to my MySQL database and you don't describe how You do that. Because "server=server;user=user;password=password;database=database" does not help and I can't understand how to enter my parameters "localhost;root;1;database" wich I have.

    • @wawontito7658
      @wawontito7658 2 місяці тому

      In your case, if you're using an emulator or a physic device, the localhost it´s that cellphone (real or emulated), so you must enter the IP adress of your computer, you can gei it by typing the command "ipconfig" in the cmd panel.

  • @jeromemunsami
    @jeromemunsami 2 роки тому +1

    Thank you so much!

  • @benpav
    @benpav 4 роки тому +2

    Thanks for the clear & concise walkthrough, really appreciate it. Though when I try to install the Xaramin.MySQL.Data package I end up with an error telling me the package is not compatible with Universal Windows Programs. I'm building an Xaramin app targeting Windows, Android & iOS. Any ideas on how to solve this?
    My first thought was to use the regular MySQL.data.dll exclusively for UWP while using Xaramin.mysql.data.dll for Android & iOS. Though this is my first Xaramin app and I'm not familiar with how to segment the dependencies like that.

    • @indierevo3495
      @indierevo3495  3 роки тому +1

      Hey sorry I'me not sure how to fix that error, as I only develop for iOS and Android, not UWP.

    • @benpav
      @benpav 3 роки тому +2

      @@indierevo3495 Np, to any future readers the fix was to install Xb.db.Mysql & MySqlConnector packages on all projects. They use the exact same high level classes as the package shown in the video, you can still follow any MySQL in C# tutorial.

    • @LyubomirLalovMulti
      @LyubomirLalovMulti 3 роки тому

      This tutorial is for Android Xamarin, not for Xamarin.Forms.

  • @socialhits1239
    @socialhits1239 4 роки тому +2

    please if possiable add another video for authentication used in xamarin login form using mysql or other dbs thanks!

  • @iownslaves
    @iownslaves 4 роки тому

    GOOD STUFF! WAY BETTER AND EASIER TO UNDERSTAND!

  • @howardhaney408
    @howardhaney408 3 роки тому +1

    Followed the above tutorial but not able to connect to google cloud mysql database. I have used both the connection name and public IP address for the server name but keep getting error. Can you please show me what the server name should be. you do not show this in above video - just say get from google. - thank kindly

  • @ab1canales
    @ab1canales 2 роки тому

    What version of Visual Studio you are using? because in my project I don't get the activity_main.xml file. Thanks for your help.

    • @indierevo3495
      @indierevo3495  2 роки тому

      Hi, I use VS 2019 Community edition, at software version 16.7.7. Did you download the templates that are used for this type of project? You may need to run the VS installer first and pick the Mobile Development with .NET installation option.

  • @1klikvideos
    @1klikvideos 4 роки тому

    await conn.OpenAsync(); throws an error: System.TypeInitializationException: The type initializer for 'MySql.Data.MySqlClient.MySqlConfiguration' threw an exception. ---> System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.PlatformNotSupportedException: Operation is not supported on this platform. at System.Configuration.ClientConfigPaths..ctor (System.String exePath, System.Boolean includeUserConfig) [0x00050]

  • @YangirovDanir
    @YangirovDanir 3 роки тому

    I have error keywood not supported. How fix it?

  • @hugoalmeida853
    @hugoalmeida853 3 роки тому

    i don´t understand why i need to write the code for connect with the database and after that delet it and write another code. You talk about google cloud, but i don't know what it is. Can u help me and explain better please?

    • @indierevo3495
      @indierevo3495  3 роки тому

      What part of the video do you mean? Can you send me the time that this "delete" code appears at?

    • @hugoalmeida853
      @hugoalmeida853 3 роки тому

      ​@@indierevo3495 nvm, you just used "#region" and I didn't know that ahahah

    • @indierevo3495
      @indierevo3495  3 роки тому

      No problem, glad you figured it out :-)

  • @legendevent3911
    @legendevent3911 Рік тому

    Hey, nice job!!
    But I get an array error:
    System.IndexOutOfRangeException: 'Index was outside the bounds of the array.'
    My code is this:
    ArrayList data = new ArrayList();
    ListView listView1;
    protected override void OnCreate(Bundle savedInstanceState)
    {
    base.OnCreate(savedInstanceState);
    Xamarin.Essentials.Platform.Init(this, savedInstanceState);
    // Set our view from the "main" layout resource
    SetContentView(Resource.Layout.activity_main);
    listView1 = FindViewById(Resource.Id.listView1);
    LoadData();
    }
    and the method:
    private async void LoadData()
    {
    MySqlConnection conn = new MySqlConnection(Constants.connectionString);
    await conn.OpenAsync();
    MySqlCommand cmd = new MySqlCommand(Constants.selectAllQueryHistory, conn);
    cmd.Connection= conn;
    MySqlDataReader rdr = cmd.ExecuteReader();
    if(rdr.HasRows)
    {
    while (rdr.Read())
    {
    data.Add(rdr[1]);
    }
    rdr.Close();
    listView1.Adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, data);
    }
    }
    But I do not understand why I get an ArrayError.
    My Database has 8 rows but rdr[1] should be "itemName" in Database. Maybe you can help me?