Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Android, copy source or use library?

Options
  • 06-11-2012 1:05pm
    #1
    Registered Users Posts: 14


    I recently started learning android, making buttons, using google maps, basic stuff.I saw a thread recently (cant find it) about this and it got me interested: 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. Somethign 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 organise 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?


Comments

  • Registered Users Posts: 6,464 ✭✭✭MOH


    Depending on what you're planning on doing with it, first step should really be to check licensing to see what you're allowed do with it.


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,092 Mod ✭✭✭✭Tar.Aldarion


    Hey saw my thread about this, he can do anything with it. I want something similar and am thinking of using their code and stripping it down op, I wasn't making headway using the library


  • Registered Users Posts: 1,931 ✭✭✭PrzemoF


    If it's open source, leave note in the code that your code is based on xxx copyright by yyyy and do whatever you want. Reinventing the wheel is common practice in closed source, but open source can do better.


  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    Personally I find that when using any open source code (presuming the licensing allows it) it comes down to how well its written and how much of it I need.

    Some open source libraries out there is flaky as Hell, with poor documentation and extremely buggy, and the API's associated with it require at least modification, if not complete rewriting so that they can integrate into whatever you're writing properly.

    The other factor is how much of it do you need and in this regard bundling a huge library, of which you only require a tiny part, can end up causing your application to bloat or in some cases slow down.

    In cases such as the above, I'd tend to extract whatever part of the library I need into it's own class or slimmed down package, rather than use the whole thing.

    In your case though, as you're principally learning, I might suggest that you only use the library as an example and try to write the same functionality from scratch. As it's essentially a terminal emulator, so beyond the GUI it's just something that pushes text down an open socket, and being able to code this yourself is a great learning experience, not only in socket and TCP/IP programming, but also in the various protocols that can be used with it (IRC, HTTP, FTP, etc.), so I'd further recommend tackling it from scratch, using the code only as a guide.


Advertisement