google announced Android Jetpack ( https://developer.android.com/jetpack/ ) in io 18 conference along with release of Android P they also released a new Sdk Versioning system from android sdk 28 ( android P ) will be equivalent to android 1.0 , basically the versioning is called androidx which is an improved android versioning system and more simpler as well. . Also the contraintLayout 2.0 has been released by android, which makes animations a lot more powerful and easy. android studio also has new navigation designer ( more like ios storyboards ). Also the app bundler is also released in android studio for lesser size of the app packages. All these improvements bring major boost to native android developers, this has major impacts on following :
When and how will Xamarin.Android incorporate these improvements ?
Android Jetpack is a collection of AndroidX artifacts which define best practices and guidance for how one should build an Android app.
AndroidX artifacts will require a target of Android P (API 28) in order to use them.
You should expect Jetpack items for general stable availability by Google around the release of Android P which at the current time is only in Developer Preview 2. You should expect Android P to be officially released in Q3.
We should have a Xamarin.Android preview of Android P bindings sometime after Developer Preview 3(final apis) which drops in early June.
Once we have a preview, we can then finalize the AndroidX preview bindings which we will then publish on NuGet with the new naming and version schemes. The following repository is where the support libraries and architecture components bindings currently reside(to be renamed and reversioned):
https://github.com/xamarin/AndroidSupportComponents
We will also support Android App Bundle which will need to be integrated in our MSBuild and IDE integration, which require us to support bundletool.
As for designer related items, we will have an updated binding to constraint layout and navigation architecture given the new AndroidX naming, however support for constraint layout and navigation controller in the designer is out of the scope of this repository. I invite you to post this feedback on Developer Community. Please see https://github.com/xamarin/xamarin-android/wiki/Submitting-Bugs,-Feature-Requests,-and-Pull-Requests#where-to-file-an-issue for more information on where to file an issue.
TL;DR: We are working on all of these items to align with the general release of Android P in Q3.
so do u mean in order to use jetpack the android project minimum version target should be android P?
@touseefbsb To use Jetpack you will need a compileSdkVersion(Target Framework) and targetSdkVersion targeting Android P (API 28). For us to create the Jetpack(AndroidX bindings), we also need to do the same.
actually wht I wanted to ask there, are 2 versions to target,
so basically what u mean is the max version ( target version ) has to be android P, but the minimum version lets say can be an older version as well? or is it the other way around? i.e : if I create an app with jetpack that app will only run on android P and above?
btw I created a uservoice feedback for navigation controller and a few other IDE features here.
https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/34313542-xamarin-android-support-for-contraint-layout-2-0-a
Just in case anybody is interested in tracking that uservoice or maybe voting it if they want it too.
@touseefbsb I highly recommend reading the following to understand these 3 versions:
In short, you just need to target against Android P, and you can set your minSdkVersion to whatever older version you need compatibility for(See Understanding API Levels for more information). If you create an app with jetpack, you can run on devices from the compileSdkVersion/targetSdkVersion to your minSdkVersion. As mentioned by the article, the relationship tends to be:
minSdkVersion (lowest possible) <= targetSdkVersion == compileSdkVersion (latest SDK)
EX:
compileSdkVersion = 28
targetSdkVersion = 28
minSdkVersion = 14
You would support devices from API 28 -> 14 .
For the first version of AndroidX (1.0.0), it will require API 28 to be targeted against.
@JonDouglas thanks for the nice explaination and I also had a look at the blog post u provided and that clarifies it. just a small question though, how does android X versioning system comply with the older system, keeping up with the example of api ( 28 ->14 ) would android x (1.0) for that app will mean 14, or 28 ? the old system certainly seem to have a range between a min and max value, but androidX only has 1.0 currently, so how would that work? also will androidx versioning system be default ( when you finish implementing it in xamarin.android ) in new projects in visual studio, or will we need to edit some files to refactor it to androidx and jetpack stuff?
@touseefbsb Watch this video for a better explanation:
https://www.youtube.com/watch?v=jdKUm8tGogw
It talks about the why, how, and migration tools of AndroidX.
AndroidX 1.0.0 is synonymous with Support Libraries / Architecture Components v28. It's just a reset versioning.
Some of the new components, such as Navigation, need additional work than just API bindings. On Java side they need resource parsing and code generation. We have to do the same.
API wise, we already offer ConstraintLayout binding as https://www.nuget.org/packages/Xamarin.Android.Support.Constraint.Layout/
@atsushieno yes I understand this time a bulk of features have been released for android development, I may not even have listed all of them above, but this requires work even outside the API bindings.
As long as this particular issue tries to cover EVERYTHING, we should only mark as ehnancement, low priority. There are things like room AAC that requires tons of "porting" work and makes less sense without having Android data-binding equivalent that also requires tons of "porting" work, which make it quite unrealistic (needs one or multi years of work). Limiting the scope of the task would make this issue viable.
so to summarize : these feature may take more than 1 year to actually happen in xamarin.android ?
For sure, for example data-binding has been there for years which had never been imported in our land.
Currently I am having a look at navigation component. We likely need aapt2 support for that (otherwise "res/navigation" results in aapt error: "invalid resource directory name: /home/atsushi/Desktop/androidx-navigation/NavigationSample/obj/Debug/res/ navigation ").
There is a PR to add support for aapt2 at https://github.com/xamarin/xamarin-android/pull/1573 .
https://github.com/xamarin/xamarin-android/issues/1737 prevents P API support. Support libraries need to be updated to v28 family or to migrate to androidx package, and they will require P API:
/home/atsushi/Desktop/androidx-navigation/NavigationSample/obj/Debug/lp/14/jl/res/values/values.xml(0,0): Error APT0000: resource attr/colorError (aka name.atsushieno.NavigationSample:attr/colorError) not found. (APT0000) (NavigationSample)
So will any of the Jetpack components be supported by Xamarin Android in the near future? I am particularly interested in WorkManager.
@1Cor125 Yes, we are currently working on our AndroidX support which includes JetPack components.
This work is being done in the following repository for most packages:
https://github.com/xamarin/AndroidSupportComponents/tree/AndroidX
WorkManager is still in Beta as of today: https://developer.android.com/jetpack/docs/release-notes#december_19_2018
Once we are a bit closer to a preview release of AndroidX, we will announce it's availability via a blog article. We're still working hard on these items!
Thanks!
//cc @Redth
Thanks @JonDouglas. Glad to hear it!
Hi @JonDouglas, will these be made available thru NuGet? thanks!
If you have a preview version, we'd love to test this. This is currently blocking our PSPDFKit 5 for Android wrappers, as we moved to AndroidX and Java 8, and our customers are quite impatient to get the new bits. If you need a beta tester ping peter at pspdfkit.com - Thanks!
https://pspdfkit.com/blog/2018/pspdfkit-android-5/#android-9-support
Hi @JonDouglas. Any news regarding the support of AppBundles ? It could be of a great use for us.
@johnthiriet Thanks for reaching out. Could you file a new issue in this repo for proper tracking of this item since this issue pertains to JetPack? We have it on our internal backlog, but it would be beneficial to have an individual issue so users can provide 馃憤 or 馃憥 to the support! Otherwise you can use Visual Studio's Suggest a Feature option to make this more public:
https://docs.microsoft.com/en-us/visualstudio/ide/suggest-a-feature?view=vs-2017
@JonDouglas It have just created a new issue as requested : https://github.com/xamarin/xamarin-android/issues/2727.
Thanks !
As we now support AndroidX packages & provide migration tools for users to build projects with Jetpack, I can closing this issue:
https://devblogs.microsoft.com/xamarin/androidx-nuget-packages-are-stable/
https://docs.microsoft.com/en-us/xamarin/android/platform/androidx
Most helpful comment
@touseefbsb I highly recommend reading the following to understand these 3 versions:
https://medium.com/google-developers/picking-your-compilesdkversion-minsdkversion-targetsdkversion-a098a0341ebd
In short, you just need to target against Android P, and you can set your
minSdkVersionto whatever older version you need compatibility for(See Understanding API Levels for more information). If you create an app with jetpack, you can run on devices from thecompileSdkVersion/targetSdkVersionto yourminSdkVersion. As mentioned by the article, the relationship tends to be:EX:
compileSdkVersion= 28targetSdkVersion= 28minSdkVersion= 14You would support devices from API 28 -> 14 .
For the first version of AndroidX (1.0.0), it will require API 28 to be targeted against.