{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2025,10,12]],"date-time":"2025-10-12T02:47:29Z","timestamp":1760237249592,"version":"build-2065373602"},"reference-count":64,"publisher":"MDPI AG","issue":"7","license":[{"start":{"date-parts":[[2020,3,30]],"date-time":"2020-03-30T00:00:00Z","timestamp":1585526400000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Sensors"],"abstract":"<jats:p>LEGO Mindstorms robots are widely used as educational tools to acquire skills in programming complex systems involving the interaction of sensors and actuators, and they offer a flexible and modular workbench to design and evaluate user\u2013machine interaction prototypes in the robotic area. However, there is still a lack of support to interoperability features and the need of high-level tools to program the interaction of a robot with other devices. In this paper, we introduce Legodroid, a new Java library enabling cross-programming LEGO Mindstorms robots through Android smartphones that exploits their combined computational and sensorial capabilities in a seamless way. The library provides a number of type-driven coding patterns for interacting with sensors and motors. In this way, the robustness of the software managing robot\u2019s sensors dramatically improves.<\/jats:p>","DOI":"10.3390\/s20071926","type":"journal-article","created":{"date-parts":[[2020,4,1]],"date-time":"2020-04-01T03:44:13Z","timestamp":1585712653000},"page":"1926","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":5,"title":["Legodroid: A Type-Driven Library for Android and LEGO Mindstorms Interoperability"],"prefix":"10.3390","volume":"20","author":[{"given":"Alvise","family":"Span\u00f2","sequence":"first","affiliation":[{"name":"Dipartimento di Scienze Ambientali, Informatica e Statistica, Universit\u00e0 Ca\u2019 Foscari Venezia, via Torino 155, 30170 Mestre-Venezia, Italy"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-0946-5440","authenticated-orcid":false,"given":"Agostino","family":"Cortesi","sequence":"additional","affiliation":[{"name":"Dipartimento di Scienze Ambientali, Informatica e Statistica, Universit\u00e0 Ca\u2019 Foscari Venezia, via Torino 155, 30170 Mestre-Venezia, Italy"}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"1968","published-online":{"date-parts":[[2020,3,30]]},"reference":[{"key":"ref_1","doi-asserted-by":"crossref","unstructured":"Span\u00f2, A., Cortesi, A., and Zausa, G. (2019, January 19\u201321). Type-Driven Cross-Programming for Android and LEGO Mindstorms Interoperability. Proceedings of the IFIP International Conference on Computer Information Systems and Industrial Management, Belgrade, Serbia.","DOI":"10.1007\/978-3-030-28957-7_17"},{"key":"ref_2","unstructured":"(2020, February 28). Legodroid. Available online: https:\/\/github.com\/alvisespano\/Legodroid\/tree\/sensors."},{"key":"ref_3","unstructured":"(2020, February 28). Android Studio. Available online: https:\/\/developer.android.com\/studio."},{"key":"ref_4","unstructured":"(2020, February 28). OpenCV for Android. Available online: https:\/\/opencv.org\/android."},{"key":"ref_5","unstructured":"(2020, February 28). Type Driven Development. Available online: https:\/\/blog.ploeh.dk\/2015\/08\/10\/type-driven-development\/."},{"key":"ref_6","unstructured":"(2020, February 28). ROBOLAB Reference Guide. Available online: http:\/\/www.legoengineering.com\/robolab-programming-references."},{"key":"ref_7","doi-asserted-by":"crossref","first-page":"60","DOI":"10.1145\/1592761.1592779","article-title":"Scratch: Programming for all","volume":"52","author":"Resnick","year":"2009","journal-title":"Commun. ACM"},{"key":"ref_8","unstructured":"(2020, February 28). leJOS Documentation. Available online: http:\/\/www.lejos.org."},{"key":"ref_9","unstructured":"(2020, February 28). LEGO Mindstorms NXT Education Kit. Available online: https:\/\/www.generationrobots.com\/media\/Lego-Mindstorms-NXT-Education-Kit.pdf."},{"key":"ref_10","unstructured":"(2020, February 28). EV3 Communication Developer Kit. Available online: https:\/\/le-www-live-s.legocdn.com\/sc\/media\/files\/ev3-developer-kit\/lego%20mindstorms%20ev3%20communication%20developer%20kit-f691e7ad1e0c28a4cfb0835993d76ae3.pdf."},{"key":"ref_11","unstructured":"(2020, February 28). EV3 Firmware Developer Kit. Available online: https:\/\/le-www-live-s.legocdn.com\/sc\/media\/files\/ev3-developer-kit\/lego%20mindstorms%20ev3%20firmware%20developer%20kit-7be073548547d99f7df59ddfd57c0088.pdf."},{"key":"ref_12","unstructured":"(2020, February 28). LEGO Mindstorms NXT Kit Download. Available online: https:\/\/www.lego.com\/en-us\/service\/help\/products\/themes-sets\/lego-education\/lego-mindstorms-nxt-software-downloads-408100000007850."},{"key":"ref_13","unstructured":"(2020, February 28). leJOS PC API. Available online: https:\/\/lejos.sourceforge.io\/nxt\/pc\/api\/index.html."},{"key":"ref_14","unstructured":"(2020, February 28). leJOS Documentation: Examples. Available online: http:\/\/www.lejos.org\/nxt\/nxj\/tutorial\/Android\/Android.htm."},{"key":"ref_15","unstructured":"G\u00f6bel, S., Jubeh, R., Raesch, S.L., and Z\u00fcndorf, A. (2020, February 28). Using the Android platform to control robots. Available online: https:\/\/www.researchgate.net\/profile\/Albert_Zuendorf\/publication\/267985764_Using_the_Android_Platform_to_control_Robots\/links\/54b952e70cf253b50e2989cc\/Using-the-Android-Platform-to-control-Robots.pdf."},{"key":"ref_16","doi-asserted-by":"crossref","unstructured":"Manousaridis, K., Mavridis, A., Kalogiannis, G., and Anagnostopoulos, K. (2015, January 19\u201320). Introducing an innovative robot-based mobile platform for programming learning. Proceedings of the 2015 International Conference on Interactive Mobile Communication Technologies and Learning (IMCL), Thessaloniki, Greece.","DOI":"10.1109\/IMCTL.2015.7359549"},{"key":"ref_17","doi-asserted-by":"crossref","unstructured":"N\u00e1dvorn\u00edk, J., and Smutn\u1ef3, P. (2014, January 28\u201330). Remote control robot using Android mobile device. Proceedings of the 2014 15th International Carpathian Control Conference (ICCC), Velke Karlovice, Czech Republic.","DOI":"10.1109\/CarpathianCC.2014.6843630"},{"key":"ref_18","unstructured":"Barnes, D.J. (March, January 27). Teaching Introductory Java through LEGO MINDSTORMS Models. Proceedings of the 33rd SIGCSE Technical Symposium on Computer Science Education, Cincinnati, KY, USA."},{"key":"ref_19","doi-asserted-by":"crossref","first-page":"12","DOI":"10.1109\/MRA.2003.1213611","article-title":"Lego MindStorms: Not just for K-12 anymore","volume":"10","author":"Klassner","year":"2003","journal-title":"IEEE Rob. Autom Mag."},{"key":"ref_20","doi-asserted-by":"crossref","first-page":"206","DOI":"10.1109\/TE.2002.808260","article-title":"The qualitative impact of using LEGO MINDSTORMS robots to teach computer engineering","volume":"46","author":"Williams","year":"2003","journal-title":"IEEE Trans. Educ."},{"key":"ref_21","unstructured":"Lund, H.H., and Pagliarini, L. (2000, January 24\u201328). Robocup jr. with lego mindstorms. Proceedings of the 2000 ICRA, Millennium Conference, IEEE International Conference on Robotics and Automation, Symposia Proceedings (Cat. No. 00CH37065), San Francisco, CA, USA."},{"key":"ref_22","unstructured":"Klassner, F. (March, January 27). A Case Study of LEGO Mindstorms\u2019TM Suitability for Artificial Intelligence and Robotics Courses at the College Level. Proceedings of the 33rd SIGCSE Technical Symposium on Computer Science Education, Cincinnati, KY, USA."},{"key":"ref_23","doi-asserted-by":"crossref","first-page":"99","DOI":"10.1109\/TE.2008.919809","article-title":"Introduction for freshmen to embedded systems using LEGO Mindstorms","volume":"52","author":"Kim","year":"2008","journal-title":"IEEE Trans. Educ."},{"key":"ref_24","doi-asserted-by":"crossref","unstructured":"McWhorter, W.I., and O\u2019Connor, B.C. Do LEGO\u00ae Mindstorms\u00ae motivate students in CS1? In Proceedings of the 40th ACM technical symposium on Computer science education, Chattanooga, TN, USA, 4\u20137 March 2009.","DOI":"10.1145\/1508865.1509019"},{"key":"ref_25","unstructured":"(2020, February 28). Designing with Types. Available online: https:\/\/fsharpforfunandprofit.com\/series\/designing-with-types.html."},{"key":"ref_26","first-page":"207","article-title":"Principal Type-Schemes for Functional Programs","volume":"82","author":"Damas","year":"1982","journal-title":"POPL"},{"key":"ref_27","unstructured":"(2020, February 28). Types: Properties of Software Development. Available online: https:\/\/blog.ploeh.dk\/2016\/02\/10\/types-properties-software\/."},{"key":"ref_28","doi-asserted-by":"crossref","unstructured":"Xi, H., and Pfenning, F. (1999, January 20\u201322). Dependent types in practical programming. Proceedings of the 26th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, San Antonio, TX, USA.","DOI":"10.1145\/292540.292560"},{"key":"ref_29","doi-asserted-by":"crossref","unstructured":"Brady, E. (2013, January 25\u201327). Programming and reasoning with algebraic effects and dependent types. Proceedings of the 18th ACM SIGPLAN international conference on Functional programming, Boston, MA, USA.","DOI":"10.1145\/2500365.2500581"},{"key":"ref_30","doi-asserted-by":"crossref","unstructured":"Gibbons, J. (2006, January 16). Design patterns as higher-order datatype-generic programs. Proceedings of the 2006 ACM SIGPLAN workshop on Generic programming, Portland, OR, USA.","DOI":"10.1145\/1159861.1159863"},{"key":"ref_31","unstructured":"(2020, February 28). Lambdas Are Not Functional Programming. Available online: https:\/\/medium.com\/@johnmcclean\/lambdas-are-not-functional-programming-63533ce2eb74."},{"key":"ref_32","unstructured":"Chalin, P., and James, P.R. (August, January 30). Non-null references by default in Java: Alleviating the nullity annotation burden. Proceedings of the European Conference on Object-Oriented Programming, Berlin, Germany."},{"key":"ref_33","doi-asserted-by":"crossref","first-page":"515","DOI":"10.1049\/iet-sen:20080010","article-title":"Reducing the use of nullable types through non-null by default and monotonic non-null","volume":"2","author":"Chalin","year":"2008","journal-title":"IET Softw."},{"key":"ref_34","unstructured":"(2020, February 28). Designing with Types: Making Illegal States Unrepresentable. Available online: https:\/\/fsharpforfunandprofit.com\/posts\/designing-with-types-making-illegal-states-unrepresentable."},{"key":"ref_35","doi-asserted-by":"crossref","unstructured":"Haack, C., and Poll, E. (2009, January 6\u201310). Type-based object immutability with flexible initialization. Proceedings of the European Conference on Object-Oriented Programming, Genova, Italy.","DOI":"10.1007\/978-3-642-03013-0_24"},{"key":"ref_36","unstructured":"Bloch, J. (2016). Effective Java, Pearson Education."},{"key":"ref_37","unstructured":"Gaster, B.R., and Jones, M.P. (2020, February 28). A Polymorphic Type System for Extensible Records and Variants. Available online: http:\/\/www.cs.cmu.edu\/aldrich\/courses\/819\/papers\/row-poly.pdf."},{"key":"ref_38","doi-asserted-by":"crossref","first-page":"183","DOI":"10.1145\/286942.286957","article-title":"Making the future safe for the past: Adding genericity to the Java programming language","volume":"33","author":"Bracha","year":"1998","journal-title":"Acm Sigplan Not."},{"key":"ref_39","doi-asserted-by":"crossref","unstructured":"Zibin, Y., Potanin, A., Ali, M., Artzi, S., Kie|un, A., and Ernst, M.D. (2007, January 3\u20137). Object and reference immutability using Java generics. Proceedings of the the 6th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on The Foundations of Software Engineering, Dubrovnik, Croatia.","DOI":"10.1145\/1287624.1287637"},{"key":"ref_40","doi-asserted-by":"crossref","unstructured":"Ellis, B., Stylos, J., and Myers, B. (2007, January 20\u201326). The factory pattern in API design: A usability evaluation. Proceedings of the 29th International Conference on Software Engineering, Minneapolis, MN, USA.","DOI":"10.1109\/ICSE.2007.85"},{"key":"ref_41","unstructured":"(2020, February 28). JDK 8 Documentation: Package java.util.function. Available online: https:\/\/docs.oracle.com\/javase\/8\/docs\/api\/java\/util\/function\/packagesummary.html."},{"key":"ref_42","doi-asserted-by":"crossref","unstructured":"Allen, E., Bannet, J., and Cartwright, R. (2003, January 26\u201330). A First-Class Approach to Genericity. Proceedings of the 18th Annual ACM SIGPLAN Conference on Object-Oriented Programing, Systems, Languages, and Applications, Anaheim, CA, USA.","DOI":"10.1145\/949305.949316"},{"key":"ref_43","unstructured":"(2020, February 28). JDK 8 Documentation: Type Inference. Available online: https:\/\/docs.oracle.com\/javase\/specs\/jls\/se8\/html\/jls-18.html."},{"key":"ref_44","doi-asserted-by":"crossref","unstructured":"Welc, A., Jagannathan, S., and Hosking, A. (2005, January 16\u201320). Safe Futures for Java. Proceedings of the 20th Annual ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications, San Diego, CA, USA.","DOI":"10.1145\/1094811.1094845"},{"key":"ref_45","unstructured":"Haller, P., Prokopec, A., Miller, H., Klang, V., Kuhn, R., and Jovanovic, V. (2020, February 28). Futures and Promises. Available online: http:\/\/docs.scala-lang.org\/overviews\/core\/futures.html."},{"key":"ref_46","unstructured":"(2020, February 28). Android FutureTask Class Documentation. Available online: https:\/\/developer.android.com\/reference\/java\/util\/concurrent\/FutureTask."},{"key":"ref_47","unstructured":"(2020, February 28). Android Executor Interface Documentation. Available online: https:\/\/developer.android.com\/reference\/java\/util\/concurrent\/Executor."},{"key":"ref_48","doi-asserted-by":"crossref","unstructured":"Mycroft, A. (1984, January 17\u201319). Polymorphic type schemes and recursive definitions. Proceedings of the International Symposium on Programming, Toulouse, France.","DOI":"10.1007\/3-540-12925-1_41"},{"key":"ref_49","unstructured":"Subramaniam, V. (2020, February 28). Functional Programming in Java: Harnessing the Power of Java 8 Lambda Expressions. Available online: https:\/\/www.amazon.com\/Java-Lambdas-Pragmatic-Functional-Programming-ebook\/dp\/B00J3B3J3C."},{"key":"ref_50","unstructured":"Warburton, R. (2014). Java 8 Lambdas: Pragmatic Functional Programming, O\u2019Reilly Media, Inc."},{"key":"ref_51","doi-asserted-by":"crossref","unstructured":"Nguyen, D., and Wong, S.B. (2000, January 7\u201312). Design patterns for lazy evaluation. Proceedings of the 31st SIGCSE Technical Symposium on Computer Science Education, Austin, TX, USA.","DOI":"10.1145\/330908.331803"},{"key":"ref_52","first-page":"1","article-title":"The dalvik virtual machine architecture","volume":"4","author":"Ehringer","year":"2010","journal-title":"Tech. Rep."},{"key":"ref_53","unstructured":"Zhang, L., Krintz, C., and Soman, S. (2006, January 13). Efficient support of fine-grained futures in Java. Proceedings of the International Conference on Parallel and Distributed Computing Systems (PDCS), San Francisco, CA, USA."},{"key":"ref_54","doi-asserted-by":"crossref","unstructured":"Zhang, L., Krintz, C., and Nagpurkar, P. (2007, January 15\u201319). Language and Virtual Machine Support for Efficient Fine-Grained Futures in Java. Proceedings of the 16th International Conference on Parallel Architecture and Compilation Techniques, Brasov, Romania.","DOI":"10.1109\/PACT.2007.4336206"},{"key":"ref_55","unstructured":"(2020, February 28). Method References (Java Documentation). Available online: https:\/\/docs.oracle.com\/javase\/tutorial\/java\/javaOO\/methodreferences.html."},{"key":"ref_56","unstructured":"Ford, A., and Roberts, A. (1998). Colour Space Conversions, Westminster University."},{"key":"ref_57","unstructured":"Foley, J.D., Van, F.D., Van Dam, A., Feiner, S.K., Hughes, J.F., Angel, E., and Hughes, J. (1996). Computer Graphics: Principles and Practice, Addison-Wesley Professional."},{"key":"ref_58","unstructured":"(2020, February 28). Internal Commission on Illumination (CIE). Available online: http:\/\/cie.co.at."},{"key":"ref_59","unstructured":"Granger, E.M. Is CIE L* a* b* good enough for desktop publishing? In Proceedings of the Device-Independent Color Imaging, International Society for Optics and Photonics, San Jose, CA, USA, 15 April 1994."},{"key":"ref_60","doi-asserted-by":"crossref","first-page":"1099","DOI":"10.5594\/J01651","article-title":"SMPTE Tutorial: \u201cGamma\u201d and its Disguises: The Nonlinear Mappings of Intensity in Perception, CRTs, Film, and Video","volume":"102","author":"Poynton","year":"1993","journal-title":"SMPTE J."},{"key":"ref_61","unstructured":"(2020, February 28). Color Metrics. Available online: https:\/\/www.compuphase.com\/cmetric.htm."},{"key":"ref_62","doi-asserted-by":"crossref","first-page":"289","DOI":"10.1007\/s10798-007-9043-3","article-title":"Robotics projects and learning concepts in science, technology and problem solving","volume":"19","author":"Barak","year":"2009","journal-title":"Int. J. Technol. Des. Educ."},{"key":"ref_63","doi-asserted-by":"crossref","first-page":"9818","DOI":"10.3182\/20110828-6-IT-1002.02364","article-title":"Using of lego mindstorms nxt technology for teaching of basics of adaptive control theory","volume":"44","author":"Bobtsov","year":"2011","journal-title":"IFAC Proc. Vol."},{"key":"ref_64","doi-asserted-by":"crossref","unstructured":"Konvicka, J., Kotyrba, M., Volna, E., Habiballa, H., and Bradac, V. (2018, January 25\u201327). Adaptive control of EV3 robot using mobile devices and fuzzy logic. Proceedings of the International Conference on Information Science and Applications, Hong Kong, China.","DOI":"10.1007\/978-981-13-1056-0_40"}],"container-title":["Sensors"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/1424-8220\/20\/7\/1926\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,10,11]],"date-time":"2025-10-11T09:13:34Z","timestamp":1760174014000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/1424-8220\/20\/7\/1926"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2020,3,30]]},"references-count":64,"journal-issue":{"issue":"7","published-online":{"date-parts":[[2020,4]]}},"alternative-id":["s20071926"],"URL":"https:\/\/doi.org\/10.3390\/s20071926","relation":{},"ISSN":["1424-8220"],"issn-type":[{"type":"electronic","value":"1424-8220"}],"subject":[],"published":{"date-parts":[[2020,3,30]]}}}