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

CachedImage FFImageLoading for Xamarin.Forms

$
0
0

https://github.com/molinch/FFImageLoading or https://github.com/daniel-luberda/FFImageLoading/ (new Forms features)

DEMO: https://github.com/daniel-luberda/FFImageLoading/tree/master/samples/ImageLoading.Forms.Sample

Caching support

The library automatically deduplicates similar requests: if 100 similar requests arrive at same time then one real loading will be performed while 99 others will wait. When the 1st real read is done then the 99 waiters will get the image.

Both a memory cache and a disk cache are present.

By default, on Android, images are loaded without transparency channel. This allows saving 50% of memory since 1 pixel uses 2 bytes instead of 4 bytes in RGBA (it can be changed).

WebP support

WebP is supported on both iOS and Android.

Downsampling

Downloaded images can be automatically downsampled to specified size (less memory usage). DownsampleHeight and DownsampleWidth properties

Retry

Downloads can be repeated if not succeeded: RetryCount and RetryDelay properties.

Placeholders support

  • LoadingPlaceholder

  • ErrorPlaceholder

image image

After this pull it'll also support Transformations!
https://github.com/molinch/FFImageLoading/pull/47

Transformations support

It doesn't modify original source images. Example:

  • RoundedTransformation

  • CircleTransformation

  • GrayscaleTransformation

image image

... and some more features. Feel free to test it. Not all features are on nuget yet (older version).


Can I use an older Mac system for building and testing on the emulators ?

$
0
0

Using VS 2015 Community, for the time being only doing PCL, made it to the point that I want to start testing on MAC. Not a MAC person. Somewhere (months ago when I was just starting out , in some forum...I cannot find that posting now), someone told me to not buy any hardware older than 2013, that the minimum required OS for Xamarin, would not work correctly on earlier hardware. Is that still true? Macs are not cheap! I currently see two postings on Craigslist. There is a 2007 20 inch iMAC, with 10.11.6 El Capitan for $300.00, and another 2007 24 inch iMac for 200, again with 10.11.6 (both fairly close to where I live). I would prefer something portable, but for primarily building and testing, those prices are more in my ballpark. Would any future changes to Xamarin, quickly rule out their possible usefulness (if they are useful at all now)?

Set AutomationId for cells in TableView control

$
0
0

Need to add AutomationId for cells in TableView control, like:

<TableSection>
          <views:customView AutomationId="CustomId"
                Text="someText" Detail="{Binding ......}"
                Command="{Binding ........}"
                IsRequired="True" />
</TableSection>

But the AutomationIds are ignored and not rendered at runtime. Could anyone help with Idea how to force add them?

ColorStateList in Xamarin.Forms on C#

$
0
0

Greetings!

I am trying to create custom renderer for control (radiobutton) and need to change it's color scheme:

int[][] states = new int[][] {
new int[] { android.R.attr.state_enabled}, // enabled
new int[] {-android.R.attr.state_enabled}, // disabled
new int[] {-android.R.attr.state_checked}, // unchecked
new int[] { android.R.attr.state_pressed} // pressed
};

int[] colors = new int[] {
Color.BLACK,
Color.RED,
Color.GREEN,
Color.BLUE
};

ColorStateList myList = new ColorStateList(states, colors);

The question is:
How can I address control states ( for ex. "android.R.attr.state_enabled" etc.) in C# ?

I am sure you know it!
Thanks in advance

ColorStateList in Xamarin.Forms on C#

$
0
0

Greetings!

I am trying to create custom renderer for control (radiobutton) and need to change it's color scheme:

int[][] states = new int[][] {
new int[] { android.R.attr.state_enabled}, // enabled
new int[] {-android.R.attr.state_enabled}, // disabled
new int[] {-android.R.attr.state_checked}, // unchecked
new int[] { android.R.attr.state_pressed} // pressed
};

int[] colors = new int[] {
Color.BLACK,
Color.RED,
Color.GREEN,
Color.BLUE
};

ColorStateList myList = new ColorStateList(states, colors);

The question is:
How can I address control states ( for ex. "android.R.attr.state_enabled" etc.) in C# ?

I am sure you know it!
Thanks in advance

ColorStateList in Xamarin.Forms on C#

$
0
0

Greetings!

I am trying to create custom renderer for control (radiobutton) and need to change it's color scheme:

int[][] states = new int[][] {
new int[] { android.R.attr.state_enabled}, // enabled
new int[] {-android.R.attr.state_enabled}, // disabled
new int[] {-android.R.attr.state_checked}, // unchecked
new int[] { android.R.attr.state_pressed} // pressed
};

int[] colors = new int[] {
Color.BLACK,
Color.RED,
Color.GREEN,
Color.BLUE
};

ColorStateList myList = new ColorStateList(states, colors);

The question is:
How can I address control states ( for ex. "android.R.attr.state_enabled" etc.) in C# ?

I am sure you know it!
Thanks in advance

MVVMCross with a modal popup

$
0
0

Hi guys,

I'm trying to present my login page as a modal page using Xamarin.Forms and MVVMCross.

My page flow is that I have a main screen, which has a property to check whether the user is logged in. If they are not, I want to present the login page as a modal over the top of the navigation stack the loading page is part of.

How do I present a page as modal on top of this navigation stack?

Regards,

Darbio

Web Service

$
0
0

One of my clients has a web service. In antique Windows CE and Visual Studio 2008 this is very easy to connect to and communicate.

I'm my innocence I thought I would try the same with a Xamarin Forms app. I have created a new XAML app using Visual Studio 2015 but I cannot add a web reference in the pcl part of the solution.

I have googled the problem but most responses are from 2015 and do not appear to work.

What should I do (other than stick to Windows CE)?


its so easy but i dont know why i cant solve it

$
0
0

Im trying to show a message for several second and it must be closed automaticly , exactly like pop up without any buttons

i tried to install toast plugin with no any luck of success what should i do ?

How do I center Picker Selected Items?

$
0
0

So I would like is to center the selected Item Text to be centered how do i do that?

System.Net.WebException: Error: SecureChannelFailure (The authentication or decryption has failed.)

$
0
0

I'm working on a Xamarin.Forms project, on the Android platform.
It seems that I cannot estabilish a secure HttpClient connection.
I'm getting this error everytime I try to connect to an HTTPS url for downloading an image:

Error getting stream for https://randomuser.me/api/portraits/thumb/women/1.jpg: System.Net.WebException: Error: SecureChannelFailure (The authentication or decryption has failed.) ---> System.IO.IOException: The authentication or decryption has failed. ---> System.IO.IOException: The authentication or decryption has failed. ---> Mono.Security.Protocol.Tls.TlsException: The authentication or decryption has failed.
  at Mono.Security.Protocol.Tls.RecordProtocol.EndReceiveRecord (System.IAsyncResult asyncResult) [0x0003a] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs:430
  at Mono.Security.Protocol.Tls.SslClientStream.SafeEndReceiveRecord (System.IAsyncResult ar, System.Boolean ignoreEmpty) [0x00000] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs:256
  at Mono.Security.Protocol.Tls.SslClientStream.NegotiateAsyncWorker (System.IAsyncResult result) [0x00071] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs:418
   --- End of inner exception stack trace ---
  at Mono.Security.Protocol.Tls.SslClientStream.EndNegotiateHandshake (System.IAsyncResult result) [0x00035] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs:396
  at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (System.IAsyncResult asyncResult) [0x0000c] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs:101
   --- End of inner exception stack trace ---
  at Mono.Security.Protocol.Tls.SslStreamBase.EndRead (System.IAsyncResult asyncResult) [0x00051] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs:883
  at Mono.Net.Security.Private.LegacySslStream.EndAuthenticateAsClient (System.IAsyncResult asyncResult) [0x00011] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/System/Mono.Net.Security/LegacySslStream.cs:475
  at Mono.Net.Security.Private.LegacySslStream.AuthenticateAsClient (System.String targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, System.Security.Authentication.SslProtocols enabledSslProtocols, System.Boolean checkCertificateRevocation) [0x00000] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/System/Mono.Net.Security/LegacySslStream.cs:445
  at Mono.Net.Security.MonoTlsStream.CreateStream (System.Byte[] buffer) [0x0001e] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/System/Mono.Net.Security/MonoTlsStream.cs:99
   --- End of inner exception stack trace ---
  at System.Net.HttpWebRequest.EndGetResponse (System.IAsyncResult asyncResult) [0x0005e] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/System/System.Net/HttpWebRequest.cs:1023
  /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs:379
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs:276
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Forms.cs:358
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\UriImageSource.cs:166
Image Loading: Error getting stream for https://randomuser.me/api/portraits/thumb/men/19.jpg: System.Net.WebException: Error: SecureChannelFailure (The authentication or decryption has failed.) ---> System.IO.IOException: The authentication or decryption has failed. ---> System.IO.IOException: The authentication or decryption has failed. ---> Mono.Security.Protocol.Tls.TlsException: The authentication or decryption has failed.
  at Mono.Security.Protocol.Tls.RecordProtocol.EndReceiveRecord (System.IAsyncResult asyncResult) [0x0003a] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs:430
  at Mono.Security.Protocol.Tls.SslClientStream.SafeEndReceiveRecord (System.IAsyncResult ar, System.Boolean ignoreEmpty) [0x00000] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs:256
  at Mono.Security.Protocol.Tls.SslClientStream.NegotiateAsyncWorker (System.IAsyncResult result) [0x00071] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs:418
   --- End of inner exception stack trace ---
  at Mono.Security.Protocol.Tls.SslClientStream.EndNegotiateHandshake (System.IAsyncResult result) [0x00035] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs:396
  at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (System.IAsyncResult asyncResult) [0x0000c] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs:101
   --- End of inner exception stack trace ---
  at Mono.Security.Protocol.Tls.SslStreamBase.EndRead (System.IAsyncResult asyncResult) [0x00051] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs:883
  at Mono.Net.Security.Private.LegacySslStream.EndAuthenticateAsClient (System.IAsyncResult asyncResult) [0x00011] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/System/Mono.Net.Security/LegacySslStream.cs:475
  at Mono.Net.Security.Private.LegacySslStream.AuthenticateAsClient (System.String targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, System.Security.Authentication.SslProtocols enabledSslProtocols, System.Boolean checkCertificateRevocation) [0x00000] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/System/Mono.Net.Security/LegacySslStream.cs:445
  at Mono.Net.Security.MonoTlsStream.CreateStream (System.Byte[] buffer) [0x0001e] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/System/Mono.Net.Security/MonoTlsStream.cs:99
   --- End of inner exception stack trace ---
  at System.Net.HttpWebRequest.EndGetResponse (System.IAsyncResult asyncResult) [0x0005e] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/System/System.Net/HttpWebRequest.cs:1023
  at System.Threading.Tasks.TaskFactory`1[TResult].FromAsyncCoreLogic (System.IAsyncResult iar, System.Func`2[T,TResult] endFunction, System.Action`1[T] endAction, System.Threading.Tasks.Task`1[TResult] promise, System.Boolean requiresSynchronization) [0x00014] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/FutureFactory.cs:550
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs:379
 [0x0002e] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs:276
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:535
  at Xamarin.Forms.UriImageSource+<GetStreamAsyncUnchecked>d__22.MoveNext () [0x00224] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\UriImageSource.cs:166

I searched around, but it seems that this is a bug related to the Mono HttpClient SSL/TLS 1.2 implementation.
Is there a workaround?
I installed the modernhttpsclient package, as someone suggested in another thread, but it doesn't solve anything.

Menu and Navigation

$
0
0

I have an app that requires both a slide out menu that is accessible from every view, and a back button (in a subheader bar) on every view that was not accessed bu the menu. It should look like the image below.
To get the menu working properly, I created a NavigationPage with the root page the MasterDetail page containing the Menu as the Master and the View as the Detail. When a menu item is clicked, I change the detail page to the appropriate view, and this works well (except that there is no icon in iOS)
Now I am trying to get the 'back' navigation working, but I'm finding that I can't use Navigation because the Detail Page is not a NavigationPage and I can't make it a NavigationPage because I already have a NavigationPage. What I think I need to do is to create a NavigationStack that is not tied to a NavigationPage that I can tie to my back button, but I haven't found a way to do this. Is this possible, or is there a better approach?

Center image and text on button

$
0
0

Is there a way to center the text and image on a button? I want the image to be on top and text below, both centered on button.
I'm trying to use a custom renderer on android like this

class MenuButtonRenderer: ButtonRenderer
{
    protected override void OnElementChanged (ElementChangedEventArgs<Xamarin.Forms.Button> e)
    {
        base.OnElementChanged (e);
        if (e.OldElement == null) {   // perform initial setup
            var nativeButton = (global::Android.Widget.Button)Control;
            nativeButton.Gravity = (global::Android.Views.GravityFlags.CenterHorizontal | global::Android.Views.GravityFlags.CenterVertical);
            nativeButton.SetPadding (20, 30, 0, 0);
        }
    }
}

How to use localization independent of device language (xamarin forms)

$
0
0

i'm working on xamarin.forms app connected to odoo(openERP) i need a solution for internationalize this app depending on the user culture (language) stored on odoo and not changed from the device. i have started with the officail links and all blogs but i cannot fin a solution and how to do it .any help ?
i still a beginner and i need a full description thanks

Xamarin.Firebase Not Compatible With Forms?

$
0
0

Trying to install Xamarin.Android and it appears that yet again Forms is restricting package dependencies:

Attempting to gather dependency information for package 'Xamarin.Firebase.Messaging.32.961.0' with respect to project 'IntelliDrive.Droid', targeting 'MonoAndroid,Version=v6.0'
Attempting to resolve dependencies for package 'Xamarin.Firebase.Messaging.32.961.0' with DependencyBehavior 'Lowest'
Unable to find a version of 'Xamarin.GooglePlayServices.Basement' that is compatible with 'Xamarin.Firebase.Common 32.961.0 constraint: Xamarin.GooglePlayServices.Basement (= 32.961.0)', 'Xamarin.Firebase.Iid 32.961.0 constraint: Xamarin.GooglePlayServices.Basement (= 32.961.0)', 'Xamarin.Firebase.Messaging 32.961.0 constraint: Xamarin.GooglePlayServices.Basement (= 32.961.0)', 'Xamarin.GooglePlayServices.Base 29.0.0.1 constraint: Xamarin.GooglePlayServices.Basement (= 29.0.0.1)', 'Xamarin.GooglePlayServices.Gcm 29.0.0.1 constraint: Xamarin.GooglePlayServices.Basement (= 29.0.0.1)', 'Xamarin.GooglePlayServices.Iid 32.961.0 constraint: Xamarin.GooglePlayServices.Basement (= 32.961.0)', 'Xamarin.GooglePlayServices.Maps 29.0.0.1 constraint: Xamarin.GooglePlayServices.Basement (= 29.0.0.1)', 'Xamarin.GooglePlayServices.Measurement 29.0.0.1 constraint: Xamarin.GooglePlayServices.Basement (= 29.0.0.1)', 'Xamarin.GooglePlayServices.Tasks 32.961.0 constraint: Xamarin.GooglePlayServices.Basement (= 32.961.0)'.

It requires a higher version of GooglePlayServices.Basement which can't be upgraded due to what Xamarin.Forms requires. Has anyone else managed to get Firebase working with XF? Or any word when there will be an update to it so we can work with newer technologies?


Xamarin forms activity indicator stops animating in android only

$
0
0

An activity indicator is being called to indicate to the user that some process is going on, but the activity indicator stops its animation.
As a fix tried to run some methods in background, but this causes sqlite to throw error like busy , db lock .
Is it possible to run the activity indicator (or any other loading popup) independent of the main thread?

Back button from causes crash on Android when page is MasterDetail

$
0
0

I'm seeing a crash on Android when the user presses the back button on their device while on the root MainPage of the application which happens to be a MasterDetail page. It looks to be the disposing of the Detail page that is the issue.

I'm using Xamarin.Forms 2.3.3-pre3 and building using Android 7.0 SDK.

Here is the stack trace:

  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
  at Java.Interop.JniEnvironment+InstanceMethods.CallIntMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method) [0x00084] in /Users/builder/data/lanes/3819/5a02b032/source/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.g.cs:11464
  at Android.Runtime.JNIEnv.CallIntMethod (System.IntPtr jobject, System.IntPtr jmethod) [0x00000] in /Users/builder/data/lanes/3819/5a02b032/source/monodroid/src/Mono.Android/JNIEnv.g.cs:186
  at Android.Support.V4.App.FragmentTransactionInvoker.CommitAllowingStateLoss () [0x00033] in <27c17fe440cf491ba8255bcefade6e02>:0
  at Xamarin.Forms.Platform.Android.AppCompat.MasterDetailContainer.Dispose (System.Boolean disposing) [0x00042] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\MasterDetailContainer.cs:130
  at Java.Lang.Object.Dispose () [0x00000] in /Users/builder/data/lanes/3819/5a02b032/source/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:203
  at Xamarin.Forms.Platform.Android.AppCompat.MasterDetailPageRenderer.Dispose (System.Boolean disposing) [0x00046] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\MasterDetailPageRenderer.cs:192
  at Java.Lang.Object.Dispose () [0x00000] in /Users/builder/data/lanes/3819/5a02b032/source/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:203
  at Xamarin.Forms.Platform.Android.AppCompat.Platform.SetPage (Xamarin.Forms.Page newRoot) [0x0003f] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:226
  at Xamarin.Forms.Platform.Android.AppCompat.Platform.Dispose () [0x00010] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:52
  at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnDestroy () [0x0002f] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:195
  at Android.App.Activity.n_OnDestroy (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in /Users/builder/data/lanes/3819/5a02b032/source/monodroid/src/Mono.Android/platforms/android-24/src/generated/Android.App.Activity.cs:2981
  at (wrapper dynamic-method) System.Object:b4f537f5-a711-449c-9bf3-d2540956cdc2 (intptr,intptr)
  --- End of managed Java.Lang.IllegalStateException stack trace ---
java.lang.IllegalStateException: Activity has been destroyed
    at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1515)
    at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:638)
    at android.support.v4.app.BackStackRecord.commitAllowingStateLoss(BackStackRecord.java:621)
    at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.n_onDestroy(Native Method)
    at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.onDestroy(FormsAppCompatActivity.java:80)
    at android.app.Activity.performDestroy(Activity.java:6866)
    at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1153)
    at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4154)
    at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4185)
    at android.app.ActivityThread.-wrap6(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1521)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6077)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

Why does debugging an app on Android devices cause the app to crash?

$
0
0

I am using Xamarin Studio for Mac to build a mobile application for iOS and Android.

I created the default (Welcome to Xamarin Forms!) Forms app. I tried both the Portable Class Library and the Shared Library with the following results:

  • Running release build of the app on iOS device - SUCCESS

  • Running debug build of the app on iOS device - SUCCESS

  • Running release build of the app on Android device - SUCCESS

  • Running debug build of the app on Android device - FAILURE (details below)

  • Running debug build of the app on emulated Android device - FAILURE (details below)

FAILURE: On the device, I simply get "MyApp has stopped" before the app has successfully started. In Xamarin Studio, I get no indication that anything has gone wrong.

Real Android device: Samsung S5 SM-G900-F

Emulated Android device: (Genymotion) Google Nexus 5X 7.0.0 API 24 (tried several others with the same results)

I tried setting a breakpoint on InitializeComponent() in app.xaml.cs. No hit. What am I missing here?

Xamarin.Forms Feature Roadmap

$
0
0

This roadmap outlines our anticipated feature releases.

Are there things you don't see here that you feel strongly deserve a spot? Make your voice heard and open a proposal on the Xamarin.Forms Evolution forum.

Primary Focus

Quality is top of the list. This means stability and performance first and foremost. Xamarin.Forms has been swiftly adopted as a preferred tool for delivering production apps in addition to rapid prototypes. Our focus and priorities are to support the Xamarin.Forms community in those areas. In the release schedule below, we've highlighted how and where we are making those investments.

A Note About Bugs

As this thread is primarily about the feature roadmap, we anticipate the important question "what about ___ bug"?! Improving quality by addressing bugs is huge priority and ongoing focus for the team, in addition to improve our communication across the board.

Disclaimer

We cannot predict the future and how everything will shake out. Things will change. Timing may be adjusted due to priority changes, in pursuit of quality standards, or any number of other really good reasons that we will strive to proactively and openly communicate.

The Features Roadmap

Milestone Release Date
2.3.3 December 2016
2.4.0 February 2017
2.5.0 May 2017

2.3.3 - December 2016

Native View Declaration - Feature
Native view declaration allows you to add bindable iOS, Android, and Windows views directly to XAML. Rather than having to write a custom renderer, you can simply add the control directly to XAML with no additional configuration. This not only works with stock platform controls, but custom controls as well.

Platform-Specifics - Feature
Platform-specifics allow you to take advantage of native functionality that is only available on select platforms that Xamarin.Forms targets from shared code.

UWP Blur Support (3rd party nuget) - Feature
Adds the UWP blur platform-specific.

2.4.0 - February 2017

Bindable Picker - Feature
Adds data binding to the Picker control, specifically the following properties:

  • ItemSource

  • SelectedItem

https://github.com/xamarin/Xamarin.Forms/pull/515

Accessibility (A11y) Support - Feature
Proposal
Adds accessibility support to Xamarin.Forms by exposing the underlying accessibility features on iOS, Android, and Windows 10.

CarouselView v1 Stable - Feature
CarouselView was introduced at Xamarin Evolve 2016 and has been in prerelease ever since. v1 brings stability and performance improvements.

Xamarin.Forms for macOS Preview - Feature
Xamarin.Forms is coming to macOS, joining iOS, Android, Windows, and Tizen as target platforms for Xamarin.Forms.

Fast Renderers - Performance
Optimize built-in and custom view renderers to streamline view creation and improve performance.

Startup Time Improvements - Performance
Improve the startup and initialization time for Xamarin.Forms apps.

Compiled Native Views - Enhancement, Performance
Bring native view declaration to XAMLC, so users don't have to opt-out of XAMLC in PCLs where pages use native view declaration.

OnIdiom Support for Desktop (UWP) - Enhancement
Developers have lots of options when it comes to configurability based on operating system (Android, iOS, UWP, etc.), version (9, 10, etc.), and idiom (mobile or tablet). This adds Desktop as an OnIdiom for UWP developers.

https://github.com/xamarin/Xamarin.Forms/pull/420

XAMLC Enhancements - Enhancement, Performance
Approaching full support for currently supported XAML features. Compile time support for all value providers.

Deprecation of iOS 6/7

Deprecation of WP8

2.5.0 - May 2017

Xamarin.Forms Embedding - Feature
Embed Xamarin.Forms into a native Xamarin.iOS, Xamarin.Android, or Windows 10 app.

Xamarin.Forms for macOS - Feature
Xamarin.Forms is coming to macOS, joining iOS, Android, Windows, and Tizen as target platforms for Xamarin.Forms.

MenuPage - Feature
Alternative to the MasterDetail page, but rendered as a platform-specific menu that makes creating flyouts easy.

Cut down on GPU overdraw for Android - Performance
Try to avoid overdraw on Android where possible to improve performance.

Reduce native views created - Performance
Cut down on backing native views created for Xamarin.Forms, as noted by Miguel in #42948.

Layout Compression - Performance
LayoutCompression allows multiple layers of Xamarin.Forms layouts to be packed into a single native one.

Prism-Like URI Navigation Routing - Enhancement
Navigate to a page using Uri navigation, similar to what Prism does.

NavigationService.NavigateAsync("ListPage/DetailPage?id=1");

Single DLL - Enhancement
Ship Xamarin.Forms as a single DLL to improve startup performance and assist the linker.

Open Source Contributions

As noted above, the Xamarin.Forms Evolution forum is the place to start.

How to resize image file on Xamarin.forms. (+ writeableBitmap package can't be added)

$
0
0

I'm making iOS and Android app using with Xamarin.forms. (PCL project)

I need to resize my image file from 'MediaFile class' that is returned from 'CrossMedia.Current.PickPhotoAsync ()'.

What's your best way to do it?

and I have searched long time and noticed that many people uses 'writeableBitmap'.
But this 'writeableBitmap' nuget package can not be added because Xamarin platform is updated?

Viewing all 91519 articles
Browse latest View live


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