I need to use an iOS .framework dynamic library with Codename One, but I didn't find proper instructions.
In the developers guide (section: https://www.codenameone.com/manual/advanced-topics.html#_bundling_native_ios_sdk) there are the following tips, but there are not seem to work:
Find the "binary" file within the framework, and copy it into your native/ios directory - but rename it libXXX.a (where XXX is the name of the binary).
Copy all .h files from the framework into your native/ios directory.
Update all #import statements in the headers from #import format to simply #import "FileName.h"
This doesn't work when the *.framework doesn't contain a static library but a dynamic one (as suggested in the answers to How to create static library from an existing framework in iOS?).
Before iOS 8, all .framework files contained only static libraries, but starting from iOS 8 Apple is permitting developers to create dynamic frameworks (as reported in https://stackoverflow.com/a/15331319/1277576).
Updated Answer:
Starting with the next update (Next friday), you'll be able to include iOS frameworks by simply zipping up the framework, and adding it to your project's native/ios directory. Eg. native/ios/MyFramework.framework.
You can still, alternatively, create a custom podspec as a part of your project. The steps are:
Add native/ios/podspecs/MyFramework.podspec with contents:
Pod::Spec.new do |s|
s.name = "MyFramework"
s.version = "1.0.0"
s.summary = "MyFramework framework"
s.description = "This spec specifies a vendored framework."
s.platform = :ios
s.homepage = "https://www.codenameone.com"
s.source = {:path => "."}
s.author = "Codename One"
s.vendored_frameworks = "MyFramework.framework"
end
Copy the MyFramework.framework into native/ios/podspecs
Build hints:
ios.pods=MyFramework
This workaround isn't perfect because the project probably isn't portable to Windows ( but it should work on Linux and Mac). The new method (zipping the framework and adding to native/ios) is 100% portable.
Original Answer:
For frameworks, you can place them inside a custom podspec. Here is a sample Codename One project that defines a custom podspec.
https://github.com/shannah/TestCustomPodspec
Notice, all you need to do is create a native/ios/podspecs directory in your project, and then you can place your custom podspecs in there. You can reference your podspec using the ios.pods build hint.
For information on packaging your .framework in a Podspec, this article looks pretty informative, starting at "Consume Framework Using Local CocoaPods"
I'm afraid we never worked with iOS dynamic library frameworks as cocoapods became universal and took over the need for working with frameworks evaporated. Frameworks are problematic as they can't be shared with PC developers since they have symbolic links within them etc. So sending them as part of the build process would be problematic.
Most cases that needed creative solutions created a custom pod.
Related
I've downloaded VS2017 Community Edition and I'm working through "Programming in C" by Stephen G. Kochan.
I'd like to store all the examples in one project (possibly 1 project per chapter), however I've come across the error about multiple "main" files in one project. Before telling me I can't have multiple main's in a project, could you suggest the best way to organise these small C programs in VS2017.
I love the fact that I don't have to use a terminal compiler and would like to use VS2017 to work my way through the book.
Any suggestions?
A typical case of "assignments" in a course. In that case you can create one module (c file) for each assignment and call the current assignment from your main. Now you have all assignments in a single project, so you can easily look them up. Assignments completed you can comment-out.
I don't think you really want them all in one project. I think you want them all in one Solution, with each example in its own Project. That way you can switch between projects in the IDE and build/run/debug whichever one you are working on at the time.
Add a new project to your solution by right-clicking the solution in Solution Explorer and selecting Add->New Project from the menu.
Set the active project by right-clicking the project in Solution Explorer and choose "Set as startup project" from the menu.
This allows you to build each example on its own, or build all of them at once. Each project is self-contained and generates its own executable, and you can navigate around from one project to another inside the IDE.
You can compile and run your C files individually from command line.
This is not ideal when using an IDE.
Your other option is to use add_executable command in cmake
Adds an executable target called to be built from the source
files listed in the command invocation. The corresponds to the
logical target name and must be globally unique within a project. The
actual file name of the executable built is constructed based on
conventions of the native platform (such as .exe or just
).
I have to create one-file (.exe) program.
In this program user can choose directory from his computer.
I create program in order of http://www.tarnyko.net/en/?q=node/31 and it run well.
But when I invoke FileChoser (click on button) I got this error
GLib-GIO-ERROR No GSettings schemas are installed on the system
Response of Tarnyko to this issue is in coment on webpage - this is known "bug" with static compiling.
How can I work around this?
On the one hand I have to have one-file.exe.
On the other hand I realy do not want create "sophisticated" FileChooser on my own... is there any option to deal with this?
My ideas:
1 - Call native File chooser of OS (windows)
2 - Create file chooser on my own - if it is not "much hard" in gtk
I do not know how to do either of this.
Sorry for duplicating - probably succes solution is in answer form "ebassi" here GLib-GIO-ERROR**: No GSettings schemas are installed on the system (not tested yet)
Settings schemas (which are used in GTK in more places than just the file selector widget) cannot be statically linked into a binary: they have to be installed in a well known location (controllable via the $XDG_DATA_DIRS environment variable) and they have to be compiled into a cache.
GTK's dependencies like Pango and GDK-Pixbuf also use ancillary files and loadable modules that are not strictly compatible (unless you're willing to spend time on it) with static linking.
The usual recommendation for only providing a single executable for your application is to have a self-extracting installer that contains all the installed files necessary to running a GTK application, and avoid static linking.
I don't think it's possible to create just one .exe file (without any other files) with GTK+. Maybe only when you recode the GTK and it's dependencies - which is not an easy task to do.
The best solution I found is to put all schemas (and also icons for your GTK+ app) in the same location where your .exe file is placed:
EXE_LOCATION\program.exe
// For icons:
EXE_LOCATION\share\icons\hicolor...
// For schemas
EXE_LOCATION\share\glib-2.0\schemas
Then you deliver these files together with your .exe file and with all needed .dll files.
About the native file chooser in GTK+: It also needs the schemas - at least on Windows OS.
I want to import javacardx.apdu and javacardx.framework in eclipse and use in applet in java card, how do this work? and how do I download .jar file to import.
thnaks
You can find the JavaCard Development Kit here.
The JCDK contains not only the APIs but also tools to help you build CAP files. You should read the documentation provided.
The jar file you look for is api_classic.jar and you should find it in the lib folder of the JCDK. You need to add it to your classpath so you can compile java card code.
You cannot (usually) upload .jar files. You need to convert the class files within a package to a .cap file. This conversion is usually performed by the JCDK converter tool or a third party equivalent. It converts the byte code into Java Card compatible byte code and performs some early binding (using .exp files delivered with the various libraries).
You may of compile against the api_classic.jar found in the lib fo lderof the JCDK to find out if your code compiles. Note that the name of the .jar may differ for different versions of the JCDK - I've used the one for Java Card version 3, where the functionality has been split into the connected and classic API.
I strongly recommend you follow some tuturials and - of course - the book Java Card Technology for Smart Cards: Architecture and Programmer's Guide.
The files must be in the same path so I'm wondering how to work around this so that whenever I duplicate a target, a new copy is made that can be edited without changing the original. This would make the creation of new versions of existing applications much easier!
Targets are not used to create different versions of apps (as in v1.0, v1.1, etc). They are used to be compiled to different binaries using the same shared code.
Here are common uses for targets:
iOS target + OS X target
Lite app target + Full app target
iPhone app target + iPad app target
Unit tests target
Static library target
If you want to keep track of the different versions of your app (again version as in v1.0, v1.1, etc), then you should use a versioning system (such as git or svn), or make snapshots of your project for each version. Personally, I recommend using git.
I'm using Prism 4 with Unity. I have a main project, and a module. The module is created as Silverlight Applications, so it builds a separate xap file.
I load the modules in the Bootstrapper's ConfigureModuleCatalog, just like the documentation states.
var moduleType = typeof (MyModule);
this.ModuleCatalog.AddModule(
new ModuleInfo
{
ModuleName = moduleType.Name,
ModuleType = moduleType.AssemblyQualifiedName,
InitializationMode = InitializationMode.WhenAvailable,
});
Everything works fine, but I notice that my main xap file also contains the dlls associated with my module. So, I set Copy Local = False on the module reference, and it builds correctly with the module dlls only in their own xap file.
But now my app won't run because I can't get the type information for MyModule. I get a FileNotFoundException.
I found that I can drop the reference entirely if I manually enter the ModuleName and ModuleType, and also set Ref = "MyModule.xap" on the ModuleInfo. This works fine, but here's the problem: I build frequently and use dynamic verion numbers. So the AssemblyQualifiedName changes too easily. Without the reference, there's no way to get it dynamically. If I drop the version number from the AssemblyQualifiedName, it doesn't work.
Surely there's some other way to get the module to load from its own xap file without it ending up also in the main xap?
Nevermind...
After researching further, it seems my mistake is in using wildcard versioning in the assembly version. It is suggested on many sites to use the wildcard in the assembly FILE version only, and use fixed version numbers on the assembly version. Then I can just drop the reference and refer to the module by its strong name with fixed version number.
I was so locked in to prism on this one. I didn't figure it out until I thought about assembly location in general. The post that solved it for me actual was about resolving sharepoint parts. Just goes to show sometimes you have to think outside the box.
Update
Looks like you can't use the wildcard in the file version... grr... I found an add-in that will work though http://autobuildversion.codeplex.com/
Anyone got a better idea?