xamarin.android

Error inflating class com.google.android.youtube.player.YouTubePlayerView in ListView

为君一笑 提交于 2019-12-11 17:23:01
问题 I'm trying to get familiar with YoutubePlayerView and Mvvmcross model using Xamarin tool (for both Android, iOS) I want to create a videolist, when users click into a video, it can be played in ListView but I'm getting an error with Android Binary XML file line #1: Error inflating class com.google.android.youtube.player.YouTubePlayerView My code so far: This is the List: VideoListView.axml: <android.support.v4.widget.SwipeRefreshLayout android:layout_width="match_parent" android:layout_height

Xamarin.Android Crashes When Trying To Load Style From Resource

▼魔方 西西 提交于 2019-12-11 17:20:06
问题 Another day with Xamarin and another issue! So, blank Xamarin.Android project. Created a custom style/shape in the mipmap-anydpi-v26 folder under resources because it's not accessible if i create it elsewhere or even in another new sub-folder. Even there's no drawable folder anywhere in the solution(which is very puzzling for me.) Anyways, here's how it looks : myshape.xml <?xml version="1.0" encoding="utf-8" ?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape=

Multi-select Listview

大兔子大兔子 提交于 2019-12-11 17:19:55
问题 This is my list view it should contain the list of activities came from my SQLite database: <ListView SeparatorVisibility="None" x:Name="lstActivity" HasUnevenRows="True"> <ListView.ItemTemplate> <DataTemplate> <ViewCell> <Frame StyleClass="lstframe" CornerRadius="0" BorderColor="Transparent" HasShadow="False"> <StackLayout StyleClass="lstContainer" VerticalOptions="CenterAndExpand"> <Grid> <Label StyleClass="lstActivityName" Grid.Row="0" Grid.Column="0" Text="{Binding ActivityDescription}">

Toggle audio in speaker to ear-speaker and ear-speaker to speaker

本小妞迷上赌 提交于 2019-12-11 17:01:39
问题 We are using third party Audio/Video SDK in our Xamarin.Forms.Android project. Now problem is that by default audio comes in speaker mode, instead of ear-speaker. I was tried to search solution in internet and found below code to set audio in ear-speaker and speaker. After implement below code audio off in speaker but not able to listen via ear-speaker, if I set SpeakerphoneOn=true then I can listen via Speakerphone but if I set SpeakerphoneOn=false then I can't list via ear-speaker.

Cannot read SQLite file in Xamarin Android project

一个人想着一个人 提交于 2019-12-11 17:00:10
问题 I have a file called Lego_Parts.db3 that is a SQLite file already populated with data. I have it in the assets folder of the Android Xamarin project. The code I have to set the database path is: static PieceDB database; public static PieceDB PieceDatabase { get { if (database == null) { database = new PieceDB(Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "Lego_Parts.db3")); } return database; } } When I try to display the data from the database (in

Xamarin Android save webview in pdf

强颜欢笑 提交于 2019-12-11 16:54:44
问题 I'm developing an app in xamarin for android. The objective is for the user to fill a document and save it as a PDF. I have tried this process: HTML TO PDF I have designed a cshtml file, that contains the same structure as the document, with the input that the user inserted. So far so good, it looks good in the webview. I now wish to convert this to PDF but I can't seem to find a way to convert it. Is there a way to convert CSHTML to PDF, or somehow convert the content of the webview to PDF?

Setting layout properties in code at runtime

為{幸葍}努か 提交于 2019-12-11 16:52:32
问题 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? 回答1: Relevant thread on the Mono for Android

Can't call old webservice in xamarin Android with HTTPClient

萝らか妹 提交于 2019-12-11 16:16:08
问题 I read a lot of thing on using HTTPClient to communicate with an old webservice. Code are in xamarin Forms with .NetStandard (System.Net.Http) I just have this simple code: public async Task<bool> TestKelvinConnectivity() { bool retour = false; using (var client = new HttpClient()) { client.BaseAddress = _baseEnkiWeb; client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/soap+xml")); string Enveloppe = "<soap

Xamarin ZoomIn lags on Android

会有一股神秘感。 提交于 2019-12-11 16:11:30
问题 I have found some code to zoom In and zoom Out for Xamarin Forms. On iOS it's working smoothly but on Android it has some lags, here is video how it working http://fs2.fex.net/get/688885800398/30602583/5998218f/2017_08_07_19_45_28.mp4 I do not have any idea how to make it smoothly, could you help with this ? public class ZoomImage : Image { private const double MIN_SCALE = 1; private const double MAX_SCALE = 1.5; private const double OVERSHOOT = 0.9; private double StartScale; private double

Xamarin.Android: Package XX is not compatible with monoandroid81 (MonoAndroid,Version=v8.1)

送分小仙女□ 提交于 2019-12-11 16:05:01
问题 I encounter a stranger behavior with a Xamarin.Android project in Visual Studio on Windows . I've created a new Android blank project , and I try ton install the NuGet package "AForge" (a mathematics library), but I get the following error message: Package AForge 2.2.5 is not compatible with monoandroid81 (MonoAndroid,Version=v8.1). I've already tried to re create several projects, after having relaunched Visual Studio and the computer, but the problem is still the same. However, if I do the