Sceneform-android-sdk: Possible to remove support library dependency?

Created on 19 Jun 2018  路  3Comments  路  Source: google-ar/sceneform-android-sdk

I'm using the APK analyser on my app and it reports 15300 or so defined methods, 9900 or which are from android.support.

I see that ArFragment uses the support.v4 version of Fragment, but am not sure what else is required from the support library.

Is android.support genuinely needed or could it be evicted and save the best part of 10000 methods from my (rather method-count-sensitive) executable? I'm sorry to say those extra methods might prevent us from shipping a product :-(

(Unfortunately there are still some edge cases where multidex is not applicable.)

Thanks

question

All 3 comments

There are a variety of options here. I'll discuss with the team and make a recommendation.

One way this might be possible is to use ArSceneView directly and not use ux.BaseArFragment. That inherits from Fragment which is in the support library. BaseArFragment isn't strictly needed since it composes functionality added by other classes. Mainly it's using ArSceneView to display objects in AR and communicate with ArCore.

TransformationSystem and GestureDetector from the ux package are used to detect touch and manipulate objects. You can instantiate these yourself in a new class instead of using BaseArFragment. The selection visualizer issue https://github.com/google-ar/sceneform-android-sdk/issues/106 has some information about how to do that. If you have some other way for users to manipulate objects you will not need these at all.

Yes, sounds like a plan. I don't need the TransformationSystem and GestureDetector as we are just using the node click callback.

It's a shame to have to do the permission check and helper app tests manually, but I don't think that would take too long to sort out. Will give it a go, thanks.

Edit: After creating my own versions of ArFragment and BaseArFragment, it is indeed possible to remove the support-v4 and appcompat libraries from the build so all good!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tigran-babajanyan picture tigran-babajanyan  路  3Comments

kunal-wayfair picture kunal-wayfair  路  3Comments

yashvv picture yashvv  路  3Comments

chiaolinghong3d picture chiaolinghong3d  路  3Comments

LukasStancikas picture LukasStancikas  路  3Comments