Documention for Xamarin Android SDK 13

fbs419 46 Reputation points
2022-10-18T16:14:13.49+00:00

There have been changes for API 33. For example: Geocoder.GetFromLocation, Intent.GetParcelableExtra, etc. There is no documentation or samples as to how to get rid of the compiler warnings. At least having an SDK 13 doc would help. Google is making me go to API 33, but there are all these Xamarin warnings, and little documentation. Thanks

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,297 questions
0 comments No comments
{count} votes

Accepted answer
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 36,231 Reputation points Microsoft Vendor
    2022-10-19T08:39:56.987+00:00

    Hello,

    There have been changes for API 33. For example: Geocoder.GetFromLocation, Intent.GetParcelableExtra, etc. There is no documentation or samples as to how to get rid of the compiler warnings.

    For Android native APIs, you'll need to check the API changes in the official Google documentation site: Documentation for app developers.

    In fact, you don't have to search for it in the documentation site. Using Geocoder.GetFromLocation as an example, when you hover over this method, VS will indicate that the method is deprecated and will give you the following link to the native API:

    [Java documentation for android.location.Geocoder.getFromLocation(double, double, int).](https://developer.android.com/reference/android/location/Geocoder#getFromLocation(double,%20double,%20int\)).

    When you click this link, you can see the following prompt to use the new API:

    This method was deprecated in API level 33.
    Use getFromLocation(double, double, int, android.location.Geocoder.GeocodeListener) instead to avoid blocking a thread waiting for results.

    Best Regards,

    Alec Liu.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1 additional answer

Sort by: Most helpful
  1. Graham McKechnie 321 Reputation points
    2022-12-08T07:33:45.5+00:00

    @fbs419
    I share your frustration - re modern sample Xamarin.Android code. I also think that the MS staff here should and could do a lot better in answering questions such as yours as in this answer they do seem to indicate that they have lost interest in assisting developers still coming to grips with Android 13, 12 etc.

    While the answer is technically correct in that Xamarin.Android and Xamarin.iOS is virtually done and dusted as of Android 13 for Android and whatever the number is for iOS, he could have put it differently (or more helpfully) rather than just referring you to a Support Policy, but behind the scenes, they are probably instructed to reply as they do.

    If you read their support policy you will find that both Android and iOS will still be supported but under the Net 6 and now the Net 7 banner.

    Over the last few days, I've been migrating a couple of test apps to net7.0-android. I don't do iOS so I can't comment on that but I'm assuming it would be similar. It is not so bad, you just have to get used to the new project structure.

    I don't know how helpful it would be to you as I can't answer your particular question re GetFromLocation - (never had the requirement to use it) but I do have a number of test app projects on GitHub and I've documented how I went about converting one of those test apps to net7.0-android and intend to convert them all over the next couple of weeks. One is done and documented, and the second one is done, but still to be documented.

    They are more like a series of tutorials about using Android's NavigationComponent e.g. Single Activity/multiple fragments - Google's recommendation for modern application development, they are all targeting Android 13, so at least you will come across the changes that were required for Android 13.

    They start off with a simple introduction to the NavigationComponent and as the project number goes up they become more complex. They start with styles based on appcompat then move to material2 and then on to material3. If you start with NavigationGraph2 you can download it and then follow my docs in the included docx file and produce your own NavigationGraph2Net7 app.

    Both my real apps are already targeting Android 13, (they are both based on Navigation Component) so rather than attempt to convert them, I thought I'd ease my way into Net7 by using these test apps, the plan being that it should make the conversion easier when I come to do it.

    You can find them at https://github.com/gmck.

    0 comments No comments