Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all 91519 articles
Browse latest View live

Targeting .NET Standard

$
0
0

I read this article a while ago:
https://blog.xamarin.com/net-standard-library-support-for-xamarin/

So, I converted all of our libraries from portable libraries to .NET Standard (1.4). I did this because the article says "This PCL now needs to be upgraded to target the .NET Standard Library, which can be found in the projects properties.".

However, I can't figure out how to build a Xamarin Forms project that targets .NET Standard. I cloned the Xamarin Forms samples, and opened up the MasterDetailPage project. I went in to the project properties and switched from portable to .NET Standard as per the instructions. Immediately, I get an error telling me that I need to opt in to NuGet 3.0 support. I'm fine with this, but how do I do it?

I found that if I remove the Xamarin Forms NuGet package, I am able to switch over to .NET Standard. However, once I have done this, I can't add the Xamarin Forms NuGet package back. It just keeps failing. Contrary to what the article says, I cannot add references to .NET Standard libraries. When I try to add a reference to existing .NET Standard libraries in my Solution, Visual Studio just gives me an error saying that the library is not compatible. Which version of .NET Standard should I be targeting for Xamarin Forms?

How do I get a .NET Standard library compiling with Xamarin Forms support?


Xam.Plugins.Notifier not working in android

$
0
0

I installed the nuget package, and it is working fine in UWP (both on phone and pc), but I never get any notifications on my android device. I've debugged, and the CrossLocalNotifications.Current.Show() method is being called, with no error, but I just never see the notification. Is there any permissions I am missing? Or could it be my device? (Huawei G9)

Write to SD Card when Android, PCLStorage LocalStorage otherwise

$
0
0

I need to get the external storage path when my app is run on Android, but use PCLStorage.Current.LocalStorage on other platforms. I searched Google and the forums, and every answer says to use Android.OS which is seems to only be available in the Android code for my project. Do I need to make a DependencyService to get the external storage path when on Android, or is there an easier way?

Xam.Plugin.Media not allowing permissions for android

App tour for Xamarin forms app

$
0
0

Hi Developers,
We want to implement the app tour functionality in our Forms app. Please share some references on how to implement this.

Thanks!

Playing audio files in xamarin forms

$
0
0

Hi,
Can anyone tried to play audio files in the application using xamarin forms.If so please show me a way to implement this.

Thanks ,
sunil

Has anyone figured out how to play sound in Xamarin forms? Preferably Android?

$
0
0

I am looking to make an app that uses sounds, but Xamarin.Forms does not have support for sound, and I tried using the tutorial for the media player in Xamarin.Android, but it seems google changed the way it worked, so now it doesn't work even in an android project.

Toolbar item not showing on IOS

$
0
0

Hi, I added a 3rd toolbar item to my toolbar items. It is supposed to display to the left of the Heart. But on IOS it does not show up.

Below is a screenshot:

Any ideas as to why this is happening?


How to validate the server certificate in xamarin forms PCL while calling to the rest calls

$
0
0

In my xamarin forms app i am using HttpClient class to call the rest calls, in my rest url i am using "https" for secure connection every thing is working fine, but the problem is in server certificate is expired even through my rest call is working fine means HttpClient class is bypassing the checks which i dont want. So i want to validate the server certificate host name and expired date etc..

Quick response is highly appreciated.

Why wrapper doesn't see native class when "Enable incremental builds" is enabled?

$
0
0

Hello,
I have solution that contains native library (obj c), and i use this library in my iOS project. Everything works great, but when i disable "Enable incremental builds" in iOS project properties, project compiles, but then crashes with error from native wrapper:

Wrapper type 'PlayReady.MediaRepresentationProtocol' is missing its native ObjectiveC class 'MediaRepresentationProtocol'.

My question is, how i can enable "Enable incremental building" for release purposes (i think it is impossible). Or why my project works only when this option is checked-in?

Regards.

Problem with accordion in listview

$
0
0

Hello,
I've a problem that it's eating a lot of time and I'm unable to solve in a proper way.
I've a listview and each item is defined by an item template declared in an external file that contain the viewcell definition.
My problem is that inside each viewcell I've a stacklayout that I use as accordion closing and opening it with a button.
The strange is that if I leave every item opened when listview appears all seems to be ok, but if I close them (setting IsVisible property of stacklayout both manually than with a Binding) then when I open it (always setting the IsVisible property) the stacklayout take the space that needs but I can't see the elements inside (it appears empty).
I already called the beginfresh and endrefresh on the listview when my accordion is opened, but seems to not work.

Seems that is a bug of the listview rendering.

Does somebody know how to solve it?

Thank you

Vertical Scroll Inside Editor Box

$
0
0

Hi All,

I have one Editor box and i want Vertical scroll inside editor box.

Thanks in advance.

xamarin forms shared preferences

$
0
0

Following Code is written into the Shared Project.

Imported Packages

using Android.Content;
using Android.Preferences;

For Storing the value into the Shared Preference

ISharedPreferences pref = PreferenceManager.GetSharedPreferences("UserInfo", FileCreationMode.Private);
ISharedPreferencesEditor edit = pref.Edit();
edit.PutString("Username", username.Text.Trim());
edit.PutString("Password", password.Text.Trim());
edit.Apply();

For Retrieve the value

ISharedPreferences pref = PreferenceManager.GetSharedPreferences("UserInfo", FileCreationMode.Private);
string userName = pref.GetString("Username", String.Empty);
string password = pref.GetString("Password", String.Empty);

We Got following Error

'Android.Preferences.PreferenceManager' does not contain a definition for 'GetSharedPreferences'

How to use the Shared Preference into Xamarin Forms.?

Show Jarray in a list view

$
0
0

Hi,
I have an JArray like :
[{"user1":"129 ","user2":"129 ","createdTS":"2017-01-01T00:00:00.000Z","reviewId":"321","id":2},{"user1":"129 ","user2":"129 ","createdTS":"2017-02-03T00:00:00.000Z","reviewId":"345","id":3},{"user1":"115 ","user2":"129 ","createdTS":"2016-02-03T00:00:00.000Z","reviewId":"543","id":4},{"user1":"111 ","user2":"129 ","createdTS":"2015-03-06T00:00:00.000Z","reviewId":"567","id":5},{"user1":"123 ","user2":"129 ","createdTS":"2014-03-05T00:00:00.000Z","reviewId":"765","id":6}]}

how can I show it in a list or table with id ?

Currently I did :
foreach (var item in notificationData.Children())
{
var itemProperties = item.Children();

                var user1 = itemProperties.FirstOrDefault(x => x.Name == "id");
                pId = user1.Value.ToString(); ////This is a JValue type
                notificationList.ItemsSource = "A review request received with id " + pId;

};

but it added only one object in the list. Where I am doing wrong?

Xamarin Forms not throwing exception for missing images

$
0
0

I am using shared images in my Xamrin Forms (PCL) project. I have hundreds of images in my project and I want to evaluate them from a list that which one is missing from images directory. If image is available it shows, and if its missing it dowsnt throw any exception.

any help please ???


Xmarin Forms StackLayout Visibility - not refreshing in iOS

$
0
0

Hey guys ,

This is related to the following topic : https://forums.xamarin.com/discussion/86141/major-bug-with-urhosharp-urhosurface-not-resizing-properly-in-ios

I have a feeling it might be related to the Xamarin Forms and not only with Urho

Is there any way to force a layout refresh in iOS when a change happens .

I have 2 stack layout on a page and one of them - i turn the visibility on/off

Works perfect on Android - However the following happens on iOS-

If stack x visibility is initially false , stack y appears full page . When i toggle x true - nothing happens

If stack x visibility is initially trye , stack y and x appears full page . When i toggle x false - x disappears leaving a black area while y remains the same size.

System.IO.Compression It does not work - Microsoft.Bcl.Compression

$
0
0

I've a xamarin form project, when i use this code
...
var re =await client.Execute(request);
var gs = new GZipStream(new MemoryStream(re.RawBytes), System.IO.Compression.CompressionMode.Decompress);
..

to call a web api service that return a compress GZipStream json but xamarin studio debug return me this
"The underlying implementation for System.IO.Compression.dll could not be loaded. Make sure to add a reference to the Microsoft.Bcl.Compression NuGet package from your main application project."

but in my project i've Microsoft.Bcl.Compression and i use FubarCoder.RestSharp.Portable

How can i risolve this problem ?

Thanks
Alex

The LinkAssemblies task failed unexpectedly error after adding ADAL 3.13.8

$
0
0

Hi folks,
After adding nuget pkg Microsoft.IdentityModel.Clients.ActiveDirectory (ver 3.13.8) in our forms project, we are unable to build the droid project in release mode. Its working fine in Debug mode though. We have tried changing target versions and everything, but it still gives the same issue. Please help.
Error is -

Xamarin.Android.XamarinAndroidException: error XA2006: Reference to metadata item 'System.String System.String::Format(System.IFormatProvider,System.String,System.Object,System.Object,System.Object)' (defined in 'Microsoft.IdentityModel.Clients.ActiveDirectory.Platform, Version=3.13.8.999, Culture=neutral, PublicKeyToken=31bf3856ad364e35') from 'Microsoft.IdentityModel.Clients.ActiveDirectory.Platform, Version=3.13.8.999, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be resolved. ---> Mono.Cecil.ResolutionException: Failed to resolve System.String System.String::Format(System.IFormatProvider,System.String,System.Object,System.Object,System.Object)
at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
at Mono.Linker.Steps.MarkStep.ProcessQueue()
at Mono.Linker.Steps.MarkStep.Process()
at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
--- End of inner exception stack trace ---
at Xamarin.Android.Diagnostic.Error(Int32 code, Exception innerException, String message, Object[] args)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() CI_Mobile_App_1.Droid

Thanks!

Playing sounds with Xamarin.Forms

$
0
0

Hi!

I am studying Xamarin, and, as a practice, trying to make a stopwatch which ticks every second, but I didn't found any informatin about working with sounds on forums. Where to find this information?

With best regards!

How to set a custom icon to Navigation Bar Back Icon

$
0
0

I can able to set my custom icon on Navigation Bar while pushing the page
On Device Back or Navigation Back, I'm unable to display my custom Icon, it is displaying default android Back <-

using the below code to set my custom Icon
In constructor of Xaml page I'm using
NavigationPage.SetTitleIcon(this,"close.png")

and In OnAppearing()
NavigationPage.SetTitleIcon(this,"close.png")

Thanks In Advance!!

Viewing all 91519 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>