Is Android SDK 6.2 the mandatory upgrade?


#1

In:
https://developer.electricimp.com/manufacturing/sdkdocs

Important Note
iOS BlinkUp™ SDK 19.8.0 is a mandatory upgrade for all iOS apps which incorporate BlinkUp. Apps which are not updated to make use of SDK 19.8.0 by April 18, 2018 will no longer be able to connect to the Electric Imp impCloud™

It does not talk about the Android SDK if it has been updated or not. Is Android SDK 6.2 the mandatory upgrade?


#2

No. The mandatory Android SDK is not yet available, but will be shortly. It will be version 6.3.0.

Apologies, but we had hoped to get this out by now, but some separate issues have emerged that required us to hold it back.


#3

@zaid, the mandatory Android SDK update (6.3.0) is now available here.


#4

Hey @smittytone. I have upgraded to the new SDK.

In all honesty, the new SDK is poorly packaged and does not represent the quality that ElectricImp provides.

Once I got the SDK to work fine on my debug environment by attempting to understand the changes I need to make from your “sample” projects, I realised once I signed it that the build will fail.

That is because I’d need to add okhttp3 and retrofit’s proguard configuration. The build passed after that and the app was published, only to notice that now blinking up crashes the app with:

java.math.BigInteger.<init> (BigInteger.java:236)
com.electricimp.blinkup.BlinkupPacket.access$000 (BlinkupPacket.java)
com.electricimp.blinkup.BlinkupPacket.access$000 (BlinkupPacket.java)
com.electricimp.blinkup.BlinkupPacket.access$000 (BlinkupPacket.java)
com.electricimp.blinkup.BaseBlinkupGLActivity.access$000 (BaseBlinkupGLActivity.java)
com.electricimp.blinkup.BaseBlinkupGLActivity.access$000 (BaseBlinkupGLActivity.java)
com.electricimp.blinkup.BaseBlinkupGLActivity$PreBlinkupTokenAcquireCallback.onError (BaseBlinkupGLActivity.java)
com.electricimp.blinkup.ImpController$1.onFailure (ImpController.java)
retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run (ExecutorCallAdapterFactory.java)
android.os.Handler.handleCallback (Handler.java:739)
android.os.Handler.dispatchMessage (Handler.java:95)
android.os.Looper.loop (Looper.java:148)
android.app.ActivityThread.main (ActivityThread.java:7325)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1230)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1120)

I had to add a new proguard configuration to keep all your classes, which is nowhere mentioned in the sample projects.

-keep class com.electricimp.** { *; }

Now, can we for new versions have the following, which I would expect from any modern company:

  • Release changes
  • How to migrate from version X to version Y.
  • A library that can be installed using Gradle, not by manually copying files.
  • A library that does not require me to add more libraries to my dependencies, and then have to configure these dependencies.
  • A list of proguard rules that have to be added.

And most importantly:

  • An easy to read documentation centre for all of the above, with user guides and API reference.

Thanks,
Zaid.


#5

Those are not unfair comments — we could have done more to pave the way for the latest version’s changes. We do include basic release notes in the Read Me included with the SDK, and update it with new information as gotchas emerge, but we can and will do more.

It’s been on my roadmap to revamp the Android documentation for some time, but other, higher-priority projects, such as adding new features — most recently dealing with Google’s Symantec certificate handling changes and related issues — has kept this on the back-burner. But we’ll look at this afresh — and at what we can do to streamline the SDK inclusion process. For which, thanks very much for your suggestions.


#6

For a full fix, add the following to your proguard-rules.pro file:

##### OkHttp
-dontwarn okhttp3.**
-dontwarn okio.**
-dontwarn javax.annotation.**
-dontwarn org.conscrypt.**
# A resource is loaded with a relative path so the package of this class must be preserved.
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase

##### Retrofit
# Platform calls Class.forName on types which do not exist on Android to determine platform.
-dontnote retrofit2.Platform
# Platform used when running on Java 8 VMs. Will not be used at runtime.
-dontwarn retrofit2.Platform$Java8
# Retain generic type information for use by reflection by converters and adapters.
-keepattributes Signature
# Retain declared checked exceptions for use by a Proxy instance.
-keepattributes Exceptions

##### BlinkUp
-keep class com.electricimp.blinkup.retrofit.Token { *; }
-keep class com.electricimp.blinkup.retrofit.TokenStatus { *; }

This will be necessary for SDK 6.3.0 only — we’ll add it into the next SDK release.