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

Unexplained lag on Xamarin Android when preparing to push a view when triggered by Deep Link

$
0
0

My Android Xamarin Forms App is exhibiting a 10 to 30 second lag when creating a ViewModel/View and pushing the View to the modal stack at runtime.

The application is receiving a deep link successfully, but then experiences a considerable performance lag when trying to show the desired view.

The same application executing on IOS does not have this lag.

Looking at the logs and code, the lag happens at the line I've marked with '-->' below, after MT2 but before MT3 log entries.

I have been experimenting with Device.BeginInvokeOnMainThread to see if it makes the problem better or worse, but have seen no effect for this issue.

Any idea what the perf hangup might be?

Code

protected override async void OnAppLinkRequestReceived(Uri uri)
{
    //Aside:  I would rather use System.Web.HttpUtility to parse this query string, but it seems I can't in an Xam PCL.

    //Pattern:
    //my.app.deeplink://<command>?<params>
    //Examples:                             
    //  Deep Linking Web Navigation:
    //      my.app.deeplink://webnav?url=/ns/products/product/?id=1234&param1=value1&param2=value2
    //  Deep Linking Native Navigation:
    //      my.app.deeplink://view?name=SettingsPageView&param1=value1&param2=value2

    try
    {
        m_oLogging.LogInfo("OnAppLinkRequestReceived: " + uri.ToString());

        NavigationManager.DeepLinkCommand oDeepCmd = NavigationManager.ParseDeepLink(uri);

        switch (oDeepCmd)
        {
            case NavigationManager.DeepLinkCommand.invalid:
                m_oLogging.LogInfo("Deep Link deemed invalid.  Doing nothing.");
                break;

            case NavigationManager.DeepLinkCommand.webnav:
                //Query expected to be like:    ?url=/ns/products/product/?id=1234&param1=value1&param2=value2

                string szUri = uri.Query;
                Uri oParsedURI = WebNavigationManager.URLS.ParseDeepLinkUri(szUri);
                string szURL = oParsedURI.ToString();

                m_oLogging.LogInfo(string.Format("Proceeding with webnav to [{0}].", szURL));
                App oApp = ((App)Application.Current);

                WebNavigationManager.Instance.NavigateToURL(szURL);

                break;

            case NavigationManager.DeepLinkCommand.view:
                //Query like:    ?name=SettingsPageView&param1=value1&param2=value2

                string szView = uri.Query.Split('=')[1].Split('&')[0];
                string szViewTypeName = string.Empty;
                switch (szView)
                {
                    case "SettingsPageView":
                        szViewTypeName = typeof(SettingsPageView).Name;
                        break;
                    default:
                        //Try to dynamically present the named view.
                        szViewTypeName = "my.app.namespace." + szView;
                        break;
                }

                if (ViewIsAlreadyLoaded(szViewTypeName))
                {
                    //I'm already at that page, so chill!
                    m_oLogging.LogInfo(string.Format("View [{0}] is already loaded in one of the stacks.  No need to load it again or duplicate it.", szViewTypeName));
                }
                else
                {
                    m_oLogging.LogInfo(string.Format("Proceeding with presenting view [{0}].", szViewTypeName));
                    switch (szView)
                    {
                        case "SettingsPageView":

                            //There is nothing modal right now, or there is, but the top of the stack isn't the settings page.
                            m_oLogging.LogInfo(string.Format("Pushing known view modally: '{0}'", szViewTypeName));
                            Device.BeginInvokeOnMainThread(() =>
                            {
                                m_oLogging.LogInfo(string.Format("Pushing known view modally (MT1): '{0}'", szViewTypeName));
                                IViewModel oSPVM = new SettingsPageViewModel();
                                m_oLogging.LogInfo(string.Format("Pushing known view modally (MT2): '{0}'", szViewTypeName));
-->                          BaseView oSPV = new SettingsPageView(oSPVM);
                                m_oLogging.LogInfo(string.Format("Pushing known view modally (MT3): '{0}'", szViewTypeName));
                                MainPage.Navigation.PushModalAsync(oSPV, false);
                                m_oLogging.LogInfo(string.Format("Pushed known view modally (MT4): '{0}'", szViewTypeName));
                            });
                            m_oLogging.LogInfo(string.Format("Pushed known view modally: '{0}'", szViewTypeName));
                            break;

                        default:

                            //Try to dynamically present the named view.
                            var vViewModel = Activator.CreateInstance(Type.GetType(szViewTypeName + "Model"));
                            if (vViewModel != null)
                            {
                                var vView = Activator.CreateInstance(Type.GetType(szViewTypeName), vViewModel);
                                if (vView != null)
                                {
                                    m_oLogging.LogInfo(string.Format("Pushing dynamic view modally: '{0}'", szViewTypeName));
                                    Device.BeginInvokeOnMainThread(async() => await MainPage.Navigation.PushModalAsync(vView as Page, false));
                                    m_oLogging.LogInfo(string.Format("Pushed dynamic view modally: '{0}'", szViewTypeName));
                                }
                            }
                            break;
                    }
                }
                break;
        }
    }
    catch (Exception oExc)
    {
        m_oLogging.LogError(oExc.Message);
    }


    base.OnAppLinkRequestReceived(uri);
}

Runtime Debugging content

08-01 15:14:59.023 I/MyApp   (29249): OnAppLinkRequestReceived: my.package.name://view/?name=SettingsPageView&ampAction=Clicked
08-01 15:14:59.030 I/MyApp (29249): Proceeding with presenting view [SettingsPageView].
08-01 15:14:59.031 I/MyApp (29249): Pushing known view modally: 'SettingsPageView'
08-01 15:14:59.031 I/MyApp (29249): Pushed known view modally: 'SettingsPageView'
Thread started: #17
08-01 15:14:59.079 D/Mono (29249): [0xb7190920] worker starting
08-01 15:14:59.153 D/ViewRootImpl@3c0476fMainActivity: Relayout returned: oldFrame=[0,0][1080,2220] newFrame=[0,0][1080,2220] result=0x7 surface={isValid=true -1281830912} surfaceGenerationChanged=true
08-01 15:14:59.153 D/ViewRootImpl@3c0476fMainActivity: mHardwareRenderer.initialize() mSurface={isValid=true -1281830912} hwInitialized=true
08-01 15:14:59.162 I/MyApp (29249): Pushing known view modally (MT1): 'SettingsPageView'
Resolved pending breakpoint at 'SettingsPageViewModel.cs:25,1' to bool app.namespace.name.SettingsPageViewModel.get_PreferencePushService () [0x00001].
Resolved pending breakpoint at 'SettingsPageViewModel.cs:38,1' to bool app.namespace.name.SettingsPageViewModel.get_PreferencePushDelivery () [0x00001].
Resolved pending breakpoint at 'SettingsPageViewModel.cs:51,1' to bool app.namespace.name.SettingsPageViewModel.get_PreferencePushPromotion () [0x00001].
08-01 15:14:59.340 I/MyApp (29249): Pushing known view modally (MT2): 'SettingsPageView'
08-01 15:14:59.488 D/Mono (29249): DllImport searching in: '__Internal' ('(null)').
08-01 15:14:59.488 D/Mono (29249): Searching for 'java_interop_jnienv_call_static_object_method'.
08-01 15:14:59.488 D/Mono (29249): Probing 'java_interop_jnienv_call_static_object_method'.
08-01 15:14:59.488 D/Mono (29249): Found as 'java_interop_jnienv_call_static_object_method'. #############################[ 3 seconds of lag ] 08-01 15:15:02.826 D/TcpOptimizer(29249): [my.package.name] Full closed: sid=125, tcpi_state=8 #############################[ 1 second of lag ] 08-01 15:15:03.830 D/TcpOptimizer(29249): [my.package.name] Full closed: sid=130, tcpi_state=8
Thread finished: #15
The thread 'Unknown' (0xf) has exited with code 0 (0x0). #############################[ 26 seconds of lag ] 08-01 15:15:29.177 I/System.out(29249): (HTTPLog)-Static: isSBSettingEnabled false
08-01 15:15:29.177 I/System.out(29249): (HTTPLog)-Static: isSBSettingEnabled false
08-01 15:15:29.179 I/MyApp (29249): CustomerID: (known) e3ecf5c1-3920-4cc9-ad08-0c1b2145db2b ( <-- this code runs while data is being read from the viewmodel for the view ) 08-01 15:15:29.186 I/System.out(29249): (HTTPLog)-Static: isSBSettingEnabled false 08-01 15:15:29.187 I/System.out(29249): (HTTPLog)-Static: isSBSettingEnabled false 08-01 15:15:29.188 I/System.out(29249): (HTTPLog)-Static: isSBSettingEnabled false 08-01 15:15:29.188 I/System.out(29249): (HTTPLog)-Static: isSBSettingEnabled false Thread started: <Thread Pool> #18
08-01 15:15:29.285 D/Mono (29249): Assembly Loader probing location: '/Users/builder/data/lanes/4009/3a62f1ea/source/monodroid/builds/install/mono-armv7/lib/app.namespace.name.resources.dll'.
08-01 15:15:29.285 D/Mono (29249): Assembly Loader probing location: '/Users/builder/data/lanes/4009/3a62f1ea/source/monodroid/builds/install/mono-armv7/lib/app.namespace.name.resources.exe'.
08-01 15:15:29.291 D/Mono (29249): Assembly Loader probing location: '/storage/emulated/0/Android/data/my.package.name/files/.override/en-US/app.namespace.name.resources.dll'.
08-01 15:15:29.364 I/MyApp (29249): Pushing known view modally (MT3): 'SettingsPageView'
08-01 15:15:29.428 W/art (29249): JNI RegisterNativeMethods: attempt to register 0 native methods for md5b60ffeb829f638581ab2bb9b1a7f4f3f.LabelRenderer
08-01 15:15:29.646 W/art (29249): JNI RegisterNativeMethods: attempt to register 0 native methods for md5b6ed58bdd2dc5ff75bde29ef5e42d6e8.ExtendedSwitchRenderer
08-01 15:15:30.001 I/MyApp (29249): Pushed known view modally (MT4): 'SettingsPageView'
08-01 15:15:30.002 I/Choreographer(29249): Skipped 1851 frames! The application may be doing too much work on its main thread.
08-01 15:15:30.111 D/ScrollView(29249): onsize change changed
08-01 15:15:30.189 D/ViewRootImpl@3c0476fMainActivity: MSG_WINDOW_FOCUS_CHANGED 1
08-01 15:15:30.189 D/ViewRootImpl@3c0476fMainActivity: mHardwareRenderer.initializeIfNeeded()#2 mSurface={isValid=true -1281830912}
08-01 15:15:30.229 V/InputMethodManager(29249): Starting input: tba=android.view.inputmethod.EditorInfo@cf0b2ac nm : my.package.name ic=null
08-01 15:15:30.230 I/InputMethodManager(29249): [IMM] startInputInner - mService.startInputOrWindowGainedFocus
08-01 15:15:30.231 D/InputTransport(29249): Input channel constructed: fd=160
08-01 15:15:30.233 D/InputMethodManager(29249): HSI from window - flag : 0 Pid : 29249
08-01 15:15:30.252 W/IInputConnectionWrapper(29249): reportFullscreenMode on inexistent InputConnection
08-01 15:15:38.190 D/Mono (29249): [0xb7190920] worker finishing
Thread finished: #17
The thread 'Unknown' (0x11) has exited with code 0 (0x0).
08-01 15:15:41.995 D/TcpOptimizer(29249): [my.package.name] Full closed: sid=171, tcpi_state=8
08-01 15:15:49.902 D/ViewRootImpl@3c0476fMainActivity: MSG_RESIZED_REPORT: frame=Rect(0, 0 - 1080, 2220) ci=Rect(0, 72 - 0, 144) vi=Rect(0, 72 - 0, 144) or=1
08-01 15:15:49.972 D/ViewRootImpl@3c0476fMainActivity: Relayout returned: oldFrame=[0,0][1080,2220] newFrame=[0,0][1080,2220] result=0x1 surface={isValid=true -1281830912} surfaceGenerationChanged=false
08-01 15:15:51.378 D/ViewRootImpl@3c0476fMainActivity: MSG_WINDOW_FOCUS_CHANGED 0
08-01 15:15:54.111 D/ViewRootImpl@3c0476fMainActivity: MSG_WINDOW_FOCUS_CHANGED 1
08-01 15:15:54.111 D/ViewRootImpl@3c0476fMainActivity: mHardwareRenderer.initializeIfNeeded()#2 mSurface={isValid=true -1281830912}
08-01 15:16:09.240 D/Mono (29249): [0xbf27c920] worker finishing
Thread finished: #10
The thread 'Unknown' (0xa) has exited with code 0 (0x0).

Any assistance is appreciated!


Uploading an iOS App – invalid signature

$
0
0

We have tried uploading an iOS App multiple times.
A few minutes after the upload we receive the following error message via e-mail:

Invalid Signature - A sealed resource is missing or invalid.
The file at path [manage4ALL_Xamarin.iOS.app/manage4ALL_Xamarin.iOS] is not properly signed.
Make sure you have signed your application with a distribution certificate, not an ad hoc certificate or a development certificate.
Verify that the code signing settings in Xcode are correct at the target level (which override any values at the project level).
Additionally, make sure the bundle you are uploading was built using a Release target in Xcode, not a Simulator target.
If you are certain your code signing settings are correct, choose "Clean All" in Xcode, delete the "build" directory in the Finder, and rebuild your release target.
For more information, please consult https........

The Apple Support referred me to you, because we are using visual studio, a third party resource.

The situation is as follows:
I am using a Windows computer which is connected to a Mac. I am creating an Ipa with Visual Studio on the Windows computer, which is then also stored on the Mac through a link.
After creating the Ipa I start the application loader on the Mac, choose the Ipa and begin the upload. The upload is executed and at the end I get the message that the app will be checked. Shortly after that I receive the error message (as stated above).

The certificate we are using is an “iOS Distribution” and not as stated in the error message an ad hoc certificate or development certificate. I have already tried different settings in the iOS project in Visual Studio regardinig the iOS Bundle Signature.
I have tried an upload using “automatic provisioning”. But here “iPhone Developer” is selected as signature identity, which is the reason I did not expect this route to work out. The other method I tried was “manual provisioning”. I used the corresponding provisioning profile and the corresponding signature identy “iPhone Distribution”. Other settings in the properties are as follows:

iOS Build

Configuration: Release
Platform: iPhone
SDK Version: Default
Linker Behavior: Link Framework SDKs Only
Supported Architecures ARM64
HttpClient Implementation: NSUrlSession (iOS 7+)

Use the LLVM optimizing compiler: no
Use Thumb-2 instruction set for ARMv7 and ARMv7s: true
Perform all 32-bit float operations as 64-bit float: no
Strip native debugging symbols: yes
Enable incremental builds: no
Use the concurrent garbage collector (Experimental): no
Enable device-specific builds: no
Additional mtouch arguments: empty
Optimize PNG images: yes
Internationalization: none selected

iOS IPA Options

Build iTunes Package Archive (IPA): true
iTunes Metadata: empty
Package name: the same name as appstoreconnect under app information -> name
Include iTunesArtwork images and the iTunesMetadata.plist: no

In case you need any additional information, please do not hesitate to contact me. Thank you very much in advance for your help.

Best regards

App breaks after navigating to many pages.Can anyone help?

$
0
0

I have set largeheap true in manifest file and in android properties set heap to 1G

Still application breaks

This app is incompatible with all of your devices

$
0
0

Hi,
I have published my first app and it is working well on my mobile. But I can't find it from play store search as well as other people. When I open it directly from the link I can see the message: This app is incompatible with all of your devices. Probably this is why I can't find it.
Can you help me fix it?
This is my manifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http -removed ://- schemas.android.com/apk/res/android" android:versionCode="5" android:versionName="1.0" package="dillos.taxcalculator.android" android:installLocation="auto">
    <uses-sdk android:minSdkVersion="22" android:targetSdkVersion="27" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <application android:label="Kalkulator Przedsiębiorcy 2019" android:icon="@drawable/iconcalc">
        <activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:theme="@android:style/Theme.Translucent" />
    </application>
    <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-9289439137782734~6416628524" />
</manifest>

Xamarin Forms Free AOP Library

$
0
0

I am looking to implement logging functionality to my Xamarin.Forms application.

I heard about MetroLog which seem to be interesting; however, I dont like the fact that a clean method like in example below gets cluttered with code that makes this method literally "polluted". In addition, it violates KISS, 10/100, SRP, .... principles:

public void DoSomething()
{
  Logger.Log("DoSomething - start");

  try
  {
     // do something here and possible do more logging
  } 
  catch(Exception ex)
  {
     Logger.Log("DoSomething threw exception: {0}", ex.Message);
  }

  Logger.Log("DoSomething - end");
}

This pollutes the code and violates the principles I mentioned above. This method should really look like this

public void DoSomething()
{
   // do something here
}

Then I read something about AOP (Aspect Oriented Programming) in which case, all the logging calls could be moved to a separate aspect class LoggerAspect and the method above could be used like:

[LoggerAspect]
public void DoSomething()
{
   // do something here
}

Has anyone used any free Xamarin.Forms friendly AOP library? Something like PostSharp (which unfortunately is not free and not Xamarin.Forms friendly)?

Can you recommend one?

What is the proper process to design in xamarin.iOS

$
0
0

Hi guys !! :) I am new to xamarin.ios . I was given a project where could see some storyboard designs . I have came across some msdn docs but confused how to do proper designing for xamarinios .

Either to do only drag and drop . or anyother way like should i do in xcode or xml or anything else ?

If so please give me some links where i could follow the procedure . :)

T

Understanding BottomNavigationView, XML menu and drawables

$
0
0

I'm have been trying to understand how to customize the BottomNavigationView by looking at an number of forum threads.
All of them uses an xml menu file located in the resources - menu folder.
These menues in turn referres to xml drawable files, like ic_dashboard_black_24dp.xml, ic_small_dog_white_24dp.xml, ic_home_white_24dp.xml and so on.
The xml files in the othe3r samples are never displayed in any of the samples so the contents of them is unknown.
Are these drawables part of som library or alike that I have to download/install?

In the files I have seen there seem to be a path part with a android:pathData for the actual image.
How are these vector strings created?

Best Regards
Peter Karlström
Sweden

Cannot distribute/signing any apps in VS2017: The process cannot access the file...

$
0
0

Hi!
I have faced a problem during distributing my app. With this, I tried distribute a default android app(without any modification), without any success.
Steps to reproduce:
1) I click on the "Build/Archive..."
2) Starts to packaging the program-> Completed successfully.
3) Click on "Distribute..." button, then click on "Ad Hoc" mode, the choose the keystroke and click on "Save As"
4) After the destination path choosed, then the VS starts to signing the app, and I type the cert. password correctly.
5) BUUM: "Signing packages failed. The process cannot access the file 'xxxxxxx.apk.signed' because it is beign used by anouther process."

This happens right after rebooting the PC, and only the VS runs.

Any ideas, or advisement? I'm running out of ideas...


Any ideas on logging and handling exceptions

$
0
0

First off, I've been looking at a lot of available options on handling exceptions and logging. I'm looking for an application that can send a log file to the developer by mail.
I had a look into HockeyApp and log4net as they were the most widely used logging solutions.
Can you suggest if there are any other good ones out there that I havent tried yet or any help with the usage of hockeyapp or log4net.

I'd love to try an open source one as we are considering a low budget development.

I want use resource in another resource in Resource dictionary

$
0
0

How to use resouce like this.

    <OnPlatform
        x:TypeArguments="x:String"
        x:Key="SourceSansPro_Black">
        <On
            Platform="iOS"
            Value="SourceSansPro-Black" />
        <On
            Platform="Android"
            Value="SourceSansPro-Black.ttf#Source Sans Pro" />
    </OnPlatform>

UWA doesn't run

$
0
0

DEP3321: To deploy this application, your deployment target should be running Windows Universal Runtime version 10.0.15063.0 or higher. You currently are running version 10.0.10240.17443. Please update your OS, or change your deployment target to a device with the appropriate version.

Bindable Properties

$
0
0

I have this Behavior I would set a label when the regex is match, my regex works fine, the color on entry change.
But for the label i would set, I don't know how use the bindable properties.

behavior.cs

 const string labelDefault = "Email isn't correct, please modify";
 const string labelValid = "Email is correct, please connect you";

static readonly BindablePropertyKey isValidLabel = BindableProperty.CreateReadOnly("IsValidLabel", typeof(string), typeof(LoginBehavior), labelDefault);

        public static readonly BindableProperty IsValidProperty = isValidLabel.BindableProperty;

        public string IsValidLabel
        {
            get { return (string)GetValue(IsValidProperty); }
            private set { SetValue(isValidLabel, value); }
        }

void OnEntryTextChanged(object sender, TextChangedEventArgs args)
        {
            Regex regex = new Regex(emailRegex);
            bool isValid = regex.IsMatch(args.NewTextValue);
            ((Entry)sender).TextColor = isValid ? Color.Default : Color.Red;
            this.IsValidLabel = labelValid;

        }

view.xaml

<StackLayout Padding="15">
                <Image Source="dose_landauer.png"/>
                <Label Text="Login"/>
                <Entry Text="{Binding User.Username}"
                       Placeholder="Username" x:Name="entryUsernameConnection">
                    <Entry.Behaviors>
                        <behavior:LoginBehavior/>
                    </Entry.Behaviors>
                </Entry>
                <Label Text="Password"/>
                <Entry Text="{Binding User.Password}"
                       Placeholder="Password"
                       IsPassword="True" x:Name="entryPwdConnection">
                </Entry>
                <Label Text="{Binding IsValidProperty}">
                </Label>
                <Button Text="Login" Command="{Binding ClickLogin}"/>
            </StackLayout>

How to clear an image from cache?

$
0
0

I have several images of people and am giving them the ability to change the picture out by taking a new picture with their device. The images are stored on the web and the UriImageSource Uri is an internet url. Everything works perfectly until the image changes on the server, I can't figure out how to invalidate the cache and re-load the image from the server. I have tried appending a querystring on the end of the file (i.e. https://www.image.com/Image.jpg?ver=33), tried creating a new UriImageSource with caching enabled = false, but nothing seems to work...?

I have tried using regular images as well as James' ImageCircle plugin.

Error: This version of Xamarin.Mac requires the macOS 10.14 sdk

$
0
0

Hello,

I have this error when trying to compile my project on Xamarin.Mac.
I have the latest OS version and the latest XCode.

Error MM0091: This version of Xamarin.Mac requires the macOS 10.14 SDK (shipped with Xcode 10.1). Either upgrade Xcode to get the required header files or use the dynamic registrar or set the managed linker behaviour to Link Platform or Link Framework SDKs Only (to try to avoid the new APIs). (MM0091)

I had it after unifying my project to the new API.
Apparently this is required to compile my project into 64bits.
So I know that in the error it is written: "to try to avoid the new APIs", but then how do I compile my project into 64bits?

Pre-API-unifying, I have marked all my projects to compile into 64bits and lost the 32bits warning at the compilation, but the MacOS still sees it as nonfit for a 64bits OS.

Maybe I am missing something in the 64bits compilation? Why, even though I compile it to 64b, the OS does not see it?

EDIT: forget that I can remove the 32b warning. I succeeded in removing it from the old dev environment, with an old mono and an old ide and an old OS. But in this new env even though I specify 64bit in all my projects it just does not want to compile in 64 bits...

Xamarin forms android splash screen appear when navigation.pushasync and navigation.popasync

$
0
0

style.xml

<? xml version="1.0" encoding="utf-8"? >
< resources >
< style name = "MainTheme" parent="MainTheme.Base" >
< /style >
< item name = "windowNoTitle"> true < /item >
< item name="windowActionBar">false< /item>
< item name = "colorPrimary">#2196F3< /item>
< item name="colorPrimaryDark">#1976D2< /item>
< item name = "colorAccent">#FF4081< /item>
< item name="windowActionModeOverlay">true
< item name = "android:datePickerDialogTheme" > @style / AppCompatDialogStyle </ item >
</ style>
< style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog" >
< item name = "colorAccent" >#FF4081< /item>
< /style>
< style name="MyTheme.Splash" parent="Theme.AppCompat.Light.NoActionBar" >
< item name = "android:windowBackground"> @drawable / Splash_background < / item>
</ style>
</ resources>

and

mainActivity class

[Activity(Label = "xxx", Icon = "@mipmap/icon", Theme = "@style/MyTheme.Splash", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation, ScreenOrientation = ScreenOrientation.Portrait, WindowSoftInputMode = SoftInput.AdjustResize)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{

    public FirebaseAnalytics firebaseAnalytics;

    protected override void OnCreate(Bundle bundle)
    {
        TabLayoutResource = Resource.Layout.Tabbar;
        ToolbarResource = Resource.Layout.Toolbar;

        base.OnCreate(bundle);
        LoadApplication(new App());
    }

}

help me to resolve the issue


Proper way to design in xamarin.ios ????

$
0
0

Hi guys !! :) I am new to xamarin.ios . I was given a project where could see some storyboard designs . I have came across some msdn docs but confused how to do proper designing for xamarinios .

Either to do only drag and drop . or anyother way like should i do in xcode or xml or anything else ?

If so please give me some links where i could follow the procedure . :)

System.ArgumentException crash in custom UWP FrameRenderer

$
0
0

Hi,

I'm using a custom FrameRenderer in my UWP project to style frames (corner radius and color). When I scroll a bit back and forth, the app crashes with a System.ArgumentException: Value does not fall within the expected range. It's the call to base.OnElementChanged(e); that causes it.

I can of course put that in a try/catch, but then some items in my list will disappear. They return on orientation change of the device, but not after a normal refresh of the FlowListView I'm using.

Any ideas? I'm on Xamarin Forms 2.5.1.444934.

Here's the custom FrameRenderer:

class ExtendedFrameRenderer : FrameRenderer
{
    protected override void OnElementChanged(ElementChangedEventArgs<Frame> e)
    {
        base.OnElementChanged(e);

        if (Control != null)
        {
            var frame = e.NewElement;
            double cornerRadius = frame.CornerRadius;

            Windows.UI.Color frameBG = Windows.UI.Color.FromArgb(
                (byte)(frame.BackgroundColor.A * 255),
                (byte)(frame.BackgroundColor.R * 255),
                (byte)(frame.BackgroundColor.G * 255),
                (byte)(frame.BackgroundColor.B * 255));

            Control.CornerRadius = new Windows.UI.Xaml.CornerRadius(cornerRadius);
            Control.Background = new SolidColorBrush(frameBG);
            frame.BackgroundColor = Xamarin.Forms.Color.Transparent;
        }
    }
}

Full error stack:

System.ArgumentException
  HResult=0x80070057
  Message=Value does not fall within the expected range.
  Source=Windows
  StackTrace:
   at Windows.UI.Xaml.Controls.Border.put_Child(UIElement value)
   at Xamarin.Forms.Platform.UWP.FrameRenderer.PackChild()
   at Xamarin.Forms.Platform.UWP.FrameRenderer.OnElementChanged(ElementChangedEventArgs`1 e)
   at MyApp.UWP.Helpers.ExtendedFrameRenderer.OnElementChanged(ElementChangedEventArgs`1 e) in C:\Users\me\Source\Workspaces\MySol\MyApp\MyApp.UWP\Helpers\ExtendedFrameRenderer.cs:line 26
   at Xamarin.Forms.Platform.UWP.VisualElementRenderer`2.SetElement(VisualElement element)
   at Xamarin.Forms.Platform.UWP.Platform.CreateRenderer(VisualElement element)
   at Xamarin.Forms.Platform.UWP.VisualElementPackager.OnChildAdded(Object sender, ElementEventArgs e)
   at Xamarin.Forms.Platform.UWP.VisualElementPackager.Load()
   at Xamarin.Forms.Platform.UWP.VisualElementRenderer`2.SetElement(VisualElement element)
   at Xamarin.Forms.Platform.UWP.Platform.CreateRenderer(VisualElement element)
   at Xamarin.Forms.Platform.UWP.VisualElementPackager.OnChildAdded(Object sender, ElementEventArgs e)
   at Xamarin.Forms.Platform.UWP.VisualElementPackager.Load()
   at Xamarin.Forms.Platform.UWP.VisualElementRenderer`2.SetElement(VisualElement element)
   at Xamarin.Forms.Platform.UWP.Platform.CreateRenderer(VisualElement element)
   at Xamarin.Forms.Platform.UWP.ViewToRendererConverter.WrapperControl..ctor(View view)
   at Xamarin.Forms.Platform.UWP.ViewToRendererConverter.Convert(Object value, Type targetType, Object parameter, String language)

Web Service

$
0
0

Hello everyone,

I'm working on xamarin forms application, i want to understand how webservices work with xamarin.

I have one project witch represente the web service but not deployed in iis but in consol so when i check the iss express i can see my web service runing but the problem is when i want to upddate the web service and then get the updates in my project (Service References ) i got the error can't connect to the remote server, the thing that i can't understand how with localhost i can get the webservice but in local with remote desktop i can't and the webservice is in my local machine ? and how to deal with this ?

Thank you all.

Meriem

after cropping the image quality changes, why?

$
0
0

I have a cropping project in xamarin forms for ios , after getting the image the quality of the image decrease, could anyone see my code in the github link below and ell me what have done wrong? thnx.

https://github.com/SoniaCH/CroppingIOS

CS0103 The name 'Resource' does not exist

$
0
0

In new version of xamarin with vs 2015 i get this message in every time i use resource.id

Viewing all 204402 articles
Browse latest View live


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