Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all 204402 articles
Browse latest View live

Memory leak with simplest back/forth navigation in Forms Android App

$
0
0

I'm investigating a memory leak (or leaks) which seem to be core to our Forms app.

We're using FreshMvvm, which previously had a pretty bad leak due to Pages/PageModels not being garbage collected. Michael Ridland (FreshMvvm) author) fixed that, which is great.

However, we're still seeing the figure returned by GC.GetTotalMemory() steadily increase. It does decrease, but the general trend is upwards.

I've stripped things right back so that I've just got a plain Page which pushes another page and we can then pop back to the first.

Doing this, I'm seeing GC.GetTotalMemory() generally increase by 2K - 4K every cycle. This is after forcibly calling GC.Collect();

We're running Xamarin.Forms 2.3.4.270 - I know this is quite old, but we really don't want to upgrade as we don't want to introduce 'new Forms' bugs! However, I have tried experimentally upgrading to 2.5.0.121934, and I see the same behaviour (as well as aspects of the app stop working with this version).

Short of using Profiler, are there any investigative techniques I can use to find the culprit?

My next step will be to strip more and more out!


Xamarin.iOS and huge number of modules loaded

$
0
0

My crash dumps show that a huge number of modules are loaded in the process, 448 to be precise.
Some of them are actually used (like UIKit or Foundation), some must be system stuff (libSystem*) and some dependencies (like CoreGraphics).
Many of them I can't explain though, like Metal, CameraKit, ChatKit, EmojiKit.

Does Xamarin.iOS import all of those modules, regardless if they're used of not? That's the only explanation I have.

unable to set target framework

$
0
0

Using VS2017 I created a Blank App (Android). I received this error:

Project Phoneword cannot build using Android 7.1 (API Level 25 - Nougat) because Android SDK platform for API Level 25 is not installed. Either install it in the Android SDK Manager (Tools->Android->Android SDK Manager...), or change your Xamarin.Android project to target an API version that is installed.

I tried to set the Target Framework, but the list is empty, please see this screenshot:

Source Code Analysis For Xamarin Project With SonarQube On Mac.

$
0
0

Hi All,

Please find the below steps to implement sonarqube analysis for your Xamarin Project .

Requirements & Installation Steps :

1. MSBuild : MSbuild will be installed along with Mono already in your machine to verify, Please execute the below command in terminal
        * which msbuild
        * /Library/Frameworks/Mono.framework/Versions/Current/Commands/msbuild

2. Install Brew (You might have it already).
        * ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
        * To Check installation Open Terminal and Run "brew update"

3. Install Sonar :
        * brew install sonar
        * brew install sonar-runner

3. Run Sonar In Terminal:
        "Sonar Console" :smile:

4. Login To Sonar In Local Machine:
        Open Browser and enter "http://localhost:9000"
        Login as admin, Password- admin

5. MSbuild for SonarQube :
        * The SonarQube version should be > 4.0 +, ********In order to run on NON WINDOW OS Platform. ******** :  Killed my days
        * Download the plugin from - > https://docs.sonarqube.org/pages/viewpage.action?pageId=6954799
        * Have it in your preferred location.

    6. SonarC#.
        * One more Compatibility issue, The sonarQube 6.7 has the sonarC# Plugin 6.6 in administration -> marketplace, which was having issue in scanning C# code from mac. (Killed My Day Again)

        * If the version was updated by the time you read this, Please use that. You can find the official release version in.
            [https://docs.sonarqube.org/pages/viewpage.action?pageId=1441900]

        * SonarC# Plugin Download
            [https://github.com/SonarSource/sonar-csharp/releases/tag/6.7.0.4267]

        * Add SonarC# Plugin: 6.7 (This can be added manually to the Sonar Plugin folder)
                              * Open in finder /usr/local/Cellar/sonarqube/6.7/libexec/extensions/plugins
              * Paste the plugin
              * Restart sonar in terminal -> sonar restart

7. Create a Login Token In Sonar.
        * Go to sonar portal in local machine -> https://localhost:9000/
        * Login
        * Go to administration -> Security -> create new token-> Copy the token.

8. Analyse Source Code.
        * Go the source code root folder, the folder that has the project file that you want to build.
        * Run the below commands

        1. mono /<PATH TO THE MSBUILD_FOR_SONAR_LOCATION>/sonar-scanner-msbuild-4.0.0.731/MSBuild.SonarQube.Runner.exe begin /k:"COM.YOGI.AWESOME.APP" /n:"APP NAME" /v:"1.0" /d:sonar.login="TOKEN THAT YOU HAVE COPIED IN STEP 8"
                    2. MSbuild /t:rebuild
        3. mono /<PATH TO THE MSBUILD_FOR_SONAR_LOCATION>//sonar-scanner-msbuild-4.0.0.731/MSBuild.SonarQube.Runner.exe end

     9. Once Success You can find the report in Sonar.
10. Login to SonarQube as in Step  4. Report should be available

Thanks

Xamarin.iOS code sign error using iOS 11.1

$
0
0

I'm trying to build my iOS application using my new iOS build machine using iOS 11.1.

However when I build my application I get the following error:

        15>  Codesign: 2017-12-05T17:13:01.9997912+00:00 - Logging messages
        15>  Codesign Task
        15>    CodesignAllocate: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
        15>    DisableTimestamp: True
        15>    Entitlements: obj/iPhone/Debug/Entitlements.xcent
        15>    Keychain: <null>
        15>    Resources:
        15>      bin/iPhone/Debug/MyApp.iOS.app
        15>    ResourceRules: <null>
        15>    SigningKey: 1F4A95333C89923DCB777A2DC213ED088E28D9D1
        15>    ExtraArgs: <null>
        15>    IsAppExtension: False
        15>  Tool /usr/bin/codesign execution started with arguments: -v --force --sign 1F4A95333C89923DCB777A2DC213ED088E28D9D1 --entitlements /Users/me/Library/Caches/Xamarin/mtbs/builds/MyApp.iOS/8e10175d0d7b53fc009bbcaa305356f0/obj/iPhone/Debug/Entitlements.xcent --timestamp=none /Users/me/Library/Caches/Xamarin/mtbs/builds/MyApp.iOS/8e10175d0d7b53fc009bbcaa305356f0/bin/iPhone/Debug/MyApp.iOS.app
        15>  Tool /usr/bin/codesign execution finished (exit code = 1).
        15>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(1837,3): error : /Users/me/Library/Caches/Xamarin/mtbs/builds/MyApp.iOS/8e10175d0d7b53fc009bbcaa305356f0/bin/iPhone/Debug/MyApp.iOS.app: unknown error -1=ffffffffffffffff
        15>  Codesign: 2017-12-05T17:13:02.0022906+00:00 - Finished
        15>Done executing task "Codesign" -- FAILED.
        15>Done building target "_CodesignAppBundle" in project "MyApp.iOS.csproj" -- FAILED.

I have already created a new signing identity and provisioning profile and still the same error
If anyone has come across this in the past any information would be really appreciated.

Google Login With xamarin forms

$
0
0

Hello Guys,
I'm new in xamarin forms and i try to build app which customers can login with facebook and google.
FAcebook login works perfectly but i can't find any solution about who to build a Google login because Google change security and have been blocked
Webview.
Any solution to my problem?
Thanks.

Custom Label renderer crashes due to NullReferenceException when removing items from ListView

$
0
0

Hi,

I'm experiencing a strange issue with my custom Label renderer. My custom renderer keeps crashing due to a NullReferenceException while disposing its instance. I'm gonna attach my custom renderer at the bottom of this text. I'll try to reproduce the issue in brief:

Case 1:

  • Create a ContentView and set my custom Label as its content.
  • Add the ContentView created above into a generic Layout (e.g. StackLayout).
  • Once the custom Label is instantiated, remove the whole ContentView from the generic Layout.
  • The custom Label renderer WON'T crash.

Case 2:

  • Create a ViewCell and set my custom Label as its content.
  • Create an ObservableCollection containing various instances of String type.
  • Set the ViewCell as ItemTemplate of a generic ListView.
  • Set the above ObservableCollection as ItemsSource.
  • Finally remove an item from the above ListView.
  • The custom Label renderer WILL crash.

I don't know how to solve this issue. Is there something related directly to the ListView? Why my custom Label renderer crashes only when it gets disposed from a ListView? My custom Label renderer does not override the Dispose() method of the LabelRenderer class. It's a very strange behaviour to me. Waiting for your help, thanks in advance.

CustomLabel

using MyProject.Helpers;
using Xamarin.Forms;

namespace MyProject.Renders
{
    public class CustomLabel : Label
    {
        #region LineSpacing
        public static readonly BindableProperty LineSpacingProperty = BindableProperty.Create(nameof(LineSpacing), typeof(float), typeof(CustomLabel), 1.1f);
        /// <summary>
        /// Gets or sets the extra spacing between lines of text, as a multiplier.
        /// </summary>
        public float LineSpacing
        {
            get => (float)GetValue(LineSpacingProperty);
            set => SetValue(LineSpacingProperty, value);
        }
        #endregion

        #region HasShadow
        public static readonly BindableProperty HasShadowProperty = BindableProperty.Create(nameof(HasShadow), typeof(bool), typeof(CustomLabel), false);
        /// <summary>
        /// Gets or sets whether the text should have a shadow.
        /// </summary>
        public bool HasShadow
        {
            get => (bool)GetValue(HasShadowProperty);
            set => SetValue(HasShadowProperty, value);
        }
        #endregion

        #region ShadowColor
        public static readonly BindableProperty ShadowColorProperty = BindableProperty.Create(nameof(ShadowColor), typeof(Color), typeof(CustomLabel), Color.Black);
        /// <summary>
        /// Gets or sets the shadow color of the text.
        /// </summary>
        public Color ShadowColor
        {
            get => (Color)GetValue(ShadowColorProperty);
            set => SetValue(ShadowColorProperty, value);
        }
        #endregion

        #region ShadowRadius
        public static readonly BindableProperty ShadowRadiusProperty = BindableProperty.Create(nameof(ShadowRadius), typeof(int), typeof(CustomLabel), 5);
        /// <summary>
        /// Gets or sets the shadow radius of the text.
        /// </summary>
        public int ShadowRadius
        {
            get => (int)GetValue(ShadowRadiusProperty);
            set => SetValue(ShadowRadiusProperty, value);
        }
        #endregion

        #region ShadowDistanceX
        public static readonly BindableProperty ShadowDistanceXProperty = BindableProperty.Create(nameof(ShadowDistanceX), typeof(int), typeof(CustomLabel), 5);
        /// <summary>
        /// Gets or sets the horizontal offset of the text shadow.
        /// </summary>
        public int ShadowDistanceX
        {
            get => (int)GetValue(ShadowDistanceXProperty);
            set => SetValue(ShadowDistanceXProperty, value);
        }
        #endregion

        #region ShadowDistanceY
        public static readonly BindableProperty ShadowDistanceYProperty = BindableProperty.Create(nameof(ShadowDistanceY), typeof(int), typeof(CustomLabel), 5);
        /// <summary>
        /// Gets or sets the vertical offset of the text shadow.
        /// </summary>
        public int ShadowDistanceY
        {
            get => (int)GetValue(ShadowDistanceYProperty);
            set => SetValue(ShadowDistanceYProperty, value);
        }
        #endregion

        #region Html
        public static readonly BindableProperty HtmlProperty = BindableProperty.Create(nameof(Html), typeof(bool), typeof(CustomLabel), false);
        /// <summary>
        /// Gets or sets whether the text should be rendered as HTML text.
        /// </summary>
        public bool Html
        {
            get => (bool)GetValue(HtmlProperty);
            set => SetValue(HtmlProperty, value);
        }
        #endregion

        #region FontName
        public static readonly BindableProperty FontNameProperty = BindableProperty.Create(nameof(FontName), typeof(string), typeof(CustomLabel), Utils.GetGeneralLightFont());
        /// <summary>
        /// Gets or sets the font name of the text. Does not require the font ".ttf" extension.
        /// </summary>
        public string FontName
        {
            get => (string)GetValue(FontNameProperty);
            set => SetValue(FontNameProperty, value);
        }
        #endregion

        #region FontSizeMultiplier
        public static readonly BindableProperty FontSizeMultiplierProperty = BindableProperty.Create(nameof(FontSizeMultiplier), typeof(float), typeof(CustomLabel), 1.0f);
        /// <summary>
        /// Gets or sets the extra custom font size, as a multiplier.
        /// </summary>
        public float FontSizeMultiplier
        {
            get => (float)GetValue(FontSizeMultiplierProperty);
            set => SetValue(FontSizeMultiplierProperty, value);
        }
        #endregion

        #region Padding
        public static readonly BindableProperty PaddingProperty = BindableProperty.Create(nameof(Padding), typeof(Thickness), typeof(CustomLabel), new Thickness(0));
        /// <summary>
        /// Gets or sets the inner padding.
        /// </summary>
        public Thickness Padding
        {
            get => (Thickness)GetValue(PaddingProperty);
            set => SetValue(PaddingProperty, value);
        }
        #endregion

        #region IsHeader
        public static readonly BindableProperty IsHeaderProperty = BindableProperty.Create(nameof(IsHeader), typeof(bool), typeof(CustomLabel), false);
        /// <summary>
        /// Gets or sets whether the text should be rendered as an header text with marquee ellipsize.
        /// </summary>
        public bool IsHeader
        {
            get => (bool)GetValue(IsHeaderProperty);
            set => SetValue(IsHeaderProperty, value);
        }
        #endregion

        #region MaxLines
        public static readonly BindableProperty MaxLinesProperty = BindableProperty.Create(nameof(MaxLines), typeof(int), typeof(CustomLabel), 0);
        /// <summary>
        /// Gets or sets the number of lines that CustomLabel should be tall.
        /// </summary>
        public int MaxLines
        {
            get => (int)GetValue(MaxLinesProperty);
            set => SetValue(MaxLinesProperty, value);
        }
        #endregion

        #region BreakMode
        public enum BreakMode { Start, End, None };
        public static readonly BindableProperty EllipsizeProperty = BindableProperty.Create(nameof(Ellipsize), typeof(BreakMode), typeof(CustomLabel), BreakMode.None);
        /// <summary>
        /// Gets or sets the ellipsize type.
        /// </summary>
        public BreakMode Ellipsize
        {
            get => (BreakMode)GetValue(EllipsizeProperty);
            set => SetValue(EllipsizeProperty, value);
        }
        #endregion
    }
}

[Android] CustomLabelRenderer

using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
using Android.Graphics;
using System.ComponentModel;
using Android.Util;
using Android.OS;
using Android.Text;
using static Android.Text.TextUtils;

using MyProject.Renders;
using MyProject.Droid.Renders;
using MyProject.Droid.Helpers;
using Android.Content;

[assembly: ExportRenderer(typeof(CustomLabel), typeof(CustomLabelRenderer))]
namespace MyProject.Droid.Renders
{
    class CustomLabelRenderer : LabelRenderer
    {
        CustomLabel @CustomLabel;
        int MarqueeRepeatLimit = -1; // INFINITE

        public CustomLabelRenderer(Context context) : base(context) { }

        protected override void OnElementChanged(ElementChangedEventArgs<Label> e)
        {
            base.OnElementChanged(e);
            if (e.OldElement == null && e.NewElement != null)
            {
                @CustomLabel = (CustomLabel)e.NewElement;
                Initialize();
            }
        }

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

            if (IsRendererAvailable() &&
                e.PropertyName.Equals(CustomLabel.FontNameProperty.PropertyName))
                UpdateFont();

            if (IsRendererAvailable() &&
                e.PropertyName.Equals(Label.FontSizeProperty.PropertyName) ||
                e.PropertyName.Equals(CustomLabel.FontSizeMultiplierProperty.PropertyName))
                UpdateFontSize();

            if (IsRendererAvailable() &&
                e.PropertyName.Equals(CustomLabel.LineSpacingProperty.PropertyName))
                UpdateLineSpacing();

            if (IsRendererAvailable() &&
                e.PropertyName.Equals(CustomLabel.MaxLinesProperty.PropertyName))
                UpdateMaxLines();

            if (IsRendererAvailable() &&
                e.PropertyName.Equals(CustomLabel.EllipsizeProperty.PropertyName))
                UpdateEllipsize();

            if (IsRendererAvailable() &&
                e.PropertyName.Equals(CustomLabel.IsHeaderProperty.PropertyName))
                UpdateHeader();

            if (IsRendererAvailable() &&
                e.PropertyName.Equals(CustomLabel.HasShadowProperty.PropertyName) ||
                e.PropertyName.Equals(CustomLabel.ShadowDistanceXProperty.PropertyName) ||
                e.PropertyName.Equals(CustomLabel.ShadowDistanceYProperty.PropertyName) ||
                e.PropertyName.Equals(CustomLabel.ShadowColorProperty.PropertyName) ||
                e.PropertyName.Equals(CustomLabel.ShadowRadiusProperty.PropertyName))
                UpdateShadow();

            if (IsRendererAvailable() &&
                e.PropertyName.Equals(Label.TextProperty.PropertyName) ||
                e.PropertyName.Equals(CustomLabel.HtmlProperty.PropertyName))
                UpdateHtml();

            if (IsRendererAvailable() &&
                e.PropertyName.Equals(CustomLabel.PaddingProperty.PropertyName))
                UpdatePadding();
        }

        void Initialize()
        {
            UpdateFont();
            UpdateFontSize();
            UpdateLineSpacing();
            UpdateMaxLines();
            UpdateEllipsize();
            UpdateHeader();
            UpdateShadow();
            UpdateHtml();
            UpdatePadding();
        }

        void UpdateFont()
        {
            Control.Typeface = Typeface.CreateFromAsset(
                MainActivity.MainContext.ApplicationContext.Assets,
                $"{@CustomLabel.FontName}.ttf"
            );
        }

        void UpdateFontSize()
        {
            Control.SetTextSize(
                ComplexUnitType.Sp,
                (float)@CustomLabel.FontSize * @CustomLabel.FontSizeMultiplier
            );
        }

        void UpdateLineSpacing()
        {
            Control.SetLineSpacing(2.5f, @CustomLabel.LineSpacing);
        }

        void UpdateMaxLines()
        {
            if (@CustomLabel.MaxLines > 0)
                Control.SetMaxLines(@CustomLabel.MaxLines);
        }

        void UpdateEllipsize()
        {
            if (@CustomLabel.Ellipsize != CustomLabel.BreakMode.None)
                Control.Ellipsize = @CustomLabel.Ellipsize == CustomLabel.BreakMode.Start ?
                                    TruncateAt.Start : TruncateAt.End;
        }

        void UpdateHeader()
        {
            if (@CustomLabel.IsHeader)
            {
                Control.SetMaxLines(1);
                Control.Ellipsize = TruncateAt.Marquee;
                Control.SetMarqueeRepeatLimit(MarqueeRepeatLimit);
                Control.HorizontalFadingEdgeEnabled = true;
                Control.SetHorizontallyScrolling(true);
                Control.Focusable = true;
                Control.FocusableInTouchMode = true;
                Control.Selected = true;
            }
        }

        void UpdateShadow()
        {
            if (@CustomLabel.HasShadow)
                Control.SetShadowLayer(
                    @CustomLabel.ShadowRadius,
                    @CustomLabel.ShadowDistanceX,
                    @CustomLabel.ShadowDistanceY,
                    @CustomLabel.ShadowColor.ToAndroid()
                );
        }

        void UpdateHtml()
        {
            if (@CustomLabel.Html && !string.IsNullOrEmpty(@CustomLabel.Text))
            {
                ISpanned textFromHtml = default(ISpanned);
                #pragma warning disable CS0618
                if (Utils.IsAndroidVersionSatisfied(BuildVersionCodes.N))
                    textFromHtml = Html.FromHtml(@CustomLabel.Text, FromHtmlOptions.ModeLegacy);
                else textFromHtml = Html.FromHtml(@CustomLabel.Text);
                #pragma warning restore CS0618
                Control.Text = textFromHtml.ToString().Trim();
            }
        }

        void UpdatePadding()
        {
            Control.SetPadding(
                (int)@CustomLabel.Padding.Left,
                (int)@CustomLabel.Padding.Top,
                (int)@CustomLabel.Padding.Right,
                (int)@CustomLabel.Padding.Bottom
            );
        }

        bool IsRendererAvailable() => Control != null && Element != null && @CustomLabel != null;
    }
}

"Open With" Dialog Is Opening - Google Login With Xamarin.Auth

$
0
0

Hello guys,
I'm trying to make Google Login with Xamarin.Auth v1.3.2.7 but it behaves weird. My Login Page Renderer is here:

`
[assembly: ExportRenderer(typeof(LoginPage), typeof(LoginPageRenderer))]
namespace AhtapotRestApp.Droid.CustomRenderers
{
public class LoginPageRenderer : PageRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs e)
{
base.OnElementChanged(e);

        var activity = this.Context as Activity;

        var auth = new OAuth2Authenticator(
            clientId: new Func<string>
                        (
                             () =>
                             {
                                 string retval_client_id = "oops something is wrong!";
                                 switch (Xamarin.Forms.Device.RuntimePlatform)
                                 {
                                     case "Android":
                                         retval_client_id = "id";
                                         break;
                                     case "iOS":
                                         retval_client_id = "id";
                                         break;
                                     case "Windows":
                                         retval_client_id = "id";
                                         break;
                                 }
                                 return retval_client_id;
                             }
                       ).Invoke(),
            scope: "",
            authorizeUrl: new Uri("https://accounts.google.com/o/oauth2/auth"),
            redirectUrl: new Uri("http://code35.net"), getUsernameAsync: null,
                 isUsingNativeUI: true);


        auth.Completed += (sender, eventArgs) => {
            if (eventArgs.IsAuthenticated)
            {
                App.SuccessfulLoginAction.Invoke();
                App.SaveToken(eventArgs.Account.Properties["access_token"]);
            }
            else
            {
                // The user cancelled
            }
        };
        activity.StartActivity(((CustomTabsIntent)auth.GetUI(activity)).Intent);
    }
}

}`

When I click the login button, it's opening "Open With" dialog (Please look at the picture below). Why is this happening? Any help would be appreciated. Thanks.

@moljac


How to publish multiple apks per selected ABI on google playstore?

$
0
0

I have asked this question on SO long time ago but I didnt get answer. I would like to ask it again.
It is advised to use this option "Generate one package(.apk) per selected ABI" in order to reduce App size but what can I do with those single apk's? how can upload them to Google playstore? I can only upload 1 apk as far as I know. what is the proper way?

Need Xamarin Developer-Houston or Dallas, Texas

$
0
0

XAMARIN DEVELOPER

Location in Houston, Dallas, or Tampa office.

Job Summary

** THIS IS NOT REMOTE POSITION **
** NO C2C**
** CONTRACT TO HIRE AFTER 6 MONTHS

We are looking for a strong software developer with emphasis on Xamarin mobile development technologies. This position is full time and can be based out of either our Detroit office or onsite at client location in Houston, Dallas, or Tampa office.
Qualifications and Skills
Requirements:
• 4 or more years of software development with extensive knowledge of C#, .NET, EF, SQL
• 2 or more years’ experience with Xamarin, Xamarin.Forms, XAML
• Solid understanding of MVVM and data binding concepts
• Knowledge of how to use async / await
• Knowledge of how to utilize SQLite and Azure Mobile Services
• Able to read and write lambda expressions
• Able to build re-usable bindable controls
• Able to build platform specific (iOS, Android, UWP) custom renderers
• Able to write Unit Tests & UI Tests for Xamarin Test Cloud
• Proficient in Visual Studio, TFS, SQL Management Studio

Benefits
401(K), Healthcare, Vacation

Please send your resume to: Raj.Makwana@aisoftwarellc.com

AI Software is a custom software development and IT professional services company based in Troy, Michigan. AIS started in 2009 and have offices in US and India. Our team consists of Full-stack Web and Mobile developers with skills in Microsoft stack. We are also Telerik Partner and Xamarin Consulting Partner and we develop solutions using these tools.
Job Type: Full-time

Qualification Questions
You have requested that Indeed ask candidates the following questions:
• How many years of .Net, C# experience do you have?
• How many years of Xamarin, Xamarin Forms experience do you have?
• Have you completed the following level of education: Bachelor's?
• Are you in Houston, TX?

Xam Consulting is hiring! (Sydney, Australia)

$
0
0

Want to work at Australia's top Xamarin consultancy?

Xam Consulting is hiring!

We are looking for a mid-to-senior Xamarin developer to work on everything from greenfield apps to project rescues to customer training.

Interested?

Then apply here! https://www.seek.com.au/job/35054051

I can't build my project when i add GooglePlayServices !!!

$
0
0

Hello,

i need to add googleplayservices version 29.0.0.2 to my project but i am getting this error when i building my project, i don't understand what this error is about!
<br /> /Users/comenscene/Desktop/projects/epf/packages/Xamarin.GooglePlayServices.Basement.29.0.0.2/build/Xamarin.GooglePlayServices.Basement.targets(5,5): Error MSB4062: The "Xamarin.GooglePlayServices.Tasks.ProcessGoogleServicesJson" task could not be loaded from the assembly /Users/comenscene/Desktop/projects/epf/packages/Xamarin.GooglePlayServices.Basement.29.0.0.2/build/Xamarin.GooglePlayServices.Tasks.dll. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. (MSB4062) (epf.Droid)<br />
could anyone help me out on this?

Cannot install Support.v4 in order to use ViewPager

$
0
0

I have tried numerous ways to install Support.v4. The first was to use the Package Manager Console. The error it gives me is "Package 'Xamarin.Android.Support.Compat.24.2.1' does not exist in project 'SlidingTabLayoutTutorial.Droid'. I have installed the latest API 25 and API 24 onto this environment. I do not understand why this error comes up. I also try to install through the NuGet Package manager the Xamarin Android Support V4 and nothing happens. It doesn't install. I get no error. No nothing. I have no idea where to go to find any log for it however I am assuming it is erroring out on the same thing. Any one know what I have forgotten? Is there an easier way to get ViewPager?

Thanks!

Background Tasks in iOS

$
0
0

Hello Xamarin.iOS community,

I have a problem in Xamarin iOS, which I still not found a solution, and I need help in order to solve.

I´m trying to create an application that do a task every X minutes, and on that there is not a problems. I created a task and setted it to happen from X minutes in X minutes.

The problem is when after some hours the iPhone OS shutdown my application, for any reason. I already try to catch the override methods in order to understand, a more specific reason why it shutdown, but on my log files, it doesn’t enter on those function, being immediately killed by the OS.

I implemented the “Background Fetch” (adding the option in the Background Modes), with an interval to check for the application, and in spite of that the SO continuous to kill the application.

Anyone have any suggestions, which can help in order to solve this situation?

Thanks in advance.

Do I need a Mac even when I am developing on Windows

$
0
0

I want to develop an Apple app on a Windows 10 Laptop. I have downloaded Visual Studio 2017 and began to create an App. When I test the app, it is asking me to connect to a Mac. Do I ready need a Mac to be able to test my apps or is there something else I can get round it please?

I have got an IPad if I can test apps on that if possible?


How to get access to the window object inside a WebView

$
0
0

I am using WebView to show a third party's content. They have two versions: one for desktop, one for mobile devices. They use javascript to check what device the client is using. Basically they try to determine it with the max width of the window object created by the browser. The js code:

     this.isMobile = function() {
            return "undefined" != typeof window.orientation
        }
        ,
        this.isPhone = function() {
            return window.matchMedia && (window.matchMedia("(max-width: 320px)").matches || window.matchMedia("(max-device-width: 720px)").matches) || 320 == (!window.matchMedia && window.innerWidth > 0 ? window.innerWidth : screen.width)
        }

So, if I can set the max-width property of the window object, I can get the correct version to show. But how to get the handle to set the max-width property of the window object? I tried to set the WebView's width by changing the WidthRequest="" in xaml, but it seems to be ignored by the js or the window object because I still got the desktop version.

Anyone knows a solution? Thanks in advance.

Load ListView from FTP server - XAMARIN FROMS

$
0
0

Hi guys,

I'm trying to add data to list from Ftp sever.
now i'm using this code that works perfect on Debug -

Code

' private void ConnectAndGetNames()
    {
            var request = CreateRequest("ftp://..../folder/", WebRequestMethods.Ftp.ListDirectory); '

    '    using (var response = (FtpWebResponse)request.GetResponse())
        {
            using (var stream = response.GetResponseStream())
            {
                using (var reader = new StreamReader(stream, true))
                {
                    while (!reader.EndOfStream)
                    {
                      DataListX.observableCollection.Add(new DataListXo { Mydataname = reader.ReadLine() });
                    }
                }
            }
        }
    }

    private FtpWebRequest CreateRequest(string uri, string method)
    {
        var r = (FtpWebRequest)WebRequest.Create(uri);

        r.Credentials = new NetworkCredential("username", "password");
        r.Method = method;

        return r;
    }'

OnCreate

'

        ConnectAndGetNames();
        InitializeComponent();
        MyListView.ItemsSource = DataListX.observableCollection;
        // Content = MyListView;

'
but on Release the Views didn't shown after activate with Android Layout.. The app just minimize or hiding herself. kind of crash..

Someone can recognize the problem ? thanks in advance

No Firebase support in forms ?

$
0
0

I see lots of platform specific implementations of Firebase and such from Xamarin but how about acknowledging that Firebase is way ahead of Azure and supporting it on Xamarin forms?

Come on guys ..... I have been using forms because you said it was going to only get better over time and it has but it seems you are ignoring one of the MOST SIGNIFICANT backend platforms in Firebase.

I may have missed the cross platform implementation somewhere so if I have please point me to it.

Thanks

This project type requires Xamarin.Android to be installed help!

$
0
0

After updating, this error appeared

This project type requires Xamarin.Android to be installed help!

See What’s New in Visual Studio 2017 Version 15.5

$
0
0

Today we released Visual Studio 2017 version 15.5 into stable! Read the blog post here for more information and feel free to discuss below!

Viewing all 204402 articles
Browse latest View live


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