Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Move Custom Layer in test app #3348

Closed
tobrun opened this issue Dec 18, 2015 · 8 comments
Closed

Move Custom Layer in test app #3348

tobrun opened this issue Dec 18, 2015 · 8 comments
Assignees
Labels
Android Mapbox Maps SDK for Android

Comments

@tobrun
Copy link
Member

tobrun commented Dec 18, 2015

Visually in the test app

Currently the custom layer option is shown in the list of feature activities, I believe that this should be moved to the Main Activity Controls instead because it is manipulating the MapView from the MainActivity. Also we need to have a different icon for this we are reusing the Polyline one.

Introduce package

All classes in the default package are Activities,
I believe we should move CustomLayer to a separate package to avoid confusion.

cc @bleege @zugaldia

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Dec 18, 2015
@tobrun tobrun added this to the android-v2.4.0 milestone Dec 18, 2015
@1ec5
Copy link
Contributor

1ec5 commented Dec 18, 2015

cc @jfirebaugh

@bleege
Copy link
Contributor

bleege commented Dec 18, 2015

Yep, moving the Custom Layer option to Main Activity Controls makes sense as it is working on that Activity.

I believe we should move CustomLayer to a separate package to avoid confusion.

Could you explain this reasoning a bit more? CustomLayer is actually in the SDK module. Are you referring to ExampleCustomLayer? If so, then yes let's move that to a subpackage called layers (just like the SDK module uses). Likely it'll be the only ever in that package, but it'll be more logically and consistently laid out.

@tobrun
Copy link
Member Author

tobrun commented Dec 18, 2015

I was indeed referring to ExampleCustomLayer

@jfirebaugh
Copy link
Contributor

Feel free to reorganize however you want.

@bleege bleege self-assigned this Dec 21, 2015
bleege added a commit that referenced this issue Dec 21, 2015
…ed Custom Layer to Main Activity Controls in Nav Drawer with new icon.
@bleege
Copy link
Contributor

bleege commented Dec 21, 2015

I've moved the ExampleCustomLayer into it's own package now as well as updated the Navigation Drawer as discussed above (see screenshot below). The only problem that I ran into though is with JNI. By changing the package name it couldn't connect the compiled C++ code to the Java code (see stacktrace below). I'm not sure how libexample-custom-layer.so was generated so I'll need to work with @jfirebaugh to learn more about this. Once the package name is changed there and the libexample-custom-layer.so is regenerated this bit of house cleaning should be done. As an aside, when we regenerate libexample-custom-layer.so we should also add an x86 ABI version too.

device-2015-12-21-095521
New Custom Layer Control In Navigation Drawer

12-21 09:55:36.298 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410] JNI DETECTED ERROR IN APPLICATION: JNI RegisterNatives called with pending exception java.lang.ClassNotFoundException: Didn't find class "com.mapbox.mapboxsdk.testapp.ExampleCustomLayer" on path: DexPathList[[zip file "/data/app/com.mapbox.mapboxsdk.testapp-1/base.apk"],nativeLibraryDirectories=[/data/app/com.mapbox.mapboxsdk.testapp-1/lib/arm, /data/app/com.mapbox.mapboxsdk.testapp-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
12-21 09:55:36.298 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56)
12-21 09:55:36.298 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:511)
12-21 09:55:36.298 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:469)
12-21 09:55:36.298 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at java.lang.String java.lang.Runtime.nativeLoad(java.lang.String, java.lang.ClassLoader, java.lang.String) (Runtime.java:-2)
12-21 09:55:36.298 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at java.lang.String java.lang.Runtime.doLoad(java.lang.String, java.lang.ClassLoader) (Runtime.java:435)
12-21 09:55:36.298 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at void java.lang.Runtime.loadLibrary(java.lang.String, java.lang.ClassLoader) (Runtime.java:370)
12-21 09:55:36.298 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at void java.lang.System.loadLibrary(java.lang.String) (System.java:1076)
12-21 09:55:36.298 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at void com.mapbox.mapboxsdk.testapp.layers.ExampleCustomLayer.<clinit>() (ExampleCustomLayer.java:5)
12-21 09:55:36.298 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at void com.mapbox.mapboxsdk.testapp.MainActivity.addCustomLayer() (MainActivity.java:590)
12-21 09:55:36.298 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at void com.mapbox.mapboxsdk.testapp.MainActivity.access$1200(com.mapbox.mapboxsdk.testapp.MainActivity) (MainActivity.java:49)
12-21 09:55:36.298 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at boolean com.mapbox.mapboxsdk.testapp.MainActivity$7.onNavigationItemSelected(android.view.MenuItem) (MainActivity.java:409)
12-21 09:55:36.298 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at boolean android.support.design.widget.NavigationView$1.onMenuItemSelected(android.support.v7.view.menu.MenuBuilder, android.view.MenuItem) (NavigationView.java:150)
12-21 09:55:36.298 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at boolean android.support.v7.view.menu.MenuBuilder.dispatchMenuItemSelected(android.support.v7.view.menu.MenuBuilder, android.view.MenuItem) (MenuBuilder.java:811)
12-21 09:55:36.298 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at boolean android.support.v7.view.menu.SubMenuBuilder.dispatchMenuItemSelected(android.support.v7.view.menu.MenuBuilder, android.view.MenuItem) (SubMenuBuilder.java:84)
12-21 09:55:36.298 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at boolean android.support.v7.view.menu.MenuItemImpl.invoke() (MenuItemImpl.java:152)
12-21 09:55:36.298 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at boolean android.support.v7.view.menu.MenuBuilder.performItemAction(android.view.MenuItem, android.support.v7.view.menu.MenuPresenter, int) (MenuBuilder.java:958)
12-21 09:55:36.298 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at void android.support.design.internal.NavigationMenuPresenter$1.onClick(android.view.View) (NavigationMenuPresenter.java:308)
12-21 09:55:36.298 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at boolean android.view.View.performClick() (View.java:5204)
12-21 09:55:36.298 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at void android.view.View$PerformClick.run() (View.java:21153)
12-21 09:55:36.298 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at void android.os.Handler.handleCallback(android.os.Message) (Handler.java:739)
12-21 09:55:36.298 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:95)
12-21 09:55:36.298 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at void android.os.Looper.loop() (Looper.java:148)
12-21 09:55:36.298 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:5417)
12-21 09:55:36.299 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2)
12-21 09:55:36.299 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:726)
12-21 09:55:36.299 7543-7543/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:616)

@jfirebaugh
Copy link
Contributor

You'll have to change this line.

@bleege
Copy link
Contributor

bleege commented Dec 21, 2015

That did the trick! I updated the line and ran make android to rebuild.

Thanks @jfirebaugh!

@bleege
Copy link
Contributor

bleege commented Dec 21, 2015

Merged!

@bleege bleege closed this as completed Dec 21, 2015
@bleege bleege mentioned this issue Dec 21, 2015
13 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

No branches or pull requests

5 participants