简体   繁体   中英

Android, use library or copy source code?

I hope my question is suitable here. I recently started learning android - making buttons, using google maps and other basic stuff. I saw a thread recently (can't find it) about this and I got interested in it: https://github.com/jackpal/Android-Terminal-Emulator/wiki

This is an open source android terminal emulator. It also seems to have a library called EmulatorView with which people can call methods etc. What I would like to do is use this app inside my own app. Instead of just looking at the file system on the android phone etc. my app would connect to the console of a serial device like a router, usb to serial. Something I usually use minicom for on my pc. As in there could be a button in my app and if I press it it opens the console of the attached router and I could issue administrative commands.

I was wondering what the easiest way to do this would be? Would it be to try and use this library and make my own terminal, seems quite hard, or would it be to copy their source into a project and try to edit it? Seems messy to organize everything, and could be hard too? Then use some library like this to connect to the serial device? http://slickdevlabs.com/slick-usb-2-serial-library/

What would the first steps be, make a terminal like the open source app has, use their library or paste in their code? Then try and edit it to do something over serial?

I have tried to use their example for using their library (jackpal.androidterm.sample.telnet), but it crashes when I click open shell , I was wondering if this open shell button in their example was what I needed?

我决定通过使用库自己编写该应用程序来了解更多信息。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM