Common library for monodroid and desktop applications - android

I am currently starting a project which I would like to develop both a Android and desktop app for using mono for android. I would like to encapsulate the common logic into a shared library but at the moment I am unsure of how to accomidate both frameworks.
Thanks!

You must create projects using the "Android Class Library" project template because the mscorlib supported by monodroid(v2.0.5.0) is lower then the MSFX2.0 (v2.0.50727)

You'll want to create separate class library projects for each platform, and then share the source files across them. This question has a lot of links and details about how to go about doing that.

Related

Android: What is the difference between SDK and library project

For applications like facebook, they provide SDK . I have used many third party libraries for different requirements. What is the difference between both the cases . That is the code bundled as library or as sdk
A Library is a chunk of code that you can call from your own code, to help you do things more quickly/easily. For example, a Bitmap Processing library will provide facilities for loading and manipulating bitmap images, saving you having to write all that code for yourself.
An SDK (software development kit) is a library (often with extra tool applications, data files and sample code) that aid you in developing code that uses a particular system (e.g. extension code for using features of an operating system (Windows SDK), drawing 3D graphics via a particular system (DirectX SDK), writing add-ins to extend other applications (Office SDK), or writing code to make a device like an Arduino or a mobile phone do what you want)
From this thread
Android SDK -> is the core features and software tools that allow you to create an app for the Android Platform. An SDK contains lots of libraries and tools which you will use to develop your application.
A Library -> is a collection of pre-built compiled code which you can use to extend your application's features. For example, you may need to show some graphics in your application. Instead of creating this from scratch, you may choose to use a pre-built library someone else has developed which will give you the features you need thus saving you some time.
Thanks to Nithish for this explanations
SDK is software development kit which provides a platform/a way to develop software while library project is a project which have some lines of code to solve any desire problem, it may have design or code files.
Generally library project focus only one problem but SDK is complete kit/tool to develop any task, if want some functionality in your code which is not present in SDK than we will go for any library project.
SDK is so that you can build applications for FaceBook. SDK can usually only be used in a more specific context. A library is so that you can take the library and use it on your own applications. A library is meant to be portable.
You can obviously use code from anywhere to anywhere, but I think thats the main difference.

Is it possible to compile a Xamarin project as a library for iOS and Android?

I need to create an API library for Android and iOS. I have experience working with Android projects, but zero experties in iOS. I was wondering if I could create a Project library in Xamarin that compiles as a JAR for Android and as an... I-don't-know-which-type for iOS.
No, that isn't possible. Depending on what you are trying to accomplish there may be alternatives. If you are trying to make a library that can be used by others you could make it a Xamarin component - there is a component store you could put it on if you want it to be generally available, otherwise you can use any normal means of source or object distribution.
If you need to interact with a native app/library then you could make the C# code the "owner" of it and have it call into the native code. This works for both IOs and Android (and is used to work with e.g the play services from google).
No, it is unfortunately not possible to do that.
It seems to me that what you need is a Portable Class Library also known as PCL. It allows you to create a project which can be referenced by all Xamarin supported platforms (such as iOs and Android). There are obviously limitations to the approach like not being able to reference platform specific libraries but in your case (of writing an API) it should suffice.
You can read more in this link
Good Luck!

Android Library Project Equivalent in Windows Phone 8

I have 2 Android apps that are 99% the same (different branding and a little bit of logic), so I have a library project that they both reference. This library project contains all of the UI and logic, and any differences between the apps are provided by overriding resources and extending my "LibraryApplication" (which itself extends Application).
I'm looking to port these apps to Windows Phone 8, and I'm wondering if there is a similar construct to help me mimic this pattern.
You can use Portable Class library for logic, however UI can't be shared in library. You can use files from the first project by adding them as a link to the second project. In case of UI it will be better to link all files without library at all.

ZXing Library in Titanium

Can can tell me how to use the ZXing library in an android app in TITANIUM.I have downloaded the ZXing library from the following path : http://code.google.com/p/zxing/downloads/detail?name=ZXing-2.0.zip
Creating a custom module is the only way to do this. Therefore you have to have knowledge of the native platform.
Modules are not too difficult if you have native platform experience (or just know Java for Android). I would check the moddevguide example module which is chock full of examples of passing data back and forth, which is available in the public Titanium repository on github. Also, the paint module is a great example of subclassing to roll your own titanium component.
So first go here and follow these step-by-step instructions on how to start your own module. Documentation Link
Then check out this code for great examples of passing data throughout your app. Titanium Github
All that aside, if you dont have native platform experience, why not just use either the Titanium Plus modules barcode scanner? Or this open source alternative?
No need to reinvent the wheel at this point.

Share Java logic between Android and Blackberry projects?

Both Android and Blackberry apps are made in Java. Does it mean that I can code some logic interdependent to Android SDK and use it when porting the app to Blackberry?
Does anyone has experience in this field?
Sure you can do it. The logic would not be different but the implementation of the logic depend upon the Platform you are choosing. In Blackberry it uses java-me but there are some limitation you can not use in Blackberry like there is no ArrayList or HashMap in Blackberry but its available in Android so you have to use some alternative of ArrayList or HashMap while porting for the Blackberry you can use Vector instead of that. There is also some limitation of using java.lang.utils package in Blackberry. May be this would be helpful for you.
I'm working on an application that runs on both Android and Blackberry.
I work only on the Android client but I know that only few things can be shared. Of course only the classes that do not have to do with the framework. Another problem is that, Blackberry uses only J2ME that means that for example you can't even use semaphore or other things like that.
In my application all the protocol level is shared though.
Sure you can. Create a plain Java project and make sure you only use classes available in Android and Blackberry. Add the project dependency to your Android and Blackberry project. Alternatively, you can export a jar file and link your projects to it.

Categories

Resources