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

Navigation.PushAync() method issue on Lollipop devices in Xamarin.Forms ?

$
0
0

Hi everyone,
I am facing some issues in my Xamarin.Forms application with Navigation.PushAsync()
method but only on android lollipop devices. The app perfectly works on pre lollipop
and post lollipop devices and on all ios devices.
Here are the different scenarios of my application.
-I have a signUp page with two Entry(Email,Password) and when i navigate to this page from from my SignIn page
using await Navigate.PushAsync(new SignInPage()). The page successfully loaded and also has back button option on navigation bar but all the page functionalities got stuck, Entry don't show the text while typing from keyboard.
-In the same way i have another page with ListView but the page got stuck on loading and similarly an other page with Webview and it also got stuck when i navigate only the back button works.
-If i use Navigation.PushModelAync(), then it works fine on all devices including lollipop but its not my requirement. Navigation.PushAync() should also work on lollipop , i don't know why its behaving like :( Please help me out to get rid of this issue.
Thanks in advance


Azure search is not working with typeahead functionality.

$
0
0

Hello guys, I have implemented azure search for searching workspaces from database which I have imported in azure. The issue is when I give a request call for searching the results, it has some time delay into it. My requirement is that I need a flawless azure search without hanging user for every work he types in the Entry field.

private async void SearchEntryTextChanged(object sender, TextChangedEventArgs e)
{
var entry = sender as CustomEntry;
string searchedString = entry.Text;
if (searchedString.Length > 2)
{
_workspaceSearchService = new AzureWorkspaceSearchApi();
List workspaceSearchData = new List();
//workspaceSearchData = await _workspaceSearchService.SearchWorkspaceFromAzure(searchedString);
workspaceSearchData = await _workspaceSearchService.ExecSuggest(searchedString);

               viewModel.SearchWorkspaceRecord = workspaceSearchData;
           }

}

For every character that enter after 2 length I am calling azure search. This request needs some time to get completed and hangs the user until it gets search result. I need these request to be done using typeahead phenomenon. Can anyone suggest me a solution to achieve this?

Below is the azure request:-

public async Task<List> ExecSuggest(string q)
{
try
{
// Execute /suggest API call to Azure Search and parse results
//string url = _serviceUri + AzureSuggestUrl + q;
string url = "https://meelosearchbasic.search.windows.net/indexes/indworkspacesearch/docs/suggest?api-version=2016-09- > >01&suggesterName=sgworkspacesearch&$top=5&$filter=TenantId eq '" + App.userTenantId + "'&search=" + q;
_httpClient = new HttpClient();
Uri uri = new Uri(url);
List Suggestions = new List();

           HttpResponseMessage response = AzureSearchHelper.SendSearchRequest(_httpClient, HttpMethod.Get, uri);
           AzureSearchHelper.EnsureSuccessfulSearchResponse(response);

           var obj = JsonConvert.DeserializeObject<SearchResult>(response.Content.ReadAsStringAsync().Result);
           Suggestions = obj.value;

           return Suggestions.Distinct().OrderBy(x => x.SearchText).ToList();
       }
       catch(Exception e)
       {
           return null;
       }
   }

Xamarin.Android.Common.targets - Name cannot begin with the '$' character, hexadecimal value

$
0
0

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(3,3): Warning: Name cannot begin with the '$' character, hexadecimal value 0x24.

I am building a Xamarin Forms application and I have been trying to resolve the issue. I just can't find online resources to get me through this. Is there anyone who knows whats causing this. There is no name that starts with '$'.

Date picker shows only month and year

$
0
0

I need a date picker that shows only month and year...
how to implement this...any NugGet package is available...?
Thanks in advance..

On iOS Listview header resets after itemsource changes

$
0
0

Hi,

I have a listview with a header template. Header is a horizontal scrollable list, bound to a different source and displays the categories of products, and listview itemsource is bound to another source which displays products. When a user taps on a category, i simply filter the ItemSource and set it to be the new ObservableCollection:

products = new ObservableCollection(allProducts.Where(x=>x.categoryId=selectedCategory.Id)

On android it works perfect: when the category is tapped on the header, listview displays new items, header is "untouched" (eg: if it was scrolled, it stays scrolled).
On iOS, when the category is tapped and the listview ItemSource is reset, then the header refreshes and redraws itself, resetting everything like the scroll position which creates poor user experience.

How can i prevent that on iOS?

Gesture not updating its status as completed

$
0
0

I have a PanGestureRecognizer in my custom view. For the PanUpdated event handler, I have a function that does some stuff when the gesture is running and then something else when the gesture is completed. However, sometimes the gesture never gets to its completed state.
Any ideas?

Here's what I have...

        class ImageContainer : ContentView
        {

            public ImageContainer()
            {
                PanGestureRecognizer panGesture = new PanGestureRecognizer();
                panGesture.PanUpdated += OnPanUpdated;
                GestureRecognizers.Add(panGesture);
            }


            void OnPanUpdated(object sender, PanUpdatedEventArgs e)
            {
                switch(e.StatusType)
                {
                            case GestureStatus.Started:
                                // do some stuff
                                break;
                    case GestureStatus.Running:
                    // do more stuff
                                break;
                            case GestureStatus.Completed:
                                // sometimes this does not get called!
                                break;
                }
            }
        }

SWIPE Gestures in Xamarin Forms

$
0
0

Hello Everyone :)

A general question:
It's possible to implement the Swipe logic like TInder or something like that? or only with Yes and No Buttons?.
I would like to swipe images, Like and Dislike - possible?
I hope someone can help me or give me an advice :)
Thanks :)

Culture Localization with Xamarin Forms and .Net Standard

$
0
0

I recently converted a localized app from PCL to .Net Standard which is localized with RESX files as described on this page: https://developer.xamarin.com/guides/xamarin-forms/advanced/localization/

After migration I noticed that .Net Standard does no longer need the assistant code to determine the language set on the device under Android and iOS. However, when I additionally to the culture also provide a culture such as en-GB.resx it is not recognized and will always fall back to the more generic language. Any idea how I can get .Net Standard to recognize the culture?


Xamarin.froms store app

$
0
0

We are trying to build a Pepperfry - Furniture Store, kind of app.

We have chosen to build it in Xamarin.froms.

is Xamarin.forms is good option for this kind of app ? we chose Xamarin.froms because we can share code 90%

any suggestions ?

Numerous developer frustrations

$
0
0

Hi everyone,

I would like advice streamlining my development experience with Xamarin because it has been quite frustrating so far.
I even got to the point that I left my project which was working for a month or 2 and returned with it crashing and me not being able to get it up and running again, after which I decided I was going to rebuild it from scratch.

I can't imagine that my current debugging problems are the norm so I guess I must be doing something wrong somewhere. I'd like to find out what.
It could be so that half of my problems are not Xamarin related but Visual studio related, but I don't seem to be experiencing them when I'm developing other type of applications.

I have a firm background in developing console / wpf / asp / webapi / etc c# projects but I'm still kinda new to Xamarin.
I'm trying to build a Xamarin forms app (focussing on android first, if I get that up and running then maybe also IOS / UWP)
I mostly use the android emulator with an newly created AVD (platform 7.1.1 api level 25)

Why am I frustrated:

  • when my code breaks my dev environment (vs 2017 on win10) almost never stops where the problem occurs (nullreference / throw exception) it just seems to crash hard on the emulator. I have to step through my code or use the output window to see if I can decypher a cause. I usually get an "An unhandled exception occurred" message with "no compatible code running".
  • errors that I get to see are often not helpfull in diagnosing the problem.
  • quite a lot of times the app just crashes on startup in the emulator, not giving me any log.
  • given the points above I try to take babysteps to verify it still works. This in combination with the slowness of the debuggingcycle (buidling/deploying) on an android emulator takes the speed out of my development.
  • I seem to be getting different results from time to time between debugging on my physical device / the emulator / after a solution clean / reboot. That does not help in my general feeling of building on a solid foundation.
  • the logcat output of my emulator produces a lot of noise (warnings / errors) not related to my application
  • the output window which shows during the debugging seems to contain a lot of errors (red text) that do not relate to problems (they also appear when the app is functioning fine) for instance D/Mono (28288): AOT: image 'System.ComponentModel.TypeConverter.dll.so' not found: dlopen failed: library "/data/app/com.companyname.MyCompany-1/lib/arm/libaot-System.ComponentModel.TypeConverter.dll.so" not found

Things I've chosen to do which might impact my current experience:

  • use .net standard (2.0) instead of pcl
  • use packagereferences where I can instead of packages.config
  • using freshmvvm with it's IOC to resolve services

Things on my mind that I could be doing wrong:

  • some kind of debugging setting is wrong
  • I am not aware of some debugging strategy that exists and could make my life easier diagnosing problems
  • some kind of build problem that prevents de debugger on the emulator from working correctly (getting errors like 12-08 11:00:39.404 D/Mono (28288): AOT: image 'System.ComponentModel.dll.so' not found: dlopen failed: library "/data/app/com.companyname.MyCompany-1/lib/arm/libaot-System.ComponentModel.dll.so" not found)
  • am I using the right kind of emulator?

My current debugging tools

  • output window
  • error list
  • stepping through code
  • device log (logcat)

Any help would be appreciated

GoogleMap Marker icon issue in renderer

$
0
0

I'm making renderers in my project, so that the PinType enum will actually have an effect by changing the color of the pins. But whenever I use a non-default icon for the native Marker, it draws as the default icon on top of my icon, with the default disappearing on click.

Here are some screenshots from using marker.SetIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueGreen)):

image image

And here are some from using marker.SetIcon(BitmapDescriptorFactory.FromResource(Resource.Drawable.ic_launcher)) (my app icon):

image image

And here is my renderer code:

[assembly: ExportRenderer(typeof(ExtendedMap), typeof(ExtendedMapRenderer))]
namespace eLationTechnician.Forms.Droid.Renderers
{
    public class ExtendedMapRenderer : MapRenderer
    {
        protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.View> e)
        {
            base.OnElementChanged(e);

            if(e.NewElement != null)
            {
                UpdatePins();
            }
        }

        protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            base.OnElementPropertyChanged(sender, e);

            if(e.PropertyName == "Pins")
            {
                UpdatePins();
            }
        }

        private void UpdatePins()
        {
            NativeMap.Clear();

            foreach(var pin in Map.Pins)
            {
                var marker = new MarkerOptions()
                    .SetPosition(new LatLng(pin.Position.Latitude, pin.Position.Longitude))
                    .SetTitle(pin.Label).SetSnippet(pin.Address);

                float hue = 0.0f;
                switch (pin.Type)
                {
                    case PinType.Generic:
                    case PinType.SearchResult:
                    {
                        hue = BitmapDescriptorFactory.HueRed;
                        break;
                    }
                    case PinType.SavedPin:
                    {
                        hue = BitmapDescriptorFactory.HueGreen;
                        break;
                    }
                    case PinType.Place:
                    {
                        hue = BitmapDescriptorFactory.HueBlue;
                        break;
                    }
                }

                marker.SetIcon(BitmapDescriptorFactory.DefaultMarker(hue));

                NativeMap.AddMarker(marker);
            }
        }
    }
}

Problem with OnPlatform and UWP

$
0
0

HI guys,
I have a problem with OnPlatform.

<ToolbarItem x:Name="toolbarSave" Command="{Binding SaveWord}" Order="Primary" Priority="0" Text="Save">
    <ToolbarItem.Icon>
        <OnPlatform x:TypeArguments="FileImageSource" UWP="Images/Save.png" />
    </ToolbarItem.Icon>
</ToolbarItem>

The Xamarin.Forms version I'm using is 2.5.0.121934

At Runtime I receive the following error

Cannot assign property "UWP": Property does not exists, or is not assignable, or mismatching type between value and property

UWP Error

using Broadcasterreceiver and intent to get incoming call number

$
0
0

Hi,
I tried to use a BroadcasterReceiver to get the incoming call number, of course I need it on the Android version of the app (I think on iOS is not allowed)
I've tried to get the "android.intent.action.ACTION_PHONE_STATE_CHANGED" Intent, and implemented the OnReceive method as follow:

[BroadcastReceiver(Enabled = true)]
[IntentFilter(new[] { "android.intent.action.ACTION_PHONE_STATE_CHANGED" })]
public class IncomingCallReceiver: BroadcastReceiver
{
public override void OnReceive(Context context, Intent intent)
{
// ensure there is information
if (intent.Extras != null)
{
// get the incoming call state
string state = intent.GetStringExtra(TelephonyManager.ExtraState);

            // check the current state
            if (state == TelephonyManager.ExtraStateRinging)
            {
                // read the incoming call telephone number...
                string telephone = intent.GetStringExtra(TelephonyManager.ExtraIncomingNumber);
                // check the reade telephone
                if (string.IsNullOrEmpty(telephone))
                {
                    telephone = string.Empty;
                }
                else
                {
                    // Se funziona devo fare chiamata a server per sapere di chi parliamo
                    Toast.MakeText
                    (
                        context,
                             "Stai ricevendo una chiamata da : " + telephone,
                        ToastLength.Long
                    ).Show();
                }
            }
            else if (state == TelephonyManager.ExtraStateOffhook)
            {
                // incoming call answer
            }
            else if (state == TelephonyManager.ExtraStateIdle)
            {
                // incoming call end
            }
        }
    }
}

I need it works on Android version starting from 4.4 till latest one.
Unfortunately it doesn't works on any version. The OnReceive method never starts, the event never fires.
Can anyone help me?
thank you in advance.

科廷科技大学新加坡分校毕业,证,@扣微9270079速办毕业,证,文,凭和成绩,单和留信认,证,教育部认,证 ,

Hello, Xamarin.Forms Multiscreen Issue

$
0
0

I am trying to work through this tutorial:

https://developer.xamarin.com/guides/xamarin-forms/getting-started/hello-xamarin-forms-multiscreen/quickstart/

When I try to build, I get the following error:

Position 14:19. No property, bindable property, or event found for 'ItemsSource', or mismatching type between value and property.
in CallHistoryPage.xaml

I have double checked and all my code matches the example. The first part of the tutorial (Hello, Xamarin.Forms) worked fine. Can anyone help about what may be going on?

In passing, this is a stunningly unhelpful error message. First it combines two quite different errors forcing you to investigate both. Second it says two types mismatch but fails to say what the types are!

Also these tutorials need to be updated to VS2017, in particularly the "new"dialogs are not exactly as shown.

Not a good first impression guys!


新加坡物流管理学院毕业,证,@扣微9270079速办毕业,证,文,凭和成绩,单学历认证和留信认,证,教育部认,证

新加坡莎顿国际学院毕业,证,@扣微9270079速办毕业,证,文,凭和成绩,单学历认证和留信认,证,教育部认,证

詹姆斯库克大学新加坡分校,@扣微9270079速办毕业,证,文,凭和成绩,单学历认证和留信认,证,教育部认,证 ,

Tabbed Chlid Page OnApearing Invoking Twice

$
0
0

Hey Guys

I'm using TabbedPage having two child inside e.g. A and B (XAML)

Now when I'm navigating to TabbedPage so, A page OnAppearing invoking two time which my default page in tab. is this the default behavior in tab or I'm doing something wrong ?

Thanks

伦敦城市大学毕业,证,@扣微9270079速办【毕业,证】伦敦城市大学学位证,留信认,证,大学成绩,单和留学文,凭

Viewing all 89864 articles
Browse latest View live


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