xamarin.android

Xamarin - How to upgrade Android app and keep files under android data folder

感情迁移 提交于 2019-12-11 06:04:41
问题 I need to deploy a new version of my Android app made with Xamarin. My app stores files in the following path: android > data > APP.PACKAGE_NAME > files > data The problem is those files are wiped after the upgrade and the app needs to resync with the remote server, is this behavior normal or am I missing something ? What I do is upgrade the version number in the properties > Android Manifest, then Archive and deploy the generated apk on my device. 回答1: If your device is rooted, it can be the

ListItems in MvxListView bind inconsistently with Items in MvvmCross 6.4.1 after Upgrading

ε祈祈猫儿з 提交于 2019-12-11 06:02:42
问题 As the title indicates, I am in the process of upgrading the dependencies of an existing Xamarin.Android project. The Android project uses MvvmCross for much of the cross-platform code (we support other platforms as well). As part of this upgrade, we are moving from MvvmCross 6.2.2 to 6.4.1. We are currently building the app with Visual Studio 2019. However, after upgrading, I have noticed that many of my project's layouts no longer bind under as consistently as they did when running. For

Convert AsyncTask to Task in Monodroid/C#

喜夏-厌秋 提交于 2019-12-11 05:45:44
问题 I was wondering how to implement this Android AsyncTask using .NET's async libraries: public class LoadRecordTask : AsyncTask { private Activity1 _context; private int _recordId; public LoadRecordTask( Activity1 outerActivity, int recordId ) { _context = outerActivity; _recordId = recordId; } protected override void OnPreExecute() { base.OnPreExecute(); _progressDialog = Android.App.ProgressDialog.Show( _context , "", "Loading record {0}", _recordId ); } protected override Java.Lang.Object

A way to check if it is in the landscape or portrait mode in Xamarin.Android

一个人想着一个人 提交于 2019-12-11 05:36:20
问题 I'm using C# in Visual Studio 2017 and Xamarin.Android (not Xamarin.Forms) in my project. To be clear, I'm using "Cross Platform App(Xamarin)" and not using "Class Library (Xamarin.Forms). I want it to work on both IOs and Android. My problem is I want to program my app to look like ^ ^ in landscape mode and < ^ in portrait mode(please look at it like it is in portrait mode). Basically I want to rotate the first one and put it on top, and doesn't wanna change the second one and put it on the

Type Provider hangs app when loading data from localhost

99封情书 提交于 2019-12-11 05:28:23
问题 I have reason to believe that the type provider that I'm using is hanging my app that's running on the Android emulator. On my main page within a Xamarin.Forms app, I have the following load operation: protected override void OnAppearing() { _viewModel.Load(); return; // Never gets reached when using Type Provider... } My viewmodel has the following load operation: public void Load() => Cars = new ObservableCollection<Car>(getCars()); My F# code is the following: open FSharp.Data // https:/

Android emulator crash if click while processing

≯℡__Kan透↙ 提交于 2019-12-11 05:25:49
问题 I've been working on an android app and test it on the emulator. Parts of this app require some processing time, such as login, could take up to 10 seconds. If the app is processing the login, and I clicked anywhere on the emulator screen, it will cause the app to crash -> a force close/wait window will pop up and even I choose to wait, this login process will never complete. I wonder did anybody else encounter this situation? What could I do to avoid user clicking during processing and crash

Where to listen for broadcast action with MVVMCross

夙愿已清 提交于 2019-12-11 05:15:55
问题 Making my Bluetooth application I need access to some broadcast actions on the Android side of my code. All this is run in my Core, so I have a ViewModel that will call through my interface public interface IConnectionService { //Properties string IntentName { get; } //Events event EventHandler<SearchConnectionItemEventArgs> SearchItemFoundEvent; //Methods void RunIntent(); void SearchConnection(); void Connect(string macAddress); } RunIntent prompts the user to turn on Bluetooth (Could be

Xamarin android Google Maps API Calculate and display route and calculate routes distance

北慕城南 提交于 2019-12-11 05:08:20
问题 I'm working on mobile android app in C# where I need to display a route and calculate it's distance. I need a result similar like in this picture 回答1: To display a route, you need at first calculate it. You can use google Direction API to do that. The cool thing is, that it will return you a total distance as well. So it's only one request to satisfy all your requirements. Google Directions API have a lot of requests examples, you can calculate road between two places by referencing them by

Binding project inconsistent accessibility on inner classes but can't get transform syntax right

僤鯓⒐⒋嵵緔 提交于 2019-12-11 05:05:30
问题 I've been trying to create a binding project for this token auto complete text view project on GitHub (https://github.com/mattwhetton/TokenAutoComplete). I'm basically trying to port it to us in Xamarin / Mono (C#) I've been immediately getting the following error: Inconsistent accessibility: parameter type 'Com.Tokenautocomplete.TokenCompleteTextView.TokenImageSpan' is less accessible than method 'Com.Tokenautocomplete.TokenCompleteTextView.TokenTextWatcher.RemoveToken(Com.Tokenautocomplete

xamarin android Google maps exception when closing page with map

拈花ヽ惹草 提交于 2019-12-11 04:59:10
问题 I have exception in xamarin forms – in android – when closing a custom map. I am rendering it in android and once every 5~ times I get exception when closing the page with the google maps The exception is as follows: UNHANDLED EXCEPTION: System.NotSupportedException: Unable to activate instance of type Xamarin.Forms.Maps.Android.MapRenderer from native handle b250001d ---> System.MissingMethodException: No constructor found for Xamarin.Forms.Maps.Android.MapRenderer::.ctor(System.IntPtr,