correction probleme android (reste probleme serializer)

code
Vivien DUFOUR 2 years ago
parent e45a9391f9
commit b3db1aec47

@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31611.283
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MusiLib", "MusiLib\MusiLib.csproj", "{8A10FC03-4412-41B1-96AB-A0AA658B2237}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MusiLib", "MusiLib\MusiLib.csproj", "{0990C3B0-336B-4149-A13E-1E10F136A8A8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -11,12 +11,12 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8A10FC03-4412-41B1-96AB-A0AA658B2237}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8A10FC03-4412-41B1-96AB-A0AA658B2237}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8A10FC03-4412-41B1-96AB-A0AA658B2237}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{8A10FC03-4412-41B1-96AB-A0AA658B2237}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8A10FC03-4412-41B1-96AB-A0AA658B2237}.Release|Any CPU.Build.0 = Release|Any CPU
{8A10FC03-4412-41B1-96AB-A0AA658B2237}.Release|Any CPU.Deploy.0 = Release|Any CPU
{0990C3B0-336B-4149-A13E-1E10F136A8A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0990C3B0-336B-4149-A13E-1E10F136A8A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0990C3B0-336B-4149-A13E-1E10F136A8A8}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{0990C3B0-336B-4149-A13E-1E10F136A8A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0990C3B0-336B-4149-A13E-1E10F136A8A8}.Release|Any CPU.Build.0 = Release|Any CPU
{0990C3B0-336B-4149-A13E-1E10F136A8A8}.Release|Any CPU.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

@ -1,8 +1,4 @@
using Android;
using AndroidX.Core.App;
using AndroidX.Core.Content;
using Android.OS;
using Java.Security;
using Microsoft.Maui.Controls.PlatformConfiguration;
using MusiLib.Model;
using System;
using System.Collections.Generic;
@ -11,15 +7,12 @@ using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using Android.Content.PM;
using Android.App;
namespace MusiLib.DataContractPersistance
{
public class DataContractPers : IPersistanceManager
{
private static readonly int requestCode = 100;
public string FilePath { get; set; } = Path.Combine(Android.OS.Environment.DataDirectory.AbsolutePath, "fr.vivienmaxime.musilib");
public string FilePath { get; set; } = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "/musilib";
public string FileNameP { get; set; } = "UserFavoris.xml";
public string FileNameU { get; set; } = "UserData.xml";
@ -46,7 +39,6 @@ namespace MusiLib.DataContractPersistance
if (!Directory.Exists(FilePath))
{
System.Diagnostics.Debug.WriteLine("Directory créé à l'instant");
System.Diagnostics.Debug.WriteLine(Directory.GetDirectoryRoot);
System.Diagnostics.Debug.WriteLine(FilePath);
Directory.CreateDirectory(FilePath);
}

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MusiLib.MainPage">
<ScrollView>
<VerticalStackLayout
Spacing="25"
Padding="30,0"
VerticalOptions="Center">
<Image
Source="dotnet_bot.png"
SemanticProperties.Description="Cute dot net bot waving hi to you!"
HeightRequest="200"
HorizontalOptions="Center" />
<Label
Text="Hello, World!"
SemanticProperties.HeadingLevel="Level1"
FontSize="32"
HorizontalOptions="Center" />
<Label
Text="Welcome to .NET Multi-platform App UI"
SemanticProperties.HeadingLevel="Level2"
SemanticProperties.Description="Welcome to dot net Multi platform App U I"
FontSize="18"
HorizontalOptions="Center" />
<Button
x:Name="CounterBtn"
Text="Click me"
SemanticProperties.Hint="Counts the number of times you click"
Clicked="OnCounterClicked"
HorizontalOptions="Center" />
</VerticalStackLayout>
</ScrollView>
</ContentPage>

@ -0,0 +1,24 @@
namespace MusiLib;
public partial class MainPage : ContentPage
{
int count = 0;
public MainPage()
{
InitializeComponent();
}
private void OnCounterClicked(object sender, EventArgs e)
{
count++;
if (count == 1)
CounterBtn.Text = $"Clicked {count} time";
else
CounterBtn.Text = $"Clicked {count} times";
SemanticScreenReader.Announce(CounterBtn.Text);
}
}

@ -1,20 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace MusiLib.Model
{
[DataContract]
public class Partition
{
[DataMember]
public static int idTotal = 0;
[DataMember]
public string Nom { get; private set; }
[DataMember]
public int IdPartition { get; private set; }
[DataMember]
public string Auteur { get; private set; }
[DataMember]
public int Complexite { get; private set; }
[DataMember]
public string Description { get; private set; }
[DataMember]
public string Instrument { get; private set; }
[DataMember]
public string Son { get; private set; }
public Partition(string nom, string auteur, int complexite, string description, string instrument)

@ -1,17 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace MusiLib.Model
{
[DataContract]
public class Utilisateur
{
[DataMember]
public static int IdTotal = 0;
[DataMember]
public int IdUtilisateur { get; private set; }
[DataMember]
public string Nom { get; private set; }
[DataMember]
public List<Partition> Favoris { get; private set; }

@ -5,6 +5,4 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>

@ -8,7 +8,7 @@
<Identity Name="maui-package-name-placeholder" Publisher="CN=User Name" Version="0.0.0.0" />
<mp:PhoneIdentity PhoneProductId="85C0CD4C-62D6-4A47-89C0-F461EA43C20C" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
<mp:PhoneIdentity PhoneProductId="7A9D67B0-FF6A-4546-AA1E-E6121BBFFCCD" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
<Properties>
<DisplayName>$placeholder$</DisplayName>

Loading…
Cancel
Save