I am new to MonoDroid so maybe there is an easy answer, but so far searching hasn't turned it up... Since deploying to the Android emulator takes _for_ever_ on my PC, I would like to put most of my logic into a separate library and test it from a separate winforms application. Later, I can build a regular MonoAndroid application that provides the UI and just calls the library. However, when I try to link to the MonoAndroid class library I get this message:
Warning 1 The project 'MonoAndroidClassLibrary1' cannot be referenced. The referenced project is targeted to a different framework family (MonoAndroid)
Is there another way to achieve this objective? Yes, I could simply create a separate standard windows library and copy/paste the code between the two, but there must be a better way
You can use this extension http://msdn.microsoft.com/en-us/library/ff921108%28v=pandp.20%29.aspx
You would need to create a regular .Net 2.0/3.5/4.0/etc class library and copy (or link) your source code files into it. Use this assembly for testing in winforms, and the Android class library copy for Android.
Of course, this will only allow you to write code that doesn't reference anything in the Mono.Android.dll assembly.
Related
We are trying to make the control panel service working on WinRT. However, we could not compile the code because we cannot find the namespace 'ajn'.
What we have done is:
Download the core source and the service source from AllJoyn website.
Setup a C++ uwp runtime component project and include all those source.
Add C++ wrapper codes to use the control panel service.
Setup another uwp blank app project, so it could use the wrapper codes to utilize contorl panel service.
However, we got stuck on compiling the codes, because the compiler could not find the all those classes under namespace ajn.
Where could we find the namespace? Or did we use the wrong source?
Thank you!
EDIT:
We managed to find those file, However, some linking errors shown up. Is there any good document which shows making codes process for WinRT? Or is WinRT Code Generation is well configured at all? Thanks!
Actually, the files are all in alljoyn_core folder, now the codes have been compiled.
However, some linking errors shown up. Is there any good document which shows making codes process for WinRT? Or is WinRT Code Generation is well configured at all? Thanks!
Just follow the Documentation on the Allseen Alliance's website. here is the link for the building Windows
Building on Windows
Just make sure to follow the steps after creating a new project in Visual Studio
Make sure you set the envionment variables correctly and avoid spelling mistakes. The spelling mistake cost me two to three days in finding the linking error.!
Can i place my libraries in some where over the internet and load them from cloud each time the app runs instead of being placed beside the *.exe file ?
As far as I know, Prism does not provide the functionality to do this in desktop applications as out of the box. However, Prism allows you to extend its functionality by implementing your own versions for some of its components. For this particular case I believe you might need to create your own implementation of an IModuleTypeLoader that obtains the files from the cloud instead of the local file system. You can check the FileModuleTypeLoader implementation of Prism and use it as a starting point.
How can I use it on WinRT (Windows 8) - I can't compile it. Can I use it also with "normal" Windows (WPF)?
There isn't currently an mvvmcross port specifically for wpf - a couple of people have suggested building one, but the majority of users have so far requested more work on mobile platforms instead. There is a current console (win32) port and extending that towards WPF should be quite straight-forward.
Future development is now based around the Portable Library branch - see some info on http://slodge.blogspot.co.uk/2012/09/mvvmcross-vnext-portable-class.html and the code on https://github.com/slodge/MvvmCross/tree/vnext
For WinRT, the TwitterSearch example within the vNext branch is a good place to start - it should compile and work across all of MonoTouch, MonoDroid, WP7, WinRT and Console:
If you find you can't compile then please log specific compiler error messages either here or to github issues.
MvvmCrossLibs\MvvmCrossLibs.sln consists of many projects, requiring different runtimes to be installed to open properly (Mono Touch, Mono Droid, WP7). If you only need the library in WinRT, your best bet is to open Cirrious\Cirrious.MvvmCross\Cirrious.MvvmCross.WinRT.csproj directly and add the missing Newtonsoft.JSON package with NuGet (you'll need to save the automatically created .sln file before that). It should compile just fine after that, at keast it did for me. Now just reference the assembly in your Windows Store app project and start using it.
I don't have any previous experience with MVVMCross, but it doesn't look like it currently supports despktop WPF apps. I don't know how difficult it would be to create/compile such a version, though.
I have a Silverlight app hosted in an Azure web role ASP project. The ASP project exposes a WCF service.
I would like to have one set of class definitions for the data types. Someone recommended making a third project (class library) and adding a reference to it from the SL and ASP. I started doing this, but the Silverlight project complained that you can only add references to Silverlight projects.
I then made a Silverlight class library and moved the data classes to it. However, I to add some .dll references, like to the Windows Azure storage client. Then the Silverlight class library tells me I can only add references to Silverlight 4-friendly .dlls, of which Windows Azure isn't one. Fantastic.
Is there something I can do to get around this, or am I stuck with a less elegant, redundant solution?
Multi-targeting is your best bet. There is an article explaining this in Visual Studio from Microsoft at:
http://msdn.microsoft.com/en-us/library/ff921092(PandP.20).aspx
Basically, you create both your Silverlight and standard .NET class libraries, each with a different name, and then include the same files into each. Usually the files are actually only in one of the class libraries and then soft linked in the second one.
The key is to ensure that the code in your files is compatible with both runtimes. If there needs to be separate implementation for some of your methods depending on the runtime then you need to separate these with pragmas (i.e. #ifdef SILVERLIGHT...).
If you're only doing data structures, however, there should be no issues as long as Silverlight supports the objects you are using.
See if using linked files as per this answer does the trick for you.
I want to use NetBeans to build the GUI for my project, but implement the functionality using C code. Is there any way I can make the C code run when a button in the GUI is clicked?
I believe you can use standard JNI with netbeans.
Here's a link for version 6.0, (http://www.netbeans.org/kb/60/cnd/beginning-jni-linux.html) which I hope still applies for 6.5.
Once you set up a basic JNI C-library with the appropriate headers, it's pretty easy to use from the java side. And once you have that much done, it's even possible to throw Java Exceptions from the C code (http://www.codeproject.com/KB/debug/jni_ex.aspx)
But you should take note that if you're sending a lot of data back and forth, the overhead of the JNI data passing could be greater than the gain of using C for your speed-critical sections.
Cheers
You could use Java Native Access (JNA), a new technology. With JNA, Java applications can dynamically access native libraries from Java without JNI. JNA allows you to call directly into native functions using natural Java method invocation.
The project home page is here:
https://jna.dev.java.net/
Wikimedia article:
http://en.wikipedia.org/wiki/Java_Native_Access