简体   繁体   English

Android,使用库还是复制源代码?

[英]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. 我最近开始学习android-使用Google地图和其他基本工具制作按钮。 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 我最近看到了一个关于此的线程(找不到),并且对此感兴趣: https : //github.com/jackpal/Android-Terminal-Emulator/wiki

This is an open source android terminal emulator. 这是一个开源的android终端模拟器。 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. 它似乎也有一个名为EmulatorView的库,人们可以使用该库调用方法等。我想做的是在自己的应用程序中使用此应用程序。 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. 我的应用程序不仅可以查看android手机等上的文件系统,还可以连接到串行设备(如路由器,USB到串行设备)的控制台。 Something I usually use minicom for on my pc. 我通常在PC上使用minicom的东西。 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/ 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? 我尝试使用他们的示例来使用他们的库(jackpal.androidterm.sample.telnet),但是当我单击open shell时,它崩溃了,我想知道他们示例中的这个open shell按钮是否是我所需要的?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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