Xamarin.android Visual Studio 2010 or MonoDevelop

I'm very new to Mono for Android and am having issues getting started - specifically as a new user I tend to have to step through code to ensure that it is doing what I want. This is extremely slow using VS 2010 and the latest version of Mono for Android. Just wondering if MonoDevelop will improve matters and whether it is as easy to develop using MonoDevelop rather than VS 2010 which is my normal tool. Thanks for any advice

Xamarin.android How to create a custom List with several columns from a Loop

I need to create a custom List by looping through two sets of data. Below is what I am using but when I attach it to my listview I'm only getting the last record. I tried moving the this.CoeListitem = New List which I know is the problem to above the first loop but that didn't return any records. So how do I set this up to create my List with the correct number of records. Here is my public class CoeList [PrimaryKey, AutoIncrement] public long Id { get; set; } public string Name { get; set

Xamarin.android Error Loading Assemblies in Mono for android

Mono for android was working just fine but after a pc restart I get the following error for my project? The error title is just "Error Loading Assemblies" and the details are in the image below. Any idea what could be the cause? This is happening in monodroid 4.2.2 and it happens both on emulator and a physcal android:

Xamarin.android How to use multiline textview with scrollbars in monodevelop/monoandroid

I am new in monodevelop/monoandroid.I need code for showing multiline text in textview I have tried bellow but still its not working.I think there should be some code that I have to include in .cs file,but I am not getting what to use there. I have used c# code also but its not working. I think ellipsize is a android attribute thats why its not working.Please give me some solution. <ScrollView android:id="@+id/scrollView2" android:layout_width="wrap_content"

Xamarin.android MvvmCross & MvxAdapter & Polymorphic Types with custom controls

I am currently trying to implement my own version of the polymorphic types demo that is located here: https://github.com/MvvmCross/MvvmCross-Tutorials/tree/master/Working%20With%20Collections And I have it working as the demo shows. However, I am looking to extend that demo to have more complex controls inside of the MvxListView. I am wanting to have each of the list items control a fragment that has a View and a core ViewModel for additional processing. I am unsure of the correct way o

Xamarin.android SetError on TextInputLayout not available

I am trying to show validation messages on TextInputLayouts. I should be able to just do this (as with native android): TextInputLayout til = (TextInputLayout) findViewById(R.id.text_input_layout); til.setErrorEnabled(true); til.setError("You need to enter a name"); But it seems like setError method is not available for xamarin? For EditText the setError is available, but don't want that. e.g: TextInputLayout txtI_password = FindViewById<TextInputLayout>(Resource.Id.input_layout_passwo

Xamarin.android The Type initializer for 'Realms.Realm' threw an exception

I am trying to implement Realm on a smaller Xamarin/Mvvmcross/iOS/Droid project in order to test it's ability to replace SQLite. I have it working well on the iOS project but am getting exceptions on the Droid project when attempting to call Realm.GetInstance(); The Type initializer for 'Realms.Realm' threw an exception Inner Exception System.Reflection.ReflectionTypeLoadException The classes in the module cannot be loaded. I have narrowed it what I believe is an issue with reflection if the

Xamarin.android Pullasync error new table

I created a new table in my database using Visual Studio. I created a data objects for my new table, added in my startup.mobileApp, in my controllers and in my model. Whatever i have error with my pullasync()... "the resource you are looking for has been removed had its name changed or is temporarily unavailable xamarin" my item mobile: public class AlertMateriel { public string Id { get; set; } [JsonProperty(PropertyName = "IdMateriel")] public string IdMateriel { get; set; }

Xamarin.android Error in Xamarin Android integrating Intercom

Calling this method: IntercomSdk.Intercom.Client().DisplayMessenger(); I get this exception: [AndroidRuntime] java.lang.NoSuchMethodError: No virtual method onNestedFling(Landroid/support/design/widget/CoordinatorLayout;Landroid/support/design/widget/AppBarLayout;Landroid/view/View;FFZ)Z in class Landroid/support/design/widget/AppBarLayout$Behavior; or its super classes (declaration of 'android.support.design.widget.AppBarLayout$Behavior' appears in /data/app/es.smartloto.smartloto-dvf2COkzG

Xamarin.android How to extract weight value from a Bluetooth LE (SIG) hex value

I'm developing a xamarin android app to connect to a bluetooth low energy weight scale. I can already connect to the device an explore it's services and characteristics, however i'm facing some problems extracting it's value. The scale implements the Bluetooth SIG standards, so i was expecting it to have an Weight Scale service (org.bluetooth.service.weight_scale) and the Weight Measurement characteristic (org.bluetooth.characteristic.weight_measurement). Aparently not. Exploring the device s

Xamarin.android Resource.id does not contain a definition or is not found. It fixes by itself then breaks again

this is mindf**k. When I am trying to build a project it tells me that Resource.Id does not contain a definition, something like "rootView" or "btn1" and etc. Bet when I am going to the path of the error where it occurred it fixes by itself and error disappears, and this insane loop repeats 1000 times. This is Xamarin.Android project btw. This is one of the places where I get these errors, there is like 20 of them. buttonSignin = (Button)FindViewById(Resource.Id.s

Xamarin.Android - Can you set your custom theme in the Visual Studio 2019 Android UI designer?

I'm playing around with styles and themes in my hello world android app: For this I have a custom style as follows in my styles.xml file: <style name="Theme.AppTheme.Custom" parent="@style/Theme.AppCompat.NoActionBar"> <item name="android:windowNoTitle">true</item> <item name="android:windowActionBar">false</item> <item name="android:windowFullscreen">true</item> <item name="color

Xamarin.android MonoDroid Gestures not working for me

I am trying play around with gestures but I can't get them to work. I have this using System; using System.Collections.Generic; using System.Linq; using System.Text; using Android.App; using Android.Content; using Android.OS; using Android.Runtime; using Android.Views; using Android.Widget; namespace Myapp { [Activity(Label = "My Activity")] public class AboutActivity : Activity { private TextView displayText; private GestureDetector gestureScanner; privat

Xamarin.android Get bitmap from URI

I am selecting image from a gallery. This is the code which i am using Intent intent = new Intent(); intent.SetType("image/*"); intent.SetAction(Intent.ActionGetContent); this.StartActivityForResult(Intent.CreateChooser(intent, "Select Picture"), SelectPicture); I am getting this string in data.DataString content://media/external/images/media/11 on Activty result.. Which is not a full path to the selected Image. But ultimatel

Xamarin.android MonoDroid and TimeZoneInfo.ConvertTime

I'm trying to convert the current time to Central Standard Time. With Mono and .NET, these both work. TimeZoneInfo cst = TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time"); TimeZoneInfo.ConvertTime(DateTime.UtcNow, cst); TimeZoneInfo.ConvertTime(DateTime.Now, cst); With MonoDroid 3.0.4, the first one give this error: Unhandled Exception: System.ArgumentException: Kind propery of dateTime is Utc but the sourceTimeZone does not equal TimeZoneInfo.Utc at System.TimeZoneInfo.ConvertT

Xamarin.android I can not build the generated UWP project by Zebble

I created a sample project using Zebble Extension for Visual Studio. The related projects created successfully but unfortunately when I tried to compile the UWP project, the build process failed with the following error: Validation error. error C00CE169: App manifest validation error: The app manifest must be valid as per schema: Line 10, Column 13, Reason: '$solutionname$' violates pattern constraint of '[-.A-Za-z0-9]+'. The attribute 'Name' with value '$solutionname$' failed to parse. How c

Xamarin.android Xam.Plugins.Media for Android 7.0

I must use Android 7 for my app because I am using .NETStandard libraries. Media plugin is not compatible with Android 7. Is there any way to keep my code and use Android 7? using Plugin.Media; using Plugin.Media.Abstractions; private async void TakePhoto_Clicked(object sender, EventArgs e) { await CrossMedia.Current.Initialize(); if (!CrossMedia.Current.IsCameraAvailable || !CrossMedia.Current.IsTakePhotoSupported) { await DisplayAle

Xamarin.android How can I create zip file from byte[] in Android?

How can I create zip file from byte[] in Android? I've tried the following: byte[][] result = service.ToPPC("basedata_71.zip", 71); byte[] first = result[0]; string directory = Android.OS.Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryDownloads).ToString(); directory += "/example.zip"; File.WriteAllBytes(directory, first);

Xamarin.Android NavigationTabStrip

I want to implement the NavigationTabStrip (https://github.com/martijn00/NavigationTabStripXamarin) to my app, but I don't know how. I've seen also the original project, but I'm new in this world. Has anyone a project to help me to implement this? Or is there anyone that knows how to do that? I'm trying to create a TabLayout in material design.

Xamarin.android Xamarin Android Widget: How to change Height of ImageView programmatical?

I have a widget.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/widget" android:layout_width="match_parent" android:layout_height="wrap_content" android:focusable="true" style="@style/WidgetBackground"> <ImageView android:id="@+id/myimage" android:layout_width="20dip" android:layout_height="20dip" android:layout_alignParentRight="true" android:layout_alignParentTop="true"

Xamarin.android CustomRelativeLayout Layout_with and layout_height in PDFTron not working

Hi I have this CustomRelativeLayout in a PDFViewerCtrl in an Android Xamarin project: <pdftron.PDF.Tools.CustomRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="250dp" android:layout_height="250dp" app:posX="50" app:posY="150" app:pageNum="1" android:background="#33AFAFFF" app:zoomWithParent="true"> <View android:layout_width="match_p

Xamarin.android radio button click event isn't fired on first click xamarin android

I have two radio buttons inside a radio group. I want to fill a searchable spinner with different values from a database found in sql server upon clicking on each radio button. I wrote the following code: public class Invoice_hist_frg : Fragment { List<invoice_details> tableItem_invoice = new List<invoice_details>(); RadioButton rdbtn_per_acc, rdbtn_per_item; SearchableSpinner searchableSpinner; private List<KeyValuePair<string, string>&g

Xamarin.Android: Prevent Package folder from external storage on app Uninstall with scope storage?

It'd be convenient if an application I'm writing stored some files to external storage permanently (so they persist after the application has been exited[destroyed]/Uninstalled). I want to take database backup and store some cache and log files. I am targeting Android-11 while previously I was having access to external storage. Is there any way I can have these files not to be removed on an uninstall? Help with example will be really appreciated.

Xamarin.android Setting layout properties in code at runtime

I am having trouble finding out how to set layout properties in my code. My controls are being generated at runtime so I can't set the layout in my xml. I would like to be able to set properties such as android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:layout_weight="1" However I can't find any documentation or examples on how to do this in code. Is it possible with the current version of Mono for Android?

Xamarin.android How to Handle Android hardware backbutton in ExEn?

I am using Mono for Android and ExEn (thx for Andrew Russell). I am not sure this question is specific to Mono for Android or more specific to ExEn. Anyway, I found only Java samples as a result of my searches. I would like to implement a standard game menu navigation using the hardware back button. Currently back button exits the application regardless the state of the gameplay or menu. Thx for answers. -Horo

Xamarin.android Android.Content.Res.Resources+NotFoundException

I have an aplication written in Mono Android that has a form and displays data in a list. The application works fine. But now I am trying to add another field to the layout: <TextView android:id="@+id/textDeliveryNo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="12345" android:textStyle="bold" android:textColor="@color/title" android:textSize="20px" /> I mo

Xamarin.android Monodroid Deleteing GetExternalFilesDir On Every Debug Session (Unwanted Behavior)

I recently upgraded my project to Mono For Android v4.2. With this update, when ever I deploy my app to my device, all files I've previously created in the directory returned by GetExternalFilesDir("db") are deleted. I don't want this behavior. The previous version of M4A I was using did not do this unwanted behavior. Should I be using a different Method to get a directory to store my files in? I have seen getExternalStorageDirectory() suggested but I don't even see that method available in

Xamarin.android How to do control binding in code for MonoDroid?

I am facing an issue with control binding in code in mono droid. I have an activity inheriting from MvxActivity and I saw some article to perform data binding in code using CreateBindingSet(). Can someone tell me what assembly reference I need on my monodroid project to get this method? If possible, can someone help me out with a sample example as well? I am using V3 of MvvmCross. Thanks Amit

Xamarin.android Change Switch Color in Xamarin.Forms?

I want to change the color of switch in android and created custom renderer just like as one of the post from stack overflow: Below is the code public class CustomSwitchRenderer : SwitchRenderer { protected override void OnElementChanged(ElementChangedEventArgs<Switch> e) { base.OnElementChanged(e); if (Control != null) { Control.TextOn = "Yes"; Control.TextOff = "No"; Android.Graphics.Color colorOn = Android.Graphics.Color.Rgb(239, 201, 6);

Xamarin.android Xamarin.UITest Android ScrollView does not expose child element

I am Automating an android App using Xamarin UITest framework and having issues in identifying the UI Elelement within a scrollview widget. REPL command tool for some reason doesn't give me the details of the child elements within a scrollView. Below is my REPL tree command output Repl output App screen The highlighted text is a scrollview and it doesnt appear in the REPL command line output. Android API level is 16. Any help or suggestion greatly appreciated. Thanks in advance.

Xamarin.Android support for OxygenOS

I am doing some research on running Xamarin.Android apps on OxygenOS (https://en.wikipedia.org/wiki/OxygenOS). Unfortunately, information online is scarce on the subject. Appreciate thoughts on the subject. Specifically suggestions around following 2 questions: Will Xamarin.Android apps work on OxygenOS? If yes to the query above, are there any compatibility issues that one needs to be aware off? Appreciate your help! Cheers

Xamarin.android Mobile Center is Xamarin Build is failing with pthread_mutex_lock error

I'm building a Xamarin.Forms app into Xamarin.Android using Visual Studio App Center. The app builds fine in develop and release configurations on my machine, but when I try to build on Mobile Center, the build almost completes (i.e. the MSBuild stage), but then I get this fatal error: mono_os_mutex_lock: pthread_mutex_lock failed with "Invalid argument" (22) ##[error]Error: /Library/Frameworks/Mono.framework/Versions/5/bin/msbuild failed with return code: null

Xamarin.android How to change from default theme to other themeTheme.Material.Light

I change the manifest file to use the following theme: change from: @style/AppTheme to @style/Theme.Material.Light <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="App1.App1" android:installLocation="preferExternal"> <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="27" /> <uses-permission android:name="android.permission.READ_EXTERNAL_S

Xamarin.android How to using Firebase Notification. I can't turn on display device with received notification?

I followed the instructions to send notice of Firebase Notification following the instructions of Microsoft. But when the android device receives the notification does not light up the screen. I tried attaching WakeLock to turn on display but it didn't work? All method are in the OnMessageReceived function. var wakeLock = powerManager.NewWakeLock(WakeLockFlags.ScreenDim | WakeLockFlags.AcquireCausesWakeup, "Demo"); wakeLock.Acquire(2 * 1000); //////Send

Xamarin.android Enabling Hyper-V for VS 2019 Xamarin debugging

I'm running VS Community 2019 16.7.2 on Windows 10 Pro, 2004, 19041.150 I'm on an AMD Ryzen 5 3600 w/ 16 Gb RAM in 64bit mode. At the command line, running systeminfo I get: Hyper-V Requirements: A hypervisor has been detected. Features required for Hyper-V will not be displayed. When I'm in my Xamarin project, I see: 'You can get a greatly improved Android Emulator experience by enabling Hyper-V.` I thought I DID enable Hyper-V. Read through some documentation, but couldn't figure out what

Xamarin.android MonoDroid: How to programatically set TableRow background attribute?

I'm trying to dynamically create some table rows, but on the Table Row I want to set the background attribute like this XML: <TableRow android:background="@drawable/shape" android:layout_marginBottom="5dip"> I tried this: TableRow.LayoutParams p = new TableRow.LayoutParams(this, null); but there is no p.AddRule method? (as quoted from: Setting layout properties in code at runtime) I think I need to construct the params then pass them into the TableRow row = new TableRow(this, p); Id

Xamarin.android Landscape in VS Designer

I'm testing Mono for Android and would create a TableView which always set in Landscape. The designer in VS first showing Landscape but after next opening the .axml file, I get always Portrait style and can't switch to Landscape. Peter Artelt

Xamarin.android openTK transparent texture

I have a problem to make my texture transparent. I'm new to OpentTK so can please someone help me. I'm using ES11. Here is my code where i load texture. GL.BindTexture (All.Texture2D, tex_id); GL.TexParameterx (All.Texture2D, All.TextureMagFilter, (int)All.Linear); GL.TexParameterx (All.Texture2D, All.TextureMinFilter, (int)All.Linear); GL.TexParameterx (All.Texture2D, All.TextureWrapS, (int)All.ClampToEdge); GL.TexParameterx (All.Texture2D, All.TextureW

Xamarin.android Sitecore Mobile SDK for Xamarin

I am working on Sitecore Mobile SDK in Xamarin Android. I downloaded the sample project from https://components.xamarin.com/view/sitecore.mobile.sdk. I modified my code as per my requirement changed instanceUrl and credentials and executed code it is not showing output. My Application Output shows: [MonoDroid] UNHANDLED EXCEPTION: [MonoDroid] Sitecore.MobileSDK.API.Exceptions.RsaHandshakeException: [Sitecore Mobile SDK] Public key not received properly ---> System.Xml.XmlException: Document

Xamarin.android Xamarin forms open view model on notification tap

I am using this code to show notification in notification bar. When the notification is tapped, main activity is launched. Is it possible to launch the view model instead of activity in Xamarin forms app with MvvmCross. Intent notificationIntent = new Intent(context,typeof(MainActivity)); notificationIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); PendingIntent pIntent = PendingIntent.getActivity(context, code,

Xamarin.android launch spinner on click of a button

I'm working on Xamarin android. I want a spinner to show up on a button click or the spinner should be on top of a button, the other way I can say. Sounds crazy but that's the stuff I got in my head a couple of days back! Yeah I've seen Spinner. May be what I'm asking is not part of the plan, but I wanna implement that! UPDATE 2: Let me explain with an example. Consider the Web 2.0 scientific calculator. There is a button π. You long press the button and you will get a drop down. The constant t

Xamarin.android Preload DialogFragment

I have a problem. I created a Android.Support.V4.App.DialogFragment. Now I use this code to show the DialogFragment: var TransDialogFragment = SupportFragmentManager.BeginTransaction(); Shape_Formation_Tutorial ShapeFormationTutorial = new Shape_Formation_Tutorial(); ShapeFormationTutorial.Show(TransDialogFragment, "ShapeFormationTutorial"); The problem is that I have added an animation to this dialog, but the animation isn't smooth at all, because when I try to show the Dialog, first it need

How to set fontFamily for the entire Xamarin.Android application in a single place?

I want to set the fontFamily of the Toolbar's texts, Buttons, TextViews and for all the text of the Xamarin.Andrid application in general. How do I do that in a single place? I tried putting the following in the Base application theme in styles.xml : <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> ..... <item name="fontFamily">@drawable/Exo2_ExtraBold</item> ..... </style> But it only changed

  1    2   3   4   5  ... 下一页 共 5 页