I am trying to create Xamarin support for my Android SDK (So potential clients can implement it as Xamarin Android app.
I was trying to avoid using AAR because I wanted resources to be available to the client, so the client can customize the layout. In android library it is usually very easy because one can create JAR file only from the java classes and leave the res folder as is with all the resources available for editing.
I was trying to do the Same with xamarin studio: I located the jar under jars and also added .so files under lib/jni. Then I copied the res folder content to Resources.
The result was:
In the Xamarin app (that uses the dll from the binding project) I could see the Resources. But! When I am running the java classes (I use those resources in the SDK code) I get an error:
java.lang.NoClassDefFoundError: Failed resolution of: L....../R$layout.
I didn't find any documentation on using resources outside the jar...
Is there another option maybe with Android resources that are defined inside AAR, to override them outside the AAR.
Thanks in advance for any answer/reference
The only main difference between a JAR and AAR is that AARs can include resources. If a client needs to customize the resources, you have a couple of ways.
A Xamarin.Android Class Library that can be customized, recompiled, and added to a project.
An Android Class Library that can be customized then packaged into an AAR to be bound by a binding project.
Finally you could always just instruct your clients to purposely override your library's resources as the application resource will be prioritized rather than the library.
https://developer.android.com/studio/write/add-resources.html#resource_merging
Related
Does anyone know if there is a way to tell the C++Builder toolchain to automatically compile all of the associated resources (specifically form resources - DFM) into a .res when a static library is being built?
I used to use packages to "compartmentalize" my code in very large projects but recently I switched to using static libraries instead (due to persistent, long-standing issues with linking 64-bit code in packages - WRI123X and such) and one of the pain points with organizing my projects this way is, obviously, that static libraries (.lib / .a) only contain the code and not the resources. This means that, at the executable project level, I have to maintain a list of link directories for each static library that contains forms data (instead of just referencing a single directory where all my .lib/.a files are placed).
What I would like to be able to do (in my static library project) is to tell the toolchain to compile BOTH the static library AND the associated form resources into my_lib.lib/a (code) file and my_lib.res (resource) file and put BOTH files into the designated "final output directory" for the static library (instead of deferring compilation of resources until the exe project).
Does anyone know if this is possible in C++Builder (as of 10.4.1) and, if so, how to go about it?
Thanks,
Marko
I am trying to understand Dart's recommended project structure and not seeing the "forest through the trees".
So, if my project is intended to be a reusable library, say, a logging framework of some sort, then if I understand the above link correctly, I want all of my development to be under a lib and lib/src directory.
But what if I am building a web app? Where do my Dart source files go? Under packages? Specifically:
Where do I place Dart source files for a web app (not a lib)?
Are my web app's "packages" just directories that are logically organized similar to Java packages?
Does Dart recommend a 1-class-per-file convention for its source code?
1)
your_app_package/web
your_app_package/web/src/xxx
static content like jpg, css go to
* your_app_package/asset
2) the packages directory is maintained automatically. You configure in the file pubspec.yaml which 3rd party libraries you want to use and then call pub get or pub upgrade and the packages directory is updated automatically (the Darteditor does this automatically when you update pubspec.yaml).
3) not that I know of.
I had some problems putting additional classed in the code file of a Polymer element though. But I guess this is just a temporary limitation of Polymer.
I've been playing around with the Starter Edition of Xamarin Studio to determine if it will meet my needs. I understand (so I thought) the limitations of this edition; 32K compiled IL limit, no native libraries, etc. Now, I understand native libraries to be C/C++ libraries, or even native Java libraries. This does not seem to be the case.
I have a solution in Xamarin Studio with 2 projects. One is an Android Class Library, the other is an Android Application. When I reference the class library from the application project and build, I get the following error.
Your app references native libraries. This functionality requires Indie Edition or higher.
I beg to differ! Every .cs file in the referenced Android class library project is simple .NET code. What am I missing? I can successfully run the Tasky Android_Starter solution without issue, and it is made up of 2 projects like mine.
I had to delete the Resources folder and manually edit the Android class library project file in order to get this working. I looked at the Tasky sample's project file as a reference.
After deleting the auto-included Resources folder from the project, edit the .csproj file in a text editor to remove the following XML elements:
Project\ProjectGroup\AndroidResgenFile
Project\ProjectGroup\AndroidResgenClass
With those things taken care of, I no longer get the error. I'm guessing, Xamarin Studio thought I was referencing another Android application instead of a class library. Not sure why the default project template includes things to break such a flow, but perhaps I'm not "doing" right" either. Go figure.
Deleting the Resources folder and manually editing the csproj file didn't work for me. I had to create a new C# Library project instead of creating an Android Library Project and import my .cs files into that. After that it compiled and ran fine.
I have the following issue: I am writing an app that consists of a main project for the GUI and similar and two static libraries: One for authentication to a service and a second one for using a part of that service. The problem is, that I need to use parts of the auth library in the service library for instance the auth library offers an API http client that I want to use in the service library.
I managed to get it running when building the whole app with GUI an everything but I didn't manage it to get in running if the service lib should be build stand-alone (for continues integration tests etc.) My deployment target is 5.0, my SDK is 6.1.
Is there a way to do this rightâ„¢?
Thanks for any help.
Philip
EDIT: Of course I could just put the auth lib into the service lib as a sub project but if I need to use more then one service libs in a future app that would be quite messy, wouldn't it?
The fundamental issue you are missing is:
Static libraries are not linked.
They are simply an archive of object files, with Mach-O extending this concept to support multiple architectures in the same file (see lipo).
The only way multiple static libraries are linked together is in the final binary (app or dylib).
i a developing blackberry aplication using eclipse can any one tell where to find the following library
package com.rim.samples.docs.notifications;
i have downloaded it from blackberry site but i dont know how to use it
com.rim.samples.docs namespace is common for samples BlackBerry Application Developer Guide.
On the other hand, "package" token defines the packege namespace, not the import.
If you have downloaded code and post it to namespace with other name, you may have trouble to compile it. Resolve it in two ways:
1. if your code file is placed directly in project src folder, simply remove
package com.rim.samples.docs.notifications;
from code, this will set namespace to default.
2. in project src folder create folder "com\rim\samples\docs\notifications" and move file to folder "notifications".