Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

StartActivityForResult | OnActivityResult Deprecated in Xamarin Android

Along with androidX support StartActivityForResult and OnActivityResult got dprecated inside Fragment. Here we can see the one of the alternate approach for this deprecated api's in xamarin android.

Below code snippet explains the handling the above mentioned deprecated API's:

ReOrder the list items by drag and drop in xamarin android using RecyclerView

Brief:  Explanation with simple steps to how to re-order the list items by long press, drag and drop using recycler view in xamarin android.
  



Bug : Java.Lang.NullPointerException,Attempt to invoke virtual method 'boolean android.graphics.Bitmap.isMutable()' on a null object reference

I have observed this above mentioned bug keeps on hitting when using Xamarin form,UI control "Frame" for android while it executes without any issues for iOS. 

In my previous post discussed about Frame border highlight issues in android. Frame control still has one or other problem with android and still remains a question mark why Xamarin team has not given any fix for this android specific problem.

Force Landscape or Portrait for a single page in Xamarin Form.

Device screen orientation in xamarin is usually configured from Host(Android/iOS) project as suggested here . But what if i need to change the screen orientation of one particular screen(say to landscape) in xamarin form and other screens are different (may be portrait), to do so there is no direct options available from xamarin form.
We will do the configuration in host project for the common screen orientation required throughout the application, to do any changes for particular screen need to touch back to the host project settings again because as of now there is no wrapper Form level API’s available. 

For example consider the scenario that my Form project contains the Five screens out of that, for Third screen i need give support for both Portrait and Landscape and for all other remaining screen only in portrait. This can be done in android as follows,

Use the MessageCenter class to send the message from the Form screen for which orientation need to be changed and receive the same from Android MainActivity class.

ThirdPage.xamal.cs
  public partial class ThirdPage : ContentPage
    {
        protected override void OnAppearing()
        { 
            base.OnAppearing(); 
           MessagingCenter.Send(this, "allowLandScapePortrait”);
        }
         //during page close setting back to portrait
        protected override void OnDisappearing()
        {
            base.OnDisappearing(); 
            MessagingCenter.Send(this, "preventLandScape");
        }
    }

ResolveLibraryProjectImport task failed unexpectedly in release mode in xamarin

This above mentioned error i got during my xamarin form project deployment in release mode. 
In my solution i have more then one project and this error indicates that linking between these project has been broken. If you are facing the same issue, then here i have listed out few scenarios that could help you to solve this issue:


1. Select the project in which error is pointing and Check the reference of other project and package. Reference with yellow triangle icon shows the broken reference. just delete it and re-add.
For any other project reference included in the current project, delete the current project reference and add the new one from release folder of that respective project.
 Or
Open "Configuration manager"



Circular progress bar example using xamarin android

In brief: Here you can check the implementation of custom android widget called circular progress bar in steps using xamarin android.

ExpandableListView in xamarin android

Expandable List View is basically used to display the list of data with respective categories. Which has the feature to expand and collapse the items in a category when user touches category title.


Material design tab in xamarin android

Introduction: Here I'm adding one more UI component to Android Material Design introduction series i.e. Tab control using android material design library in xamarin android. 

Xamarin android material design Snackbar customization

Another beautiful component introduced with android material design is Snackbar. Which has the features similar like a Toast message in additional with interaction capability, displays at the bottom of the screen.


Navigation Drawer using material design in Xamarin.Android.

In Brief:  Here you can see the Navigation drawer implementation in Xamarin android with simple steps and reduced code using beautiful material design.




Push notification using Google Cloud Messaging(GCM) in Xamarin.Android

In Brief:
 This Post is regarding the implementation of Remote notification or Push notification using Google cloud messaging.



Custom AlertDialog example in Xamarin.Android

In Brief:
In this post i will discuss about one of the basic and most widely used component in an android development called customized alert dialog. There are several way of implementing it, here i will show custom alertDialog creation using "DialogFragment method" and "Layout inflation to AlertDialog".


Xamarin.iOS Location Autocomplete by using Google Place API

In brief: 
Making use of Google place API to provide the Location auto-complete option with text field in Xamarin iOS.


Sliding/Flyout-in menu in android xamarin using Animation and Gesture detection

In Brief: This article will help you on building sliding menu and expandable description window in android xamarin with simple steps using Animation and Touch detection. 

Draw path between two locations in google maps v2 xamarin android

In brief: Google maps android API V2 allows the developer to integrate and customize the google map look and feel. This API handles the access to Google Maps Server,fetching map data ,display and response to map gesture.
[read more : https://developers.google.com/maps/documentation/android/intro]
Here I will write the steps to draw path between two geo-location in android xamarin.