xamarin.android

Consuming netstandard13 packages from Xamarin projects

夙愿已清 提交于 2019-12-13 16:23:46
问题 I'm trying to make Npgsql, the PostgreSQL provider for .NET, available for consumption by Xamarin users. Npgsql already supports the .NET Platform Standard (version 3), and the documentation on the standard contains the following sentence: If a library targets .NET Platform Standard version 1.3, it can only run on .NET Framework 4.6 or later, .NET Core, Universal Windows Platform 10 (UWP), and Mono/Xamarin platforms. I can successfully install the Npgsql nuget from my Xamarin.Android project.

Xamarin.Android get object properties from ListView click event

ⅰ亾dé卋堺 提交于 2019-12-13 14:30:07
问题 I am very new to C# (a few weeks) and Xamarin (about a week). I was able to implement the ListView Adapter from the tutorial "Display Entity Collection in ListView on Android (//from http://diptimayapatra.wordpress.com/2013/07/08/xamarin-display-entity-collection-in-listview-in-android/) My problem now is that I have no idea how to handle the click event on the TextView text. The GetView code from my Adapter is: public override View GetView(int position, View convertView, ViewGroup parent) {

GCM unable to start service intent

不想你离开。 提交于 2019-12-13 13:12:33
问题 starting on android P my app is not able to register for a GCM ID. My PushManager code looks like try { GcmClient.CheckDevice(context); GcmClient.CheckManifest(context); String[] senderIds = GcmBroadcastReceiver.SENDER_IDS; foreach (String id in senderIds) { System.Diagnostics.Debug.WriteLine("sender id = " + id); } GcmClient.Register(context, senderIds); if (GcmClient.IsRegistered(context)) { System.Diagnostics.Debug.WriteLine("push registration successfull: " + GcmClient.GetRegistrationId

Cannot implicitly convert type 'System.IO.Stream' to 'Java.IO.InputStream'

人走茶凉 提交于 2019-12-13 13:07:55
问题 I referred some similar questions on SO but none of them deals with IO . I had used the same code in java when I used Eclipse . That time it worked. But now I try to use this code in Mono for Android (C#), it doesn't work. I'm trying to run this code to create an InputStream : InputStream myInput =ctx.Assets.Open(DATABASE_NAME + ".db"); But it is giving me compile-time error : Cannot implicitly convert type 'System.IO.Stream' to 'Java.IO.InputStream' There is a direct function to copy a file

Xamarin build ERROR : error APT0000: In <declare-styleable> …, unable to find attribute

↘锁芯ラ 提交于 2019-12-13 12:25:35
问题 I received a project from another developer. I setup my machine. VS-2017 with the required components was already configured. Android SDK-Manager has the corresponding version installed. Project is configured to compile with Android 7.1 (Nougat) . Starting the build I get one error 1>ERROR : error APT0000: In <declare-styleable> AppBarLayout, unable to find attribute android:keyboardNavigationCluster It is unclear to me, were I need to set this information, or were this information is needed.

Create View Model using MVVMCross built in factory?

天大地大妈咪最大 提交于 2019-12-13 12:15:52
问题 I have a situation where I want to "resolve" view models without having to manually call out to the IoC container to resolve a viewmodels dependencies. I'm assuming that internally Mvvmcross has a viewmodel factory used to create viewmodels while injecting their dependencies. Can I call into that directly? If so, what is it called and what namespaces do these factories reside in? Essentially what I'm trying to do is create a "HomeViewModel" for a tabcontroller but don't want to hardcode the

Xamarin Android application context is null

南楼画角 提交于 2019-12-13 10:32:02
问题 As I said in the heading, this is my problem. Why can't I access the context in my class? Is there any way I could get the instance of the context in this class? [Service(Exported = false), IntentFilter(new[] { "com.google.android.c2dm.intent.RECEIVE" })] class MyGcmListenerService : GcmListenerService { public override void OnMessageReceived(string from, Bundle data) { string msg = data.GetString("message"); // the app breaks here ShowPopup(msg); Log.Info("GcmLstnrService", "From: " + from);

Xamarin.forms: How to add image list inside Listview

爱⌒轻易说出口 提交于 2019-12-13 09:51:01
问题 I am using Xamarin.Forms having two projects: Android and IOS I have a Listview and I want to add a List of Images in that Listview I want to design UI as per the image below Please help. 回答1: if u can use customlistView renderer, u can do design UI as per the given image Xamarin.core NativeListView Renderer namespace My.Renderer { public class NativeListView : ListView { public static readonly BindableProperty ItemsProperty = BindableProperty.Create("Items", typeof(IEnumerable<DataSource>),

Xamarin Forms Map pin renderer open page

浪尽此生 提交于 2019-12-13 09:50:52
问题 I am prety new with Renderers on Xamarin. I am following this tutorial (https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/custom-renderer/map/customized-pin/) to make a custom pin. The problem it's the following: I need to do a custom pin, the custom pin only has 2 default labels and 1 Button. That button needs open a page from PCL project. How can I do that click button go to PCL page? 回答1: You can send a message from your custom MapRenderer whenever a pin is

Design and print PDF in Xamarin.Forms

女生的网名这么多〃 提交于 2019-12-13 09:28:36
问题 I am working on a Xamarin.Forms project. I have to create an ID card from the details provided, in a certain format and print the same. How can this be done? Has anyone tried something like this? 回答1: Disclaimer: I have NOT tried the following solution myself. There is no out-of-the-box support in Xamarin.Forms for printing PDF. The best practice, in terms of safety and native-performance, would be to use Dependency Injection by defining an interface in the portable (CPL or .NET Standard)