Extension update possibly needed?

13 views
Skip to first unread message

rhoam.ba...@gmail.com

unread,
Apr 11, 2017, 1:56:25 PM4/11/17
to CodenameOne Discussions
Hello! I'm working to implement CN1Sensors into a project using the Codename One Extension Manager (right click project, Codename One, Codename One Settings, Extensions), but it looks like the sample code on the page is invalid:

SensorsManager accelerometer = SensorsManager.getSensorsManager(SensorsManager.TYPE_ACCELEROMETER, 100000);
I get the error "the method getSensorsManager(int, int) is undefined for the type SensorsManager". Typing "SensorsManager." and letting auto complete do its thing, the only functions available are getSenorsManager and onSensorChanged. One of the CN1Sensors source files describes getSenorsManager as "Functional alias (with a typo) for getSensorsManager(int type). Left around to avoid errors with existing code". It seems like this CN1 library has been updated by the developer, but the changes have not yet been propagated to the extension manager.

Is the latest version of CN1Sensors available for server builds like iOS and Android, or will it also need to be updated? This seems like an update request more than anything, so I feel the discussion group was a better place for the question than StackOverflow. Is this something simple that would easily make its way into the next weekly update, or is it more complex than that?

Please let me know what you think. Thank you!

Steve Hannah

unread,
Apr 11, 2017, 2:46:54 PM4/11/17
to codenameone...@googlegroups.com
Thanks. I just built and updated the lib in the CodenameOneLibs repository so it should appear soon in the extensions section of Codename One Settings.

Best regards

Steve

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/50d31cd9-740e-4ab0-8e4d-353a9b501fc7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Steve Hannah
Software Developer
Codename One

rhoam.ba...@gmail.com

unread,
Apr 11, 2017, 6:22:38 PM4/11/17
to CodenameOne Discussions
Thank you for looking into this, Steve! To verify, I created a new dummy project and went through the extension manager to install the latest version of the library. Under Referenced Libraries > lib/impl/cls > SensorsManager.class, it looks like this:


There is a comment at the top of the file that reads "Compiled from SensorsManager.java (version 1.5 : 49.0, super bit)". Maybe the old version of the library is still cached on my system and I need to purge it somehow before reinstalling the extension, because I am still unable to access the new functions. Do you have any suggestions? Thanks again!


On Tuesday, April 11, 2017 at 2:46:54 PM UTC-4, Steve Hannah wrote:
Thanks. I just built and updated the lib in the CodenameOneLibs repository so it should appear soon in the extensions section of Codename One Settings.

Best regards

Steve

On Tue, Apr 11, 2017 at 10:56 AM, <rhoam.ba...@gmail.com> wrote:
Hello! I'm working to implement CN1Sensors into a project using the Codename One Extension Manager (right click project, Codename One, Codename One Settings, Extensions), but it looks like the sample code on the page is invalid:

SensorsManager accelerometer = SensorsManager.getSensorsManager(SensorsManager.TYPE_ACCELEROMETER, 100000);
I get the error "the method getSensorsManager(int, int) is undefined for the type SensorsManager". Typing "SensorsManager." and letting auto complete do its thing, the only functions available are getSenorsManager and onSensorChanged. One of the CN1Sensors source files describes getSenorsManager as "Functional alias (with a typo) for getSensorsManager(int type). Left around to avoid errors with existing code". It seems like this CN1 library has been updated by the developer, but the changes have not yet been propagated to the extension manager.

Is the latest version of CN1Sensors available for server builds like iOS and Android, or will it also need to be updated? This seems like an update request more than anything, so I feel the discussion group was a better place for the question than StackOverflow. Is this something simple that would easily make its way into the next weekly update, or is it more complex than that?

Please let me know what you think. Thank you!



--
Reply all
Reply to author
Forward
0 new messages