Localization for Android Library application - android

I am developing the library application, which is reused in many android applications. Now, I need to add the localization capability to my android library application.
http://developer.android.com/guide/topics/resources/localization.html
In the above link, localization deals with the resources. If I am using the resources in the library project tends to have the same resources in the referenced android application also. Is there any other way to achieve the localization in android library project.?

Yes you can add localization into your library project like a Standart Android project:
values-en,values-ru,values-uk and etc.

Yes you just need to provide alternative sources as mentioned in Providing alternative resources
So say for string file you can provider string files for different languages and device will choose which file to use according to device configuration.

Related

Can bacnet4j work in android

I want to make a BACnet client in an android tablet.
Is it possible to use BACnet4J in Android? If yes, is there a different jar file for Android?
Yes, you can use the same Jar file. I am using Backnet4j 3.2.2 for my application. It is good library.

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!

Common library for monodroid and desktop applications

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.

Same project but customised and installable alongside each other?

I have a small Android project that I use as a core project. From this core project I want to be able to do customisations.
So I have the app in a framework format using standard icons, buttons etc... I want to be able to create different versions with different icons and buttons.
This I know how to do. (I will have two separate apk files, both with the same code but with different resources)
However I want to be able to install the core project and a customisation on the same device at the same time. Currently one will overwrite the other.
I have tried to change the package in the manifest but this in turn means I would have to also change all the imports for R.java in my Java files, this is something I want to avoid.
Is it possible to change just something in xml that will allow me to have two projects using the same Java files but with different resources?
You should use Android Libraries.
Put all your application code into one Android Library and then create two Android Applications which have custom icons and different package names. The resources defined in final Android Applications will override all already existing resources in Android Library.
One drawback: you'll need to have to almost identical copies of AndroidManifest.xml files in your Android Application (but they still should have different package names).
For more info:
Android's documentation: Settings up Android Library project
My post: Android Application, Android Libraries and Jar Libraries. This one describes how Android Libraries work.
You should create a library project that contains all of your source code, and create a project for each of your installable packages that references the library project. You can then define/override any resource definitions in the installable projects

Third Party Custom Components

As I am new to Android development, I did find the section for custom components. What I am interested in is to create custom components and make them available to other developers. Is there an article or information that covers the creation & deployment of third party components for Android?
Example:
Company "A" wants to use a custom component that I wrote. How do I go about getting it to them and that they can easily use it in there application development?
Thanks in advance!
Craig
Android applications are not that much different from java programs. In order to create your own library you can just create a jar out of it distribute this jar. To use it, one would have to include this jar in its code.
Using Eclipse, you can use the export function to create the jar. It's even possible to create jars out of Android projects, but in this case you would have to be careful not to include conflicting files (like AndroidManifest.xml) when creating the jar, or else your library would be useless for the end user.

Categories

Resources