Skip to content

Commit

Permalink
Updates: synchronization, navigation improved, record edit,
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Stretz authored and Stefan Stretz committed Mar 29, 2023
1 parent 5266a66 commit 0aa0c42
Show file tree
Hide file tree
Showing 69 changed files with 663 additions and 265 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<AndroidKeyStore>true</AndroidKeyStore>
<AndroidHttpClientHandlerType>
</AndroidHttpClientHandlerType>
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
<AndroidEnableSGenConcurrent>false</AndroidEnableSGenConcurrent>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -71,14 +71,14 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>3</WarningLevel>
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
<AndroidLinkMode>Full</AndroidLinkMode>
<AndroidLinkMode>None</AndroidLinkMode>
<JavaMaximumHeapSize>512m</JavaMaximumHeapSize>
<AndroidSupportedAbis>armeabi-v7a;x86;x86_64;arm64-v8a</AndroidSupportedAbis>
<AndroidEnableSGenConcurrent>false</AndroidEnableSGenConcurrent>
<AotAssemblies>false</AotAssemblies>
<EnableLLVM>false</EnableLLVM>
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
<AndroidEnableMultiDex>False</AndroidEnableMultiDex>
<AndroidEnableMultiDex>false</AndroidEnableMultiDex>
<BundleAssemblies>false</BundleAssemblies>
<AndroidCreatePackagePerAbi>false</AndroidCreatePackagePerAbi>
<Debugger>Xamarin</Debugger>
Expand Down Expand Up @@ -200,7 +200,7 @@
<Version>2.1.2</Version>
</PackageReference>
<PackageReference Include="NETStandard.Library" Version="2.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Plugin.AudioRecorder">
<Version>1.1.0</Version>
</PackageReference>
Expand Down Expand Up @@ -262,16 +262,16 @@
<PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="28.0.0.3" />
<PackageReference Include="Xamarin.AndroidX.Core">
<Version>1.9.0.1</Version>
<Version>1.9.0.2</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.3.1.1" />
<PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.3.1.2" />
<PackageReference Include="Xamarin.Build.Download" Version="0.11.4" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.3" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.5" />
<PackageReference Include="Xamarin.Forms">
<Version>5.0.0.2515</Version>
<Version>5.0.0.2578</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms.Maps" Version="5.0.0.2515" />
<PackageReference Include="Xamarin.GooglePlayServices.Maps" Version="118.1.0" />
<PackageReference Include="Xamarin.Forms.Maps" Version="5.0.0.2578" />
<PackageReference Include="Xamarin.GooglePlayServices.Maps" Version="118.1.0.1" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\kbs.png">
Expand Down Expand Up @@ -625,7 +625,7 @@
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
<UserProperties XamarinHotReloadWrongLinkerErrorInfoBarKBSAppTaxonFinderDroidHideInfoBar="True" XamarinHotReloadDebuggerTimeoutExceptionKBSAppTaxonFinderDroidHideInfoBar="True" TriggeredFromHotReload="False" />
<UserProperties TriggeredFromHotReload="False" XamarinHotReloadDebuggerTimeoutExceptionKBSAppTaxonFinderDroidHideInfoBar="True" XamarinHotReloadWrongLinkerErrorInfoBarKBSAppTaxonFinderDroidHideInfoBar="True" />
</VisualStudio>
</ProjectExtensions>
</Project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" android:versionName="2.0.2" package="com.kbs.idoapp" android:versionCode="49">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" android:versionName="2.1.2" package="com.kbs.idoapp" android:versionCode="65">
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="31" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Expand All @@ -14,7 +14,7 @@
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<application android:label="BODENTIER hoch 4" android:icon="@drawable/icon" android:theme="@android:style/Theme.Material" android:requestLegacyExternalStorage="true">
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="ENTER CODE HERE" />
<meta-data android:name="com.google.android.geo.API_KEY" android:value="AIzaSyBhurWvGtiqCWV6yyM1dVi783zuxy0onC4" />
<activity android:name=".MainActivity" android:screenOrientation="portrait" android:configChanges="keyboard|keyboardHidden|orientation" />
<provider android:name="android.support.v4.content.FileProvider" android:authorities="com.kbs.idoapp.fileprovider" android:exported="false" android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths"></meta-data>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
using Xamarin.Forms;
using System.Collections.Generic;
using static KBS.App.TaxonFinder.ViewModels.RecordListViewModel;
using Android.Views;
using static Android.Graphics.ImageDecoder;

[assembly: Xamarin.Forms.Dependency(typeof(MobileApi))]
namespace KBS.App.TaxonFinder.Droid.Services
Expand All @@ -25,6 +27,7 @@ public class MobileApi : IMobileApi
//previous versions use below
//private static readonly string _loginUrl = $@"{_serviceUrl}ApplicationUser/Login/Mobile";
private static readonly string _registerUrl = $@"{_serviceUrl}ApplicationUser/Register/Mobile";
private static readonly string _deleteUrl = $@"{_serviceUrl}ApplicationUser/Delete/Mobile";
private static readonly string _adviceServiceUrl_mobile = $@"{_serviceUrl}Advice/SaveAdvice/Mobile";
private static readonly string _adviceServiceUrl_mobileSync = $@"{_serviceUrl}Advice/SyncAdviceList/Mobile";
private static readonly string _adviceServiceUrl_mobileSync_dev = $@"{_serviceUrl_dev}Advice/SyncAdviceList/Mobile";
Expand Down Expand Up @@ -83,6 +86,34 @@ public async Task<string> Register(string userName, string password)
}
}

public async Task<string> DeleteUser(UserDeleteRequest uDRequest)
{
try
{
var handler = new HttpClientHandler()
{
ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator,
MaxRequestContentBufferSize = 256000
};

_client = new HttpClient(handler);
StringContent content = new StringContent(JsonConvert.SerializeObject(uDRequest), Encoding.UTF8, "application/json");

var response = await _client.PostAsync(_deleteUrl, content);

if (response.IsSuccessStatusCode)
{
var response_content = await response.Content.ReadAsStringAsync();
return response_content;
}
return "Löschen fehlgeschlagen.";
}
catch (Exception e)
{
throw e;
}
}

public async Task<string> AddNewUser(string givenname, string surname, string mail, string password, string comment, string source)
{
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
<string>Zum Auswählen von Fotos wird die Foto-Berechtigung benötigt. Damit sollen Fotos zu Fundmeldungen hinzugefügt werden und gespeichert werden. </string>
<key>UIRequiresFullScreen</key>
<true/>
<key>CFBundleShortVersionString</key>
<string>2.0.2</string>
<key>CFBundleVersion</key>
<string>2.0.2</string>
<string>2.1.2</string>
<key>CFBundleShortVersionString</key>
<string>2.1.2</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@
<Version>4.7.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.Platforms">
<Version>6.0.1</Version>
<Version>7.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Win32.Primitives">
<Version>4.3.0</Version>
Expand All @@ -329,7 +329,7 @@
<Version>2.0.3</Version>
</PackageReference>
<PackageReference Include="Newtonsoft.Json">
<Version>13.0.1</Version>
<Version>13.0.3</Version>
</PackageReference>
<PackageReference Include="Plugin.AudioRecorder">
<Version>1.1.0</Version>
Expand All @@ -353,7 +353,7 @@
<Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Collections.Immutable">
<Version>6.0.0</Version>
<Version>7.0.0</Version>
</PackageReference>
<PackageReference Include="System.ComponentModel.TypeConverter">
<Version>4.3.0</Version>
Expand Down Expand Up @@ -401,7 +401,7 @@
<Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Memory">
<Version>4.5.4</Version>
<Version>4.5.5</Version>
</PackageReference>
<PackageReference Include="System.Net.Http">
<Version>4.3.4</Version>
Expand Down Expand Up @@ -491,16 +491,16 @@
<Version>5.0.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.Build.Download">
<Version>0.11.0</Version>
<Version>0.11.4</Version>
</PackageReference>
<PackageReference Include="Xamarin.Essentials">
<Version>1.7.0</Version>
<Version>1.7.5</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms">
<Version>5.0.0.2401</Version>
<Version>5.0.0.2578</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms.Maps">
<Version>5.0.0.2291</Version>
<Version>5.0.0.2578</Version>
</PackageReference>
<PackageReference Include="Xamarin.Plugin.FilePicker">
<Version>2.1.41</Version>
Expand All @@ -518,5 +518,83 @@
<ItemGroup>
<BundleResource Include="Resources\Logo_museum4punkt0.jpg" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\diplopoda.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\chilopoda_forcipules.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\Isopoda.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\tutorial_01.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\tutorial_02.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\tutorial_03.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\tutorial_04.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\tutorial_05.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\tutorial_06.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\tutorial_07.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\tutorial_08.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\tutorial_09.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\pinselfuesser.jpg" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\Saftkugler.jpg" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\Saftkugler2.jpg" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\Saftkugler3.jpg" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\schnurfuesser.jpg" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\Erdkriecher.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\Skolopender.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\Spinnenlaeufer.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\Steinlaeufer.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\bandfuesser2.jpg" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\bohrfuesser.jpg" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\icon.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\Bandfuesser.jpg" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\samenfuesser.jpg" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
</Project>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ public class MobileApi : IMobileApi
private HttpClient _client = new HttpClient() { MaxResponseContentBufferSize = 256000 };

private static readonly string _serviceUrl = "https://www.idoweb.bodentierhochvier.de/api/";
private static readonly string _loginUrl = $"{_serviceUrl}ApplicationUser/Login/Mobile";
//private static readonly string _loginUrl = $"{_serviceUrl}ApplicationUser/Login/Mobile";
private static readonly string _loginUrl = $@"{_serviceUrl}ApplicationUser/Login/MobileV2";
private static readonly string _deleteUrl = $@"{_serviceUrl}ApplicationUser/Delete/Mobile";
private static readonly string _registerUrl = $"{_serviceUrl}ApplicationUser/Register/Mobile";
private static readonly string _adviceServiceUrl_mobile = $"{_serviceUrl}Advice/SaveAdvice/Mobile";
private static readonly string _adviceServiceUrl_mobileSync = $"{_serviceUrl}Advice/SyncAdviceList/Mobile";
private static readonly string _changesServiceUrl = $"{_serviceUrl}Advice/SyncAdvices";
private static readonly string _mailServiceUrl = $"{_serviceUrl}values/Mail/SendFeedback";

private static RecordDatabase _database;

public MobileApi()
Expand Down Expand Up @@ -65,7 +68,8 @@ public async Task<string> Register(string userName, string password)
var response_content = await response.Content.ReadAsStringAsync();
if (response_content.Contains('"'))
{
response_content = JsonConvert.DeserializeObject(response_content) as string;
var response_content_des = JsonConvert.DeserializeObject(response_content);
return response_content_des.ToString();
}
return response_content;
}
Expand Down Expand Up @@ -109,6 +113,34 @@ public async Task<string> AddNewUser(string givenname, string surname, string ma

}

public async Task<string> DeleteUser(UserDeleteRequest uDRequest)
{
try
{
var handler = new HttpClientHandler()
{
ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator,
MaxRequestContentBufferSize = 256000
};

_client = new HttpClient(handler);
StringContent content = new StringContent(JsonConvert.SerializeObject(uDRequest), Encoding.UTF8, "application/json");

var response = await _client.PostAsync(_deleteUrl, content);

if (response.IsSuccessStatusCode)
{
var response_content = await response.Content.ReadAsStringAsync();
return response_content;
}
return "Löschen fehlgeschlagen.";
}
catch (Exception e)
{
throw e;
}
}

public async Task<string> GetChangesByDevice(AuthorizationJson auth)
{
var handler = new HttpClientHandler()
Expand Down
Loading

0 comments on commit 0aa0c42

Please sign in to comment.