external jar file include in java binding library in monodroid? - c#

i am just starting to develop in monodroid , i know android and c# too. i have created android app using viewflow example. so i have now viewflow library 's jar file , i have included that .jar file in my monodroid java binding library as defined in http://docs.xamarin.com/Android/Guides/Advanced_Topics/Java_Integration_Overview/Binding_a_Java_Library_(.jar). But when i build that java library project i have got following error.. i have stuck with this almost 3 hrs.
'Org.Taptwo.Android.Widget.ViewFlow' does not implement inherited abstract member 'Android.Widget.AdapterView.RawAdapter.set'

This has been filed as bug 11279. The workaround is to add a file to your binding project with the following contents:
using Android.Runtime;
namespace Org.Taptwo.Android.Widget {
partial class ViewFlow {
protected override Java.Lang.Object RawAdapter {
get {return Adapter.JavaCast<Java.Lang.Object>();}
set {Adapter = value.JavaCast<global::Android.Widget.IListAdapter>();}
}
}
}
Change the namespace and type name as appropriate to fix other binding projects.

Related

ModuleNotFoundError when importing a .NET custom class in pythonnet

I'm trying to import a VERY SIMPLE custom C# class into Python using pythonnet. I've never used C# or VS, so It's probably some stupid mistake I'm doing.
I have got a solid C# code base (not written by me) that I want to drive using Python.
I have this C# class:
using System;
public class MyClass
{
string text;
public MyClass(string text)
{
this.text = text;
}
public void Write()
{
Console.WriteLine(text);
}
}
In VS 2017, I've created a .NET Core Class Library project. It compiles fine and creates a MyClass.dll file.
Then I'm trying to import it in Python:
import sys
sys.path.append(r"C:\Users\myuser\source\repos\hello\MyClass\bin\Debug\netcoreapp2.1")
import clr
clr.FindAssembly(r"MyClass")
clr.AddReference('MyClass')
import MyClass
But I always get a "ModuleNotFoundError: No module named 'MyClass'" error.
Turns out I was compiling the DLL with .NET Core. Changing to .NET Framekwork 4.5 solved the problem.
I wish the error messages were more helpful.

xamarin android jar binding error - Class does not implement interface method

I have a some problem with xamarin binding project.
I got error message below from vs2017 when I was build Android binding project.
Class does not implement interface method
of course, I have found some tips to solve this problem through editing Metadata.xml
but, It is not working. because I have no experience about this.
so. please, I want you to watch my source attached file.
I would upload tow files.
one of them is binding project made by vs2017 including jar.
and then anther one is original jar sdk to bind into my android project.
binding project download link : http://cloud-wr-sg1.acronis.com/links/8E2127FA6223CFC1DA19AE89FB393BAF
original jar file download link :
http://cloud-wr-sg1.acronis.com/links/705ADB4D99254F8490FD3B1D1AACEA34
I need help. I'm in emergency.
You can read the official documents: Java Bindings Metadata and Troubleshooting Bindings. For your scenario, you can add a additional file in your binding library for example like this:
namespace Com.Skp.Tmap
{
partial class TMapView
{
void DraggingAnimateThread.IDraggingCallback.Zoom(float p0, bool p1)
{
}
void DraggingAnimateThread.IDraggingCallback.Rotate(float p0)
{
}
}
}

Expression Blend + Sketchflow - Addin?

Has anyone been able to get an extension up and running Expression Blend + Sketchflow preview? I'm looking for an example project.
I was following this article, but it is a bit outdated.
So far I:
Created a .Net 4.5 class library project
Added a reference to the Microsoft.Expression.Extensibility.dll in the new Blend Preview directory
Set my project to deploy to the appropriate Addins directory
Setup Visual Studio to run the new Blend.exe for debugging
Hooked up MEF and inherited IPlugin as in the example
But my plugin doesn't seem to load and no breakpoints are hit.
After reading your question I decided to start working on a new version of that tutorial.
A few things to get you started right away.
I've created the basic plugin like this:
using System.ComponentModel.Composition;
using Microsoft.Expression.Extensibility;
namespace Demo.Extension
{
[Export(typeof (IPackage))]
public class Demo : IPackage
{
public void Load(IServices services)
{
}
public void Unload()
{
}
}
}
Make sure you:
place the plugins in ...\Blend Preview\extensions
run visual studio as administrator to be able to deploy to that folder during debug
implement the IPackage instead of IPlugin
Got it working by following the demo here.
I used the few modifications above, and put things in the Blend Preview directory.

C# .Net Write plug-ins for windows live writer and my plugins cant be loaded

I'm new in .Net and I'm now trying to write a plugin for windows live writer because I prefer to publish blogs using it rather than using the web editors. And I want to develop some small plugins for my daily use. But after I created a class libarary project and built it following the steps as some developers described, the WLW does not load the plugin so I don't know how to debug.
My Code:
using System;
using System.Collections.Generic;
using System.Text;
using WindowsLive.Writer.Api;
using System.Windows.Forms;
namespace Insert_Colorful_Table
{
[WriterPluginAttribute
("f7581112-dddd-47c9-9db0-46987a2aaae1",
"Insert Colorful Table",
Description = "Helps you create a beautiful table.",
ImagePath = "icon.gif",
PublisherUrl = "http://ggicci.blog.163.com")]
[InsertableContentSource("Insert Colorful Table")]
public class Plugin : ContentSource
{
public override DialogResult CreateContent
(IWin32Window dialogOwner, ref string content)
{
content = #"<table><tr><td>Ggicci</td></tr></table>";
return DialogResult.OK;
}
}
}
I did configure the 'Build Events' of the project and set the 'Build Action' of the image to 'Embedded Resource'. And no errors occured when building my project.
okay, I've worked out what went wrong. Windows Live Writer supports plugins that are built with either the Microsoft .NET Framework version 1.1 or 2.0. Writer requires users to have .NET 2.0 present to install the application. But I used .NET 4.0. So when I changed target framework to 2.0, then it worked well.

how can i access C# dll from VBScript on client machine

i have created a C# dll file on my machine as shown below:
namespace myDLL
{
public class myClass
{
public string myFunction()
{
return "I am Here";
}
}
}
then i created a tlb file with "tlbexp" command,
then i used the "regasm" command n registered this dll on my machine.
When i created an object of type myClass on my machine using VBScript, everything is working fine... here i used the CreateObject() method as shown below:
Set myObj = CreateObject("myDll.myClass")
Now i want to create an object of type myClass from VBScript that is running on another machine, how can i do this. please help me how can i access that dll file, am using the CreateObject() function as shown below:
Set HD = CreateObject("myDll.myClass","myMachineName")
now am getting error as "permission denied".
It appears that this is supported if the assembly is built with as COM visibility enabled.
Is it possible to execute a .NET assembly(dll) from vbscript?
By the way, I was pretty delighted to find out that there is a JScript compiler for .NET which allows one to write .NET code using JScript and also to target other .NET assemblies but unfortunately I haven't found anything similar for VBScript.

Categories