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

Xamarin Forms: Failed to launch the ios application on the device.

$
0
0

Getting the following message when installing xamarin forms ios app in physical ios device.

NSLocalizedRecoverySuggestion=Please try rebooting and reconnecting the device. (0xE8000022)., NSLocalizedFailureReason=Please try rebooting and reconnecting the device. (0xE8000022).}
warning MT1043: Failed to launch the application using the instruments service. Will try launching the app using gdb service.
Launching 'appname' on the device 'iPhone'
warning HE0030: Could not mount developer tools on 'iPhone': Could not locate device support files.
warning HE0031: Failed to mount developer tools on 'iPhone'.
warning HE0030: Could not mount developer tools on 'iPhone': Could not locate device support files.
warning HE0031: Failed to mount developer tools on 'iPhone'.
error MT1007: Failed to launch the application 'appname' on the device 'My iPhone': Failed to launch the application 'apname 'My iPhone': Invalid Service >Error (error: 0xe8000022). You can still launch the application manually by tapping on it.

I am using visual studio for mac version 7.7.3(build 43), iPhone 7(12.3.1) and xcode(Version 10.1 (10B61))

I have installed Xcode on mac, not iPhone. Is Xcode need to install on the iPhone for debugging the app?

I already found the same issue on here. Restarted iPhone, Mac and visual studio as per the solution on that thread, but that didn't help me.


Xamarin.Forms Infinite Scrolling Image Background Effect

$
0
0

I'm trying to make what I think will be a nice effect for an app - a series of images (think wallpaper) will be constantly scrolling in the background during a view. I started prototyping this in Xamarin.Forms, creating a custom control. Planned on a diagonal translation but started with the most basic approach and still ran into some issues fairly quickly, namely that it is not entirely smooth as it gets a bit choppy here and there (even when using caching and just a 10kb image) and 2) if user executes an action that's more involved it may cause a lag and the images get rendered more closely together than they should be. Is there a way to fix up this approach so that it's as smooth as possible and doesn't interfere (or get interfered with) the other UI elements, or is there a far superior approach for something like this - anyone ever tackle this?

I posted the question with the code here on SO: https://stackoverflow.com/questions/56713758/xamarin-forms-infinite-scrolling-image-background-effect

Please let me know, thanks.

Deselect listview item when back to a page

$
0
0

I want to deselect an item in a listview when the app navigated back to the page containing the listview. Any idea?

Would like clarification for certificate and provisioning profile expiration dates

$
0
0

Hi, I'm not sure this is the right place to ask the question, but, . . .
I would like clarification on the expiration dates for apple certificates and provisioning profile.

Both have expiration dates associated with them.

My scenario is this:
Deploy an app to 10 devices through the app store with a certificates that expires in 12 months.
1. If the certificate is revoked prior to the 12 months, will the devices still be able to run the app for the remaining time prior to the certificate expiration?
2. Is the only effect of a revoked certification, the inability to build the app in Microsoft App Center?
3. If the provisioning file expires before the certificate expires, will the app on the devices still be able to run?
4. Is the only effect of an expired provisioning profile is the inability to build the app in Microsoft App Center?

I am getting ready to clean up a bunch of what I think are unnecessary or unused certificates and provisioning profiles, . . . just need to make sure deleting or removing something that has not expired won't break functionality in deployed apps.

Thanks

ListView scroll up by pixels (Xamarin Forms Standard)

$
0
0

Hi,

I am trying to scroll up ListView items by pixels

This I want to achieve using System.Timers.Timer. Let say scroll up ListView item by 20 pixels every 1 seconds.

Currently what I saw is there ScrollTo and that is scrolling by item.

Anyone who can guide or share code (xaml, custom listview or listview renderer)

Thanks.

ACR.UserDialogs Splat - Could not be resolved as it was built against Version=v5.0

$
0
0

Hi

Since upgrading my version of Visual Studio 2019 to the latest build I have been unable to build my project.

Is anyone getting this same message or do you know how to resolve it?

I am using Splat 2.0.0 as I am user ACR.UserDialogs 6.5.1 as part of a shared project.

.nuget/packages/splat/2.0.0/lib/netstandard1.1/Splat.dll" could not be resolved because it was built against the ".NETPortable,Version=v5.0" framework. This is a higher version than the currently targeted framework ".NETPortable,Version=v4.5,Profile=Profile111".

Many thanks in advance

The latest Xamarin.Forms Feature Roadmap is posted to the project's GitHub Wiki.

$
0
0

The latest Xamarin.Forms Feature Roadmap is posted to the project's GitHub Wiki.

The latest Xamarin.Forms Feature Roadmap is posted to the project's GitHub Wiki.

$
0
0

The latest XamariThe latest Xamarin.Forms Feature Roadmap is posted to the project's GitHub Wiki.n.Forms Feature Roadmap is posted to the project's GitHub Wiki.


Store sensitive data

$
0
0

I have some sensitive keys that I want to have on my app, but I don't want to store them on the shared project for obvious reasons. On android, you can store keys in the .gradle file and read it from there. I want to do the same but for Xamarin Forms. Is there a way I can store it somewhere and access in the shared project?

Similar to https://github.com/sameerkapps/SecureStorage but I want to hardcode the keys and simply access them like on SecureStorage.

Uploading Image to server using xamarin.forms

$
0
0

Hi Xamarin Forum
im having trouble uploading my image to my server here is my code that im using right now

string[] fileTypes = null;
            var path = CrossFilePicker.Current.PickFile(fileTypes);
            using (var webClient = new System.Net.WebClient())
            {
                try
                {
                    webClient.Headers.Add("Content-Type", "binary/octet-stream");
                    byte[] result = webClient.UploadFile("http://xxx.xx.x.xx:8087/uploadFolder/", "POST", path.ToString());
                    string Result_msg = System.Text.Encoding.UTF8.GetString(result, 0, result.Length);
                }
                catch(Exception ex)
                {

                }
            }

And im having this kind of error when uploading

An exception occurred during a WebClient request.

Thanks

Library Reference

$
0
0

As i have solved the web references and the stuff like that, i am presented with another obstacle which i have been trying to solve, but basically, in my Xamarin.Forms i would like to add a library called System.Web.Services which will allow the code to get the .Credentials that it needs, and i have been presented with this problem

Any Solutions, while i keep looking for the answer.

Running my xamarin forms project from the command line?

$
0
0

How can I run my xamarin forms project on iOS simulator via command line (terminal on mac)?

I have seen usage of mono, msbuild and dotnet.

how to convert Binary to Image

$
0
0

Hi Xamarin forum,

how can I convert my image binary from database to image im currently troubleshooting this code

while (reader.Read())
            {
                string photos = "data:image/jpeg;base64," + Convert.ToBase64String((byte[])reader["Photo"]);
                string postContent = (string)reader["Post_Content"];
                string uploader = (string)reader["Uploader"];

                var postWall = new Post
                {
                    PhotoSource = photos,
                    PostContent = postContent,
                    Uploader = uploader
                };
                postList.Add(postWall);
            }

How to implement ShimmerLayout in Xamarin Forms ?

How to save image from filepicker

$
0
0
Hi xamarin forum how can I get the image from filepicker to my sql using xamarin forms

Show a display popup for update when update available from playstore

$
0
0

I want to show a display popup for update apk(if update available from playstore)when user open the application.If user click on "OK" then it will open the playstore for update apk.
How to do this in xamarin forms?

Picker in a list - BUG ?

$
0
0

I'm seeing some strange behaviour in our app which I can't get my head around.

We have multiple pickers in our app - they are all using a piece of code I found for a BindablePicker as we developed this prior to Xamarin having a picker control that was capable of Binding - regardless - I have changed the code to use the Xamarin picker control and am seeing the same behaviour - so I'll describe what is happening with the Xamarin picker. This is example code for our picker:

<Picker ItemsSource="{Binding checklistAnswers}" ItemDisplayBinding="{Binding Name}" HeightRequest="35" SelectedItem="{Binding selectedAnswer}"/>

So one of our tab pages has a list control on it and in in each object in the list is a set of controls consisting of a few labels, one picker and one textbox.

When I go to the first object and click its picker in the list - I can set the options for that picker.
When I go to the second object and click its picker - I see the set of options and pick one, then it shows me the set of options for the first picker for some reason - if I choose something different to what is set in the first picker - it then shows me the set of options for the second picker again - this will continue in a forever loop unless I either press Cancel on the options or pick the same value as what is currently there.

This is driving me mad, because this is apparently in our public release (although nobody has yet reported it) - and obviously would make our app look bad. I've tested on physical and emulated phones - same thing, I've tested from Android 5.x to 9.0 - same thing, I've used different devices - same thing.

Anyone run into this?

This is complete code for full detail:

<ListView x:Name="checklistList" ItemsSource="{Binding Job.ChecklistItems}" SeparatorVisibility="Default" SeparatorColor ="Black" HasUnevenRows="True" Margin="3,6">
  <ListView.ItemTemplate>
    <DataTemplate>
      <local:SxTransparentViewCell>
        <Grid Margin="10,3,10,3" Padding="1" BackgroundColor="#898989">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
          </Grid.ColumnDefinitions>
          <StackLayout BackgroundColor="White"/>
            <StackLayout Orientation="Vertical" Spacing="4" Padding="10,7,5,15">
          <Label Text="{Binding question}"/>
                   <Picker ItemsSource="{Binding checklistAnswers}" ItemDisplayBinding="{Binding Name}" HeightRequest="35" SelectedItem="{Binding selectedAnswer}"/>
          <Label Text="Notes:"/>
          <Editor x:Name="notesBox" TextColor="{StaticResource sx_normal_text}" HeightRequest="100" Text="{Binding editedNotes}"
              local:DisabledEffect.IsDisabled="{Binding canEnterNotes, Converter={StaticResource cnvInvertBool}}"/>
          </StackLayout>
      </Grid>
    </local:SxTransparentViewCell>
  </DataTemplate>
</ListView.ItemTemplate>
</ListView>

Fetching data from REST API and MVVM model

$
0
0

I made a Connection class, where I have everything related to connection to REST API, including URL, generic methods and it's working as intended.

Then I have LocationPage, where locations are displayed. I'm creating those location elements in code behind (LocationPage.xaml.cs) and putting them into grid.

Now the problem comes, since it takes some time for data to get fetched from API, it breaks my app with exception: "Object referenced or not null" (something in those lines).

I'm setting BindingContext to LocationViewModel

LocationPage.xaml.cs

        public partial class LocationPage : ContentPage
        {
            private LocationViewModel lvm;

            public LocationPage ()
            {
                InitializeComponent ();
                BindingContext = lvm = new LocationViewModel();
            }

LocationViewModel.cs

        public LocationViewModel()
                {
                    LoadLocationsAsync();
                }

                public async Task LoadLocationsAsync()
                {
            // going to connection class which return list of locations
                    _locations = await Connection.GetAllAsync<Location>("location");

                }
   private IList<Location> _locations;
    public IList<Location> Locations
            {
                get { return _locations; }
                set {
                    _locations = value;
                    OnPropertyChanged();
                }
            }

My question is. What is the correct way of loading async data in MVVM from REST API, And how to tell LocationPage.xaml.cs to wait until data is fetched in LocationViewModel AND only then it should start constructing elements in LocationPage codebehind and showing them on page, maybe even showing a spinner.

Thank you all!

How can I get the list of SelectedItems from CollectionView in my ViewModel?

$
0
0

I have an application that essentially pushes 3 modal pages to display unique CollectionViews for user interaction. I went this route versus a Picker because of the data I'm attempting to display.

Anyway, I have my XAML set up, my ViewModel set up but I cannot for the life of me get the SelectionChangedCommand to work properly. I've tried 2 different methods and neither gives me the return that I'm looking for.

Base Code
XAML: WarehouseModalPage

<CollectionView
    x:Name="warehouse_list"
    Margin="5"
    HorizontalOptions="FillAndExpand"
    ItemSizingStrategy="MeasureFirstItem"
    ItemsLayout="{x:Static ListItemsLayout.VerticalList}"
    ItemsSource="{Binding Warehouses}"   // This is my ObservableCollection pulled from an API Request
    SelectedItems="{Binding SelectedWarehouses}"
    SelectionChangedCommand="{Binding SelectionCollectionChanged}"
    SelectionMode="Multiple">
    <CollectionView.ItemTemplate>
        <DataTemplate>
         ... ...
        </DataTemplate>
    </CollectionView.ItemTemplate>
</CollectionView>

1st Attempt - Use an ICommand to access SelectedItems which was bound to my object SelectedWarehouses

ViewModel: WarehouseModalViewModel

class WarehouseModalViewModel
{
    public ObservableCollection<AuthWarehouses> Warehouses { get; set; }
    public List<AuthWarehouses> SelectedWarehouses { get; set; }
    public bool CanExecuteSelectionCommand(object obj)

    public WarehouseModalViewModel()
    {
        Warehouses = new ObservableCollection<AuthWarehouses>();
        LoadWarehouseCommand = new Command(async () => await UpdateValidWarehouseList());
        LoadWarehouseCommand.Execute(null);
    }

    public ICommand SelectionCollectionChanged
    {
        get 
        {
            return new Command(() => 
            {
                Debug.WriteLine("Add to SelectedItems" + SelectedWarehouses.Count);
                Barrel.Current.Add("SelectedWarehouses", selected, TimeSpan.FromDays(1));
            }
        }
    }
}

2nd Attempt - Use a variation of building the Command to access the data

ViewModel: WarehouseModalViewModel

class WarehouseModalViewModel
{
    public ObservableCollection<AuthWarehouses> Warehouses { get; set; }
    public List<AuthWarehouses> SelectedWarehouses { get; set; }
    public bool CanExecuteSelectionCommand(object obj)

    public bool CanExecuteSelectionCommand(object obj)
    {
        return this.SelectedWarehouses != null;
    }
    public void ExecuteSelectionCommand(object obj)
    {
        Debug.WriteLine("Added to Barrel... " + SelectedWarehouses.Count);
        Barrel.Current.Add("SelectedWarehouses", SelectedWarehouses, TimeSpan.FromDays(1));
    }

    public WarehouseModalViewModel()
    {
        Warehouses = new ObservableCollection<AuthWarehouses>();
        LoadWarehouseCommand = new Command(async () => await UpdateValidWarehouseList());
        LoadWarehouseCommand.Execute(null);
    }

    public ICommand SelectionCollectionChanged
    {
        get 
        {
            return new Command(ExecuteSelectionCommand, CanExecuteSelectionCommand);
        }
    }
}

No matter what route I take I either get:

1st Attempt: A Null error pointing to this line:

Debug.WriteLine("Add to SelectedItems" + SelectedWarehouses.Count);

2nd Attempt: My debug line never actually fires

Can anyone see where I may be going wrong with using the CollectionView and getting the list of selected items?

Coordinates from string to double or float

$
0
0

Hi everyone!

I'm working with an API-Rest that generates me a JSON with a polygon (every coordinates of that polygon, shape).

Well, I deserialize it in classes, but the coordinates deserialize in string (I mean, x and y coordinates as string) so I can't use it, because I need to put each point with lat and with long.

How can I deserialize it in a double or float to use my coordinates?

That is the JSON: shape\":[\"52.5139618,13.3210087\",\"52.5139618,13.3222961\",\"52.5141335,13.3228111\",\"52.5144768,13.3231544\",\"52.5146484,13.3236694\",\"52.5146484,13.3243561\",\"52.5144768,13.3248711\",\"52.5141335,13.3252144\",

And that is my class:

public class Component
{
public int id { get; set; }
public string[] shape { get; set; }
}

Thank you in advance

Viewing all 75885 articles
Browse latest View live


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