Skip to content

Instantly share code, notes, and snippets.

@secondsun
Last active August 29, 2015 14:13
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save secondsun/6f57b756bd2b3f85423c to your computer and use it in GitHub Desktop.
Save secondsun/6f57b756bd2b3f85423c to your computer and use it in GitHub Desktop.

AeroGear Android 2.0

It has been a long road since June but here it is, 2.0. If you checked out our alpha back in October things are looking better. We've fixed a few bugs, updated a few docs, made a bunch of demos, and are ready to share with the world!

New Features since 1.4

Modularization

Android has a 16-bit method limit in its dex file format. In service to this we have broken the library up into smaller modules. Now you only need pipes you won't also include the data store. Encryption won't require OAuth2, etc. Each module is now it its on github repository :

Module Repository Depends on
core https://github.com/aerogear/aerogear-android-core
pipe https://github.com/aerogear/aerogear-android-pipe core
auth https://github.com/aerogear/aerogear-android-auth pipe
security https://github.com/aerogear/aerogear-android-security core
push https://github.com/aerogear/aerogear-android-push pipe
store https://github.com/aerogear/aerogear-android-store security
authz https://github.com/aerogear/aerogear-android-authz pipe, store

AAR packaging

Since 1.4 AAR has become the official, supported library package format for Android. As such apklib has been deprecated and removed. AAR's of 1.3 and 1.4 were released prior as a preview technology and are now stable and default.

Fluent configuration

Out are the old FooConfig beans and in are fluent builders!

Pipeline pipeline = new Pipeline(SOME_URL);
PipeConfig config = new PipeConfig("myPipeName", MyModel.class);
config.setFoo(foo);
config.setBar(bar);
Pipe pipe = pipeline.pipe(config);
/* snip */
Pipe pipeInAnotherPlace = pipeline.get("name");

Now things look like this:

PipeManager.config("gp-upload", RestfulPipeConfiguration.class)
           .module(AuthorizationManager.getModule(MODULE_NAME))
           .withUrl(new URL("https://www.googleapis.com/upload/drive/v2/files?uploadType=multipart"))
           .requestBuilder(new GoogleDriveFileUploadRequestBuilder())
           .forClass(PhotoHolder.class);
/*snip*/
Pipe pipe = PipeManager.get("gp-upload");

Pluggable Configuration Providers

It is much easier to enhance the manager classes and add new configurations. Before you had to not only write a factory method but also call super classes and such nonsense to make sure you didn't accidentally break the default classes. Now you just include a static block in your configuration class and everything is gravy!

static {
  AuthenticationManager.registerConfigurationProvider(CustomConfiguration.class, new       ConfigurationProvider<CustomConfiguration>() {
    @Override
    public CustomConfiguration newConfiguration() {
      return new CustomConfiguration();
    }
  });
}

Migration of integration tests

All of our integration tests for modules are included in the modules project. Before these were a separate project (and a pain to maintain).

Android Maven Plugin 4.0

Among other things this includes a new project source layout, lots of AAR compatibility fixes, deprecation of APKLIB, and many other minor fixes and cleanups. For us it means better support for use in Android Studio projects.

API changes and cleanups

All methods marked @Deprecated in 1.4 have been removed. A few other methods which SHOULD have been deprecated have also been removed. Additionally, all former factory methods deprecated by the new builder pattern have been removed.

Dropping support for old Android versions

We're dropping support for Gingerbread, Honeycomb, and Ice Cream Sandwich. AeroGear Android is now only supporting Android 4.1+.

Android Lollipop

We support Android Lollipop. All of our builds and tests run against the Lollipop APIs and VM.

Loads of minor bug fixes

Dependency cleanup

We no longer use Guava internally. This will VASTLY reduce the number of methods in use. Since we no longer support Gingerbread, the support-v4 dependency has also been removed.

Facebook OAuth2 Support

The OAuth2 module works with Facebook.

OAuth2 configurable refresh token URL

The URL you use to fetch refresh tokens has been made configurable. Before it was the same as the access token endpoint.

EncryptedSQLStore has explicit open and close methods

EncryptedSQLStore now has methods for opening and closing a la SQLStore.

Seriously, look at our JIRA

Miscellaneous extras

Travis-CI builds

All modules are build and tested in Travis-CI with each commit. This is still ongoing as android support in Travis is quite new.

Cookbook Demos

We've ported all of our demos to Android studio and added demos for Social media uploads, KeyCloak, and Android Wear.

You can checkout the code in GitHub

AGReddit

Ever wanted a Reddit browser meant to show of AeroGear's support for paged data sources and authentication? Well here is your chance!

Chuck Norris Jokes with Wear support

Chuck Norris doesn't need his wrists to tell you jokes. He has yours. And you will thank him.

Shoot and Share

Take a picture and put it on our favorite social media sites or your own private server secured by KeyCloak.

Feature demos

Auth, Store, and OAuth demos are still there as well.

What is next?

Sync

We've started working on a sync library to work with the aerogear-sync-server. This is scheduled to be the big new feature of 2.1. You can track our progress in our JIRA.

And as a sneak peek

More OAuth2

For 2.2 we are going to enhance our authorization suppport. We will include more OAuth2 providers, better KeyCloak support, better Android account integration, and support for custom authentication and authorization through intents in addition to our current WebView approach. Again, you can follow our Jira.

Involvement

Conclusion

Version 2.0 represents a huge cleanup and leap forward for the project. We hope that you will take some time to look at it and provide feedback. As always you can reach us via:

@danbev
Copy link

danbev commented Jan 12, 2015

The link to aerogear-sync-server can no point to: https://github.com/aerogear/aerogear-sync-server, instead of my fork

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment