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

AVCaptureFileOutputRecordingDelegate FinishedRecording is not calling when StopRecording() done

$
0
0

I have a method to record video in Xamarin Forms , in iOS it is not working sometimes. Below is my code if I continuously tapping the Start record. and Stop record buttons sometimes video is not recording.
public void RecordVideo()
{
try
{
if (movieFileOutput.Recording == false)
{
var outputUrl = ApplicationDocumentsDirectory().Append($"fundsApp{new NSUuid()}", false).AppendPathExtension("mov");
var _delegate = new OutputVideoRecorder();
movieFileOutput.StartRecordingToOutputFile(outputUrl, _delegate);

            }
            else
            {      try
                    {
                         movieFileOutput.StopRecording(); **_// At this point the breakpoint stops. sometimes ,where it is not calling                      the AVCaptureFileOutputRecordingDelegate FinishedRecording is not calling_**
                    }
                    catch (Exception ex)
                    {

                    }

}
}
catch (Exception ex)
{

        }

    }

public class OutputVideoRecorder : AVCaptureFileOutputRecordingDelegate
{

        public override void FinishedRecording(AVCaptureFileOutput captureOutput, NSUrl outputFileUrl, NSObject[] connections, NSError error)
        {
            MainThread.BeginInvokeOnMainThread(() =>
            {

                //Sending this to server

            });

        }
    }

Picker Selection Event

$
0
0

Hi,

I have a problem with xamarin form picker.
I need to have an event when the "done" (ios) or "ok" (android) button was clicked. Cause i want to open a popup when user select an item.
I only see a SelectedIndexChanged how is fire each time user stop scrolling (on iOS, can't see on android).

Anyone know how I can put an event when picker is closed ?

How to get Absolute Layout and Relative Layout to Autosize to the size of their child element

$
0
0

The design requirement is to put a label and a button on the image. The Image is in a DataTemplate of ListView. I want to use Absolute Layout. But it expand way out of the child element (image). So how to make the absolute layout the same size of the image. On the other hand if I use relative layout it also expands out of the child element. But it takes less space than absolute layout. I know Absolute Layout and RelativeLayout are the best for this scenario. But they were leaving lots of empty space between list view items. Please help me out and explain how to use both of these layouts appropriately in order to size them according to their child elements. The code is as follows


<ListView.ItemTemplate>

                     <AbsoluteLayout >

                        <Image Source="BuyersCard.png" > </Image>

                       <Label Text="{Binding Name}" AbsoluteLayout.LayoutFlags="PositionProportional" AbsoluteLayout.LayoutBounds=".1,.2"></Label>

                            <Button Text="Contact" BorderColor="Red" AbsoluteLayout.LayoutFlags="PositionProportional" AbsoluteLayout.LayoutBounds=".7,.2"></Button>

                    </AbsoluteLayout>
                  </ViewCell>       
            </DataTemplate>
        </ListView.ItemTemplate>

    </ListView>

Xamarin Forms apk size is 80 MB

$
0
0

Cannot reduce xamarin apk size below 80 MB. I did the following: 1) enabled proguard
2) Configuration: Release 3) Platform: Active (Any CPU). 4) Enable Multi-Dex: true
5) Enable developer instrumentation (debugging and profiling): false 6) Linking: SDK and User Assemblies(Tried sdk assemblies only also) 7) Supported architectures: Selected all
Visual studio community 2017 version: 15.9.6
Need some help on this...

It doesn't appear multiplatform application form of xamarin or native in visual studio enterprise 17

$
0
0

I am starting in the world of the application with xamarin and I am reviewing where they open a new project in multiplatform application xamarin form or native, but in the xamarin that I have installed does not have this option.

does it have to be enabled? Or install some extra tool for this?

Question on scheduled tasks

$
0
0
Hello,

They want me to build a system that automatically executes some scheduled tasks every N hours.

An example is every 2 hours the app needs to remind a worker to "check-in".

So I'll need to implement some sort of timer.
Will such a listener drain the battery?

How would you suggest i implement that?

Thanks

Draw Circle in xamarin form

$
0
0

Hi All,

Just list as "BoxView" control create "rectangle" shape in xamarin, how to i create "Circle" for slide image in CarouselView?

Please help.

Download folder Access, subfolders creation in Xamarin.Forms 3.4.0.1029999

$
0
0

Hi folks,

I try to use this piece of code in Xamarin.Forms NET.Standard code sharing project but raises a Denied exception. Why? How can I create subfolders in Download folder (this is a mandatory app requeriment)?

Cheers

netstandard2.0
string root = "/storage/emulated/0/Download/";

if (Directory.Exists(root + "Test1") == false)
Directory.CreateDirectory(root + "Test1");

System.UnauthorizedAccessException: Access to the path "/storage/emulated/0/Download/Test1" is denied.

Android project






Push Notification with AppCenter when the app is closed

$
0
0

Hi guys,
I'm implementing Push Notification in my app with AppCenter. In UWP I created a background service to receive message when the app is closed. I'm trying to do the same with Android and, later, iOS.

In Android project I created a IntentService to initialize the Push from AppCenter but it doesn't work.

[Service]
public class PushNotificationService : IntentService
{
    public override void OnCreate()
    {
       if (!AppCenter.Configured)
        {
            Push.PushNotificationReceived += (sender, e) =>
            {
                new NotificationHelpers().ShowNotification(e.Title, e.Message, e.CustomData);
            };
        }
    }

    public override IBinder OnBind(Intent intent)
    {
        return null;
    }

    [return: GeneratedEnum]
    public override StartCommandResult OnStartCommand(Intent intent, [GeneratedEnum] StartCommandFlags flags, int startId)
    {
        return StartCommandResult.StickyCompatibility;
    }

    protected override void OnHandleIntent(Intent intent)
    {
    }
}

What is the correct implementation for Android? Thank you

Could not resolve type with token 01000012

$
0
0

I've been developing my app now for at least 5 months. I've been wanting to try the xamarin previewer so i updates visual studio xamarin forms and then i updated my nuget xamarin forms for my portable, ios and android.

now when i try to debug the application on the device i get

System.TypeLoadException: Could not resolve type with token 01000012

on this line

global::Xamarin.Forms.Forms.Init(this, bundle);

which i find very odd

origionally my xamarin forms nuget version was 2.3.3.168

so i thought id update to the stable version which was the same version number 2.3.3.168 but it had "stable" beside it

i've downgraded again but still get the same error.

any thoughts

thanks

Databinding in master-details page

$
0
0

When using two-way databinding in Xamarin, how can I determine whether an update to a property on a model was from an actual user entry or when the underlying object was changed because a different object was selected from the master list?

Imagine a list of users and a detail section (user name, dob, etc). When the user selects a new user, the user details fields change to reflect the chosen user. That causes the PropertyChanged events to fire on the fields. I'd like to find out if the fields have changed because of user change so I can say "Details have changed, do you want to save?", etc.

Any thoughts?

Thanks

how can l connect my xammarin forms application to sql online database

$
0
0

I am trying to make a xamarin forms application which perfom crude operations using sql server online so guys l wanted your help ,on how can l connect and add,update,view and delete items from the sql server using xamarin forms,if you have the source code l will greatly appreciate that

Huge table with lot of images

$
0
0

Hi guys,

I have a page with table with 400+ items (4 columns, more than 100 rows). I've created it using Grid view, and there's a different image from local source in every cell. My problem is that it takes at least 10 seconds to open such page.
How to improve the performance? Should I use ListView instead? Will FFImageLoading improve the performance?

Thanks!

How to implement this "List"?

$
0
0

Hello guys.
Im really new to Xamarin and app development. I attached a picture for you guys to help me out which tools i would need to realize this in an app.
If I add a new Item to the list with a button in the bottom right corner it should appear like this in my app. The black circles represent Buttons for "delete" and "edit" so i think a really simple app to learn how such things work.
I dont want you to give me a full code or something, i just want to know with which tools i should work to get this result.
Hope you guys can help me!
Need to attach the picture as a file because i can't send URL's - im new.

[Android] Maps not working on Google Play store

$
0
0

I am using the Xamarin.Forms.GoogleMaps plugin, but the same happens with Xamarin.Forms.Maps.

  • I created a Google API Key, and I restricted it for android, using the package name and SHA1 from the keystore that I use to publish the app to Google Play.
  • I archived the android app, signed with my keystore.
  • It saved the APK to the computer.
  • I installed that APK to the phone, and maps work just fine.

  • I manually uploaded that same APK to Google Play and created a new alpha release.

  • I deleted the app (with the working maps) from my phone.
  • I installed the app from Google Play
  • The maps are blank!

NOTE
When I go to Google Play Console and download the APK and try it on my phone, I get these results:

  • Original APK: maps work
  • Derived APK: maps are blank

I don't understand what's wrong, can anyone please advise?
Thanks


Device.Idiom for andriod TV is Phone ! why ?!!

$
0
0

Hello guys ,
As the title says , when I check the Device.Idiom for the android TV it returns that its from type of Phone. Can someone explain this ? Is there a way to know that I am running from a TV ?

How to add background service in Xamarin forms

$
0
0

I am new developer in xamarin,
That's why i faced some problem.
I can't create background service in (PCL) Android, iOS and also UWP.

Anybody help me to give example code or station.

Download folder Access, subfolders creation in Xamarin.Forms 3.4.0.1029999

$
0
0

Hi folks,

I try to use this piece of code in Xamarin.Forms NET.Standard code sharing project but raises a Denied exception. Why? How can I create subfolders in Download folder (this is a mandatory app requeriment)?

Cheers

netstandard2.0
string root = "/storage/emulated/0/Download/";

if (Directory.Exists(root + "Test1") == false)
Directory.CreateDirectory(root + "Test1");

System.UnauthorizedAccessException: Access to the path "/storage/emulated/0/Download/Test1" is denied.

Android project





[FilePickerActivity] not attached to window manager xamarin forms

$
0
0

Hi, I am trying to use the CrossFilePicker to allow a user to select a file from their device and receive this error message shortly after selecting a file. The setup that I have is that file management code is per platform (Android, UWP) and is injected into my ViewModels that require file management via an Interface and AutoFac. The CrossFilePicker is only used in the Android file management code with UWP having a different implementation.

The code in question is:

    public class AndroidFilePicker : IFileManagement
    {
        public async Task<List<FileDataDto>> PickFilesAsync(string temporaryTargetFolder)
        {
            var result = new List<FileDataDto>();
            Plugin.FilePicker.Abstractions.FileData fileData = await CrossFilePicker.Current.PickFile(AndroidConstants.AllowedFileExtensions);

            if (fileData != null)
            {
                ...
            }

            return result;
        }

Would be great to hear if anyone knows why this exception may be occuring and how I could prevent this?

Customizing Listview Groupheader

$
0
0

Hi All!!

Hope everyone is doing well.

I am trying to customize the GroupHeader of a listview. I would like it to stretch under the jumplist (like default behavior - see left image).

This is the xaml I am using.

<ListView.GroupHeaderTemplate>
  <DataTemplate>
    <ViewCell Height="50">
      <StackLayout VerticalOptions="FillAndExpand"
                   Padding="5"
                   BackgroundColor="#3498DB">
        <Label Text="{Binding Key}" TextColor="Black" VerticalOptions="Center"/>
      </StackLayout>
    </ViewCell>
  </DataTemplate>
</ListView.GroupHeaderTemplate>

How can I get the custom groupheader to stretch so that it is scroll under the jumplist?

Thanks
Noel

Viewing all 77050 articles
Browse latest View live


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