Keep code as a lib

ManosTzagkarakisManosTzagkarakis USMember
edited October 2014 in Visual Studio

When I am use eclipse to develop a native android application I can write an app mark it as a lib and then use it in a new project in which you can only change the resources and you have a complete new app. This way you can have a codebase of your app and then you can redistribute it to many diffeerent customers without having to use (or maintain...) the whole code again for each new project.

Can I do (and if so how) something similar with xamarin studio? I want to do this for an ios app.

Posts

  • JeffreyStedfastJeffreyStedfast Xamurai USXamarin Team Xamurai

    Yes, just create an Android Library Project.

  • ManosTzagkarakisManosTzagkarakis USMember

    As I said I want this for an iOS project. Thanks for the answer thow.

  • KMullinsKMullins Xamurai USMember, Xamarin Team Xamurai

    Hi @ManosTzagkarakis‌,

    There are several different ways that you can keep the common, backend code separate from the platform specific frontend code and yet reuse it on each platform.

    You should take a look at the following:

    • PCL Library - You can place the code in a Portable Class Library (PCL) project and consume it from in your front ends. For more information, please see the Portable Class Libraries document.
    • Shared Projects - You could create platform specific libraries and share the code inside of them. Please see the Shared Projects document.
    • Linked Files - You could place all of the common code in a single location and link to it. See the Building Cross Platform Applications document for more details.

    Hopefully the above will give you a good start.

    Please let me know if you have any questions.

    Thanks,

    Kevin

  • ManosTzagkarakisManosTzagkarakis USMember

    I will check the links. Thank you!

  • ManosTzagkarakisManosTzagkarakis USMember

    Hi, I checked my options and from what I understand there is not a direct way.

    In android (using eclipse) if a mark and already existing app as a library and then reference it to a new app I only have to change the manifest file (to show the new app to open the library app activities) and replace (not all of them, just what it necessary) the layout files or drawables or colors etc with new ones.

    What I am trying to achieve is the same thing with minimun effort (the above procedure takes less than an hour for simple changes). What would be the best approach.
    I already have the Android app (and the iOS App) and I need to change the base logos in order to serve a client.

  • KMullinsKMullins Xamurai USMember, Xamarin Team Xamurai

    Hi @ManosTzagkarakis‌,

    You can clone the project files and manually change the names of the projects and guids by editing the Solution and Project files in a text editor by hand... then it's just a matter of opening the new cloned project in Xamarin Studio and changing out the artwork as normal.

    Hope that helps,

    Kevin

Sign In or Register to comment.