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

Taking multiple pictures using camera intent. How to save those images in onactivityresult?

$
0
0

i am using MediaStore.IntentActionStillImageCamera for taking multiple images .Its working fine. But how to save those multiple images using onactivityresult.


What does this stack trace mean?

$
0
0

My company has released an application developed using Xamarin Forms, which works with both IOS and Android. We use HockeyApp to collect crash reports, and there is one that we are seeing a fair bit of from Android devices.

The stack trace doesn't reach anywhere in our code, and we can't reproduce. I was wondering if this is more legible to someone who is better at Xamarin than I.

Format: Xamarin

Xamarin caused by: android.runtime.JavaProxyThrowable: System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. ---> Java.IO.IOException: bt socket closed, read return: -1
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in :0
at Java.Interop.JniEnvironment+InstanceMethods.CallIntMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00085] in <62f66886030648cf9bb4b1fafd40adf5>:0
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualInt32Method (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0002f] in <62f66886030648cf9bb4b1fafd40adf5>:0
at Java.IO.InputStream.Read (System.Byte[] b, System.Int32 off, System.Int32 len) [0x00050] in <412969e7ca22437da16126c95815b2b2>:0
at Android.Runtime.InputStreamInvoker.Read (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x00006] in <412969e7ca22437da16126c95815b2b2>:0
at System.IO.Stream.m__2 (System.Object ) [0x0000b] in :0
at System.Threading.Tasks.Task1[TResult].InnerInvoke () [0x00031] in <d46e8b8ab8cc4c7f834fbd2384b04bc0>:0 at System.Threading.Tasks.Task.Execute () [0x00016] in <d46e8b8ab8cc4c7f834fbd2384b04bc0>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <d46e8b8ab8cc4c7f834fbd2384b04bc0>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <d46e8b8ab8cc4c7f834fbd2384b04bc0>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <d46e8b8ab8cc4c7f834fbd2384b04bc0>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <d46e8b8ab8cc4c7f834fbd2384b04bc0>:0 at System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () [0x00000] in :0
at System.IO.Stream.EndRead (System.IAsyncResult asyncResult) [0x00067] in :0
at System.IO.Stream.m__4 (System.IO.Stream stream, System.IAsyncResult asyncResult) [0x00000] in :0
at System.Threading.Tasks.TaskFactory1+FromAsyncTrimPromise1[TResult,TInstance].Complete (TInstance thisRef, System.Func3[T1,T2,TResult] endMethod, System.IAsyncResult asyncResult, System.Boolean requiresSynchronization) [0x00002] in <d46e8b8ab8cc4c7f834fbd2384b04bc0>:0 --- End of inner exception stack trace --- ---> (Inner Exception #0) Java.IO.IOException: bt socket closed, read return: -1 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <d46e8b8ab8cc4c7f834fbd2384b04bc0>:0 at Java.Interop.JniEnvironment+InstanceMethods.CallIntMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00085] in <62f66886030648cf9bb4b1fafd40adf5>:0 at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualInt32Method (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0002f] in <62f66886030648cf9bb4b1fafd40adf5>:0 at Java.IO.InputStream.Read (System.Byte[] b, System.Int32 off, System.Int32 len) [0x00050] in <412969e7ca22437da16126c95815b2b2>:0 at Android.Runtime.InputStreamInvoker.Read (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x00006] in <412969e7ca22437da16126c95815b2b2>:0 at System.IO.Stream.<BeginReadInternal>m__2 (System.Object ) [0x0000b] in <d46e8b8ab8cc4c7f834fbd2384b04bc0>:0 at System.Threading.Tasks.Task1[TResult].InnerInvoke () [0x00031] in :0
at System.Threading.Tasks.Task.Execute () [0x00016] in :0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in :0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in :0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in :0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in :0
at System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () [0x00000] in <d46e8b8ab8cc4c7f834fbd2384b04bc0>:0 at System.IO.Stream.EndRead (System.IAsyncResult asyncResult) [0x00067] in <d46e8b8ab8cc4c7f834fbd2384b04bc0>:0 at System.IO.Stream.<BeginEndReadAsync>m__4 (System.IO.Stream stream, System.IAsyncResult asyncResult) [0x00000] in <d46e8b8ab8cc4c7f834fbd2384b04bc0>:0 at System.Threading.Tasks.TaskFactory1+FromAsyncTrimPromise1[TResult,TInstance].Complete (TInstance thisRef, System.Func3[T1,T2,TResult] endMethod, System.IAsyncResult asyncResult, System.Boolean requiresSynchronization) [0x00002] in :0 <---

-Thanks,
Walter Langendorf
DYMO Software

Automatic logout after 1 minute of idle time

$
0
0

I have an app and I need to implement an auto-logout feature after 1 minute of app idle time. I can't seem to use System.Timer and I'm not so familiar with Device.Timer since I just started developing on Xamarin.Forms just last month. Any tips on how I can achieve this? A sample would really help. Thanks.

Swipe left event on listview item in xamarin.forms in iOS

$
0
0

Hello,

In my content page I have one Searchbar and a ListView. I added context action(Delete) to ListView. As and when user swipes left on the list item I am showing the delete option.

I need to disable the search bar when user swipes left on the list item. Using custom renderer I tried of adding swipe and pan gestures to list view. But the gestures are working without context actions. Please help me on this.

For reference you can see the iPhone messaging app. I need same feature in my app.

ListView Swipe Gestures left to right and right to left

$
0
0

Hello.

I am trying to implement a ListView using Xamarin.Forms which supports swiping in 2 directions.

right to left swipe -> offer a few custom actions
right to left swipe -> offer a few custom actions

Is it possible ? Any suggestions ?

Thanks

LLVM optimizing compiler disabled in Ad-Hoc mode

$
0
0

Why am I unable to select the LLVM optimizing compiler build option in Ad-Hoc mode but not release mode. Can an IPA be created in release mode?

Switch with 3 state

$
0
0

hello,

is there is a possibility to give switch 3 state (true/false/ null) ?

i have a mandatory field of switsch and muss be able to give true or false (start muss be null no state) so that the user give a state.

thanks in advance

Xamarin Forms working with cookies

$
0
0

Hi All,
I have seen a number of posts of working with cookies in Xamarin Forms, most of them use the webview for login against a server which then responds back with Success Response and cookies. I assume these cookies are automatically send back in each subsequent request(correct me If my assumption is wrong here).
However I want to know what happens when webview is not used and we have an xaml Login page instead.
Considering a scenario where I post a HttpClient request to server and get back the response along with the authentication cookies.
Please help me in clearing the following doubts/questions:
1) As per my observation, If I am using the same HttpClient object(which I used for login) to call the REST Api in the following way

            var handler = new HttpClientHandler()
            {
                AllowAutoRedirect = false,
                UseCookies = true,
            };
            client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            Uri uri = new Uri("https://xyz.com/getData");
            var response = await client.GetAsync(uri);
            var data = await response.Content.ReadAsStringAsync();

the cookies are send with the HttpClient request and I get the success response. This restricts me to use the same HttpClient object on each and every subsequent REST Api request.

2) I read in few posts that you can save the Cookie Container in your custom renderer and pass the same in HttpClient request.
3) Another way is to use the read the cookies that you need from the Cookie Container, save them in https://github.com/jamesmontemagno/SettingsPlugin of @JamesMontemagno and when you need to access the Rest Api, reassemble the cookie container and send it across.

Which would be the ideal way of working with cookies out of 3 approaches I have found so far? Also, at any place If my understanding is not clear, please feel free to correct me.


How to dynamically populate CarouselView?

$
0
0

Hello, Im saving images locally on my phone and i'm saving their path on sqlite.
How to retrieve the path and place them in the carouselview?

How to update the title of a page to a longer title when rotated to Landscape without '..."

$
0
0

I have code set to handle a change of the Title property when the device is rotated. The issue I am having though is that if the device is rotated from Portrait to Landscape if the Landscape title is longer than the Protrait title then it will be truncated.

Code Titles:
Portrait: "Ran Types"
Landscape: "Types of Random"

Actual Titles shown:

Portrait: "Ran Types"
Landscape: "Types of..."

Does anyone know how to display the top side menu to iOS content with Xamarin forms, as in Android?

$
0
0

I want to have the same effect as the side menu on Android, to top the menu and do as a shadow but in iOS, currently only pushes it.

What is the preferred way to catch all unhandled exceptions on Xamarin Forms?

$
0
0

Do they need to be caught at each application level or can we use a PCL event? Any samples would be great. :)

ScrollView not scrolling after navigate back

$
0
0

I'm using a MasterDetail page and the content pages reacheable from the Master are quite long. I'm trying the app on Android devices, and if I access one of those pages creating a new NavigationPage they show up correctly, but if I push them into the navigation stack, or if I go back to them from another page into the stack, the scroll doesn't work anymore.

This is the code for the creation of NavigationPage:

void OnItemSelected(object sender, SelectedItemChangedEventArgs e) {
var item = e.SelectedItem as IMenuItem;
if (item != null && item.SubmitPageType != null) {
Detail = new NavigationPage((Page)Activator.CreateInstance(item.SubmitPageType));
masterPage.ListView.SelectedItem = null;
IsPresented = false;
}
}
and this is the code that I use to push the same page into the navigation stack

this.Navigation.PushAsync(new MyPage());
In Xaml, I've tried using ScrollView into the ContentPage.Content element, but it doesn' work and it cuts out part of my layout at the bottom of the page.

Has anyone experienced similar problems with NavigationPage and content scrolling? Can anyone help me?

Thanks

Sppech To Text - Xamarin.Forms

$
0
0

Hola amigos necesito ayuda.

Necesito crear una aplicacion que convierta la voz a texto, en xamarin.forms no eh encontrando ningun ejemplo funcional. quiero saber si alguien sabe de un plugin util y un ejemplo para poder seguirlo.

El problema es que no puede ser un API, y en lo psoible que funcione sin internet.

Gracias, quedo atento.

Saludos desde Colombia.


Hello friends, I need help.

I need to create an application that converts the voice to text, in xamarin.forms is not finding any functional example. I want to know if anyone knows of a useful plugin and an example to follow.

The problem is that it can not be an API, and insofar as it works without internet.

Thank you, be attentive.

Greetings from Colombia.

Why is ZXing.Net.Mobile crashing after camera permission?

$
0
0

Hi all,
I am working xamarin.forms app and i use ZXing.Net.Mobile to read QR Code. Application is working greate but although i grante camera permission, it is crashing. When i open application again it is working fine.

Could you tell me reason please?

Best regards


Change the popup Date Format to DatePicker

$
0
0

Hi guys,
I am trying to change the popup DatePicker format.
Please see the image.

I need to sow this in Day/Month/Year
Example.

Mon, 25 Sep, 2017

24 Aug 2016

This my xaml:

<DatePicker.Format>d/M/yyyy</DatePicker.Format>
<DatePicker.MinimumDate>


Jan 1 1950


</DatePicker.MinimumDate>

This does't work. it showing Month/Day/Year

Thanks,

ipad with ios 11 showing label inside a frame with edges of texts being cut off. App rejected.

$
0
0

I have a list view, with label inside a frame to create a rounded corner effect.

However, since ios 11, the texts' edges seems to be cut off, frame doesn't seems to expand as the same size as the label anymore, a tiny bit smaller. And this effect resulted my app got rejected.

I am on a older version of Xamarin Forms and Xamarin Ios, is this the compatibility issue? Does upgrade to latest version help towards this issue??

The reason for me to not upgrade to the latest version is because previous few upgrades caused me a lot of headache, I had to ........ and then roll back.

Do we know the current stable version is stable enough? Any heads up for any obvious issues?

Thanks for your help.

how could i remove the focus in a Entry with binding ?

$
0
0

how could i remove the focus in a Entry with binding ?

Camera Overlay - Xamarin Forms

$
0
0

Hello,

i've been working on the sample provided by XLabs to work with the camera ( https://github.com/XLabs/Xamarin-Forms-Labs/wiki/Camera ) and its working ok (only if target API = 21) .

I wanted to know if its possible to Overlay the camera menu, the purpose is to add a rectangule to the screen. I know how to do it in Objective-C , but how would I implement it on Xamarin ? (for android and iOS)

Thanks in advance !

My Project has no default icon in drawable

$
0
0

Hello!

Sorry that I have to place my Screenshots like this but the Forum doesnt allow to add images the normal way because im new :neutral:
So please delete the space in the link for the image

Im using Windows - Visual Studio 2017 and trying to figure out why I cant set an Application Icon for Android.
I set the following Line in AssemblyInfo: [assembly: Application(Icon = "@drawable/icon")] and put an Icon called icon.png in drawable.
On Tutorials I saw that people allready have an Default Icon in this folder but mine is empty.
https: //us.v-cdn.net/5019960/uploads/editor/8l/s5bwaggen7gj.png
When i made the screenshot there was allready icon.png in "drawable" but as you can see, you see nothing!

I also cant select anything in Properties like i saw in Tutorials.

https: //us.v-cdn.net/5019960/uploads/editor/sp/3ihmi3vig8z8.png

Can anyone help me?

Im trying since 2 days now to add a simple Icon.

kind regards
marvin

Viewing all 77050 articles
Browse latest View live


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