xamarin.android

How to reference SQLite database that already exists in Xamarin.Android?

喜你入骨 提交于 2021-01-28 16:45:58
问题 I have created SQLite database and have copied it in the root of the project like that: The database is called MobileSell.db It appears in Visual Studio like that: My question is how can I reference it so afterwards I can say connection.InsertIntoTableArticles(value)(this is pseudo code) 回答1: You can refer to this. There only three steps to achieve it: 1) Create Assets folder which is parallel with Resources folder in your project, put your .db file into it. 2) Copy the .db file to SDCard

How to reference SQLite database that already exists in Xamarin.Android?

我们两清 提交于 2021-01-28 16:45:57
问题 I have created SQLite database and have copied it in the root of the project like that: The database is called MobileSell.db It appears in Visual Studio like that: My question is how can I reference it so afterwards I can say connection.InsertIntoTableArticles(value)(this is pseudo code) 回答1: You can refer to this. There only three steps to achieve it: 1) Create Assets folder which is parallel with Resources folder in your project, put your .db file into it. 2) Copy the .db file to SDCard

Shell navigation bar scroll behavior

限于喜欢 提交于 2021-01-28 14:11:30
问题 I would like to ask if it is possible to animate the Navigation Bar or TabbedPage ( TabLayout ) in the Xamarin.Forms Shell when scrolling it either hides or the discovery see gif. I tried it in Xamarin native android there it works after adding layout_scrollFlags . http://lomza.totem-soft.com/appbarlayout-scroll-behavior-with-layout_scrollflags http://karthikraj.net/2016/12/24/scrolling-behavior-for-appbars-in-android 回答1: Not sure if you can achieve this behavior with an android style in XF

Conversion of ByteBuffer in Xamarin.Android

余生长醉 提交于 2021-01-28 11:52:08
问题 How to convert the following code to C# from Android (Java)? ByteBuffer bb; Type = bb.GetInt(); I tried to change this to C# as Type = bb.Int; but I am getting wrong values. Please let me know how to convert Java code to C# code 回答1: See here: https://developer.xamarin.com/api/type/Java.Nio.ByteBuffer/ You can use (int)(bb.Get()); Get the value as a sbyte and cast to integer. 来源: https://stackoverflow.com/questions/43117553/conversion-of-bytebuffer-in-xamarin-android

Xamarin.Android crash only on Android 10

南笙酒味 提交于 2021-01-28 09:11:36
问题 I have a project that is working perfectly in any version below api 29. When i try to run in a Android 10 device the app crashes after show the splash screen, debugger show this error: Java.Lang.RuntimeException: Binary XML file line #17 in com.panterafood.garcom:layout/abc_screen_simple: Binary XML file line #17 in com.panterafood.garcom:layout/abc_screen_simple: Error inflating class android.support.v7.widget.FitWindowsLinearLayout at Java.Interop.JniEnvironment+InstanceMethods

NuGet package install fails “Package restore failed. Rolling back package changes for <xamarin.android>”

冷暖自知 提交于 2021-01-28 08:03:26
问题 Installing any package fails with this error, updating packages also creates this error. Clearing the NuGet cache files causes this error to change to "access to the path mono.cecil.dll is denied" when trying to install "Xamarin.GooglePlayServices.Ads". Restarting visual studio causes the package restore error to come back. Versions: OS: win 10 Visual Studio Information: https://pastebin.com/vnuyZMWk Xamarin.Forms Project: Target framework: .NET 2.0 Xamarin.Android project: Minimum Android

Does DisplayActionSheet exist in Xamarin.Android?

霸气de小男生 提交于 2021-01-28 07:25:25
问题 I am new to mobile development. I'm trying to write an app in both Xamarin iOS and Xamarin Android. After searching for a couple of days, I keep finding that DisplayActionSheet is part of Xamarin Forms, but I can't find the equivalent in Xamarin Android. Does DisplayActionSheet not exist? Is there anything else I can use to get the same look and effect? Thank you! Update: Here's my progress... I'm trying to make a dialog that looks like this the image here: https://www.google.com/search?q

Xamarin.Forms Android VS2017 debug not showing XAML changes

落花浮王杯 提交于 2021-01-28 06:08:54
问题 In Visual Studio 2017, I start a brand new Xamarin.Forms solution, PCL and Blank App template. Here is what the MainPage.xaml content looks like: <Label Text="Welcome to Xamarin Forms!" VerticalOptions="Center" HorizontalOptions="Center" /> Using the Visual Studio Android emulator, I start a debug session, to confirm its working, and then close it. Then I make a small change the MainPage.xaml file, for example: <StackLayout HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand"

Xamarin android - take picture from camera then pass it to other activity

柔情痞子 提交于 2021-01-28 05:27:04
问题 I am new to xamarin and I want to take a picture from the camera when I click on a button on my mainactivity and then, once the picture taken, display it in an imageView in an other activity. Can you help me? Here's what I have right now : MainActivity : costsButton.Click += delegate { Intent intent = new Intent(MediaStore.ActionImageCapture); StartActivityForResult(intent, 0); }; protected override void OnActivityResult(int requestCode, Result resultCode, Intent data) { base.OnActivityResult

Shell navigation bottom and upper TabBar scroll behavior

≡放荡痞女 提交于 2021-01-28 02:39:16
问题 In follow-up of Shell navigation bar scroll behavior, I have created a custom Shell renderer toolbar with scroll behavior and I would like to know if it is possible to create the same for TabBar or Tab in Shell. See Gif https://android.jlelse.eu/scroll-your-bottom-navigation-view-away-with-10-lines-of-code-346f1ed40e9e using LP = Android.Views.ViewGroup.LayoutParams; public class CustomShell : ShellRenderer { public CustomShell(Context context) : base(context) { } protected override