Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes by GitHub action #36

Merged
merged 3 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The project is organized in this folder structure:
* **jvm**
* **netdroid**: contains the JVM side implementation of some classes managed from .NET side; it is structured as a complete Maven project
* **net**
* **Netdroid**: The folder containing the source and project of the Apache Kafka files ported on .NET
* **Netdroid**: The folder containing the source and project of the Andoird SDK files ported on .NET


# How Can I Contribute?
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ netdroid uses [JCOBridge](https://www.jcobridge.com/), and its [features](https:
* [JVM](https://en.wikipedia.org/wiki/Java_virtual_machine) and [CLR, or CoreCLR,](https://en.wikipedia.org/wiki/Common_Language_Runtime) runs in the same process, but are insulated from each other;
* JCOBridge does not make any code injection into JVM;
* JCOBridge does not use any other communication mechanism than JNI;
* .NET (CLR) inherently inherits the cyber-security levels of running JVM and Apache Kafka;
* .NET (CLR) inherently inherits the cyber-security levels of running JVM and Android SDK;
* **Direct access the JVM from any .NET application**:
* Any Java/Scala class behind Apache Kafka can be directly managed: Consumer, Producer, Administration, Streams, Server-side, and so on;
* Any JVM class behind Android SDK can be directly managed;
* No need to learn new APIs: we try to expose the same APIs in C# style;
* No extra validation cycle on protocol and functionality: bug fix, improvements, new features are immediately available;
* Documentation is shared;
Expand Down
5 changes: 4 additions & 1 deletion src/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
"java.sql.ShardingKeyBuilder",
"java.sql.SQLType",
"java.text.NumberFormat$Style",
"java.time.chrono.ChronoLocalDate",
"java.util.Comparator",
"java.util.EventListener",
"java.util.random.RandomGenerator",
Expand All @@ -115,6 +114,10 @@
"javax.xml.xpath.XPathEvaluationResult",
"org.w3c.dom.ls.LSSerializerFilter"
],
"ClassesToAvoidInGenerics": [
"java.time.chrono.ChronoLocalDateTime",
"java.time.chrono.ChronoZonedDateTime"
],
"NamespacesInConflict": [
"java.lang.module",
"java.awt.color",
Expand Down
6 changes: 3 additions & 3 deletions src/documentation/api/index.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: APIs of .NET suite for Apache Kafka
_description: Describes the current available APIs of .NET suite for Apache Kafka
title: APIs of Android suite for .NET
_description: Describes the current available APIs of Android suite for .NET
---

# KNet: .NET gateway for Apache Kafka APIs
# Netdroid: Android suite for .NET

Open left menu to browse API
4 changes: 2 additions & 2 deletions src/documentation/articles/API_extensibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ Using the listed properties it is possible to instruct the JVM about the action
If no classes are available the solution comes from the global accessor available in JCOBridge and the code snippet is like the following one:

```C#
var panel = JNetCore.New("java.awt.Panel"); // the returned object is a dynamic object reference of the Panel object in Java
var dynImageCapabilities = JNetCore.New("java.awt.ImageCapabilities", true); // the returned object is a dynamic object which is a reference of the ImageCapabilities object in Java
var panel = NetdroidCore.New("java.awt.Panel"); // the returned object is a dynamic object reference of the Panel object in Java
var dynImageCapabilities = NetdroidCore.New("java.awt.ImageCapabilities", true); // the returned object is a dynamic object which is a reference of the ImageCapabilities object in Java
var volImage = panel.createVolatileImage(100, 100, dynImageCapabilities); // the returned object is a dynamic object which reference the VolatileImage object in Java
var snapshot = volImage.getSnapshot(); // the returned object is a dynamic object reference of the BufferedImage object in Java
var isContentLost = volImage.contentsLost(); // the returned object is a bool representing the Java counterpart
Expand Down
2 changes: 1 addition & 1 deletion src/documentation/articles/commandlineswitch.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ One of the most important command-line switch is **JVMPath** and it is available
If a developer is using KNet within its own product it is possible to override the **JVMPath** property with a snippet like the following one:

```c#
class MyJNetCore : JNetCore
class MyNetdroidCore : NetdroidCore
{
public override string JVMPath
{
Expand Down
6 changes: 3 additions & 3 deletions src/documentation/articles/jvm_callbacks.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ In Netdroid some callbacks are ready made. In this tutorial the **Predicate** in
The concrete class implementing the interface is the following one:

```java
public final class JNetPredicate extends JCListener implements Predicate {
public JNetPredicate(String key) throws JCNativeException {
public final class Predicate extends JCListener implements java.util.function.Predicate {
public Predicate(String key) throws JCNativeException {
super(key);
}

Expand All @@ -45,7 +45,7 @@ Going on to the CLR side a possible concrete class in C# is as the following one
```c#
public class Predicate<TObject> : JVMBridgeListener
{
public override string ClassName => "org.mases.jnet.util.function.JNetPredicate";
public override string ClassName => "org.mases.netdroid.developed.java.util.function.Predicate";

Func<TObject, bool> executionFunction = null;
public virtual Func<TObject, bool> OnTest { get { return executionFunction; } }
Expand Down
4 changes: 2 additions & 2 deletions src/documentation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ netdroid uses [JCOBridge](https://www.jcobridge.com/), and its [features](https:
* [JVM](https://en.wikipedia.org/wiki/Java_virtual_machine) and [CLR, or CoreCLR,](https://en.wikipedia.org/wiki/Common_Language_Runtime) runs in the same process, but are insulated from each other;
* JCOBridge does not make any code injection into JVM;
* JCOBridge does not use any other communication mechanism than JNI;
* .NET (CLR) inherently inherits the cyber-security levels of running JVM and Apache Kafka;
* .NET (CLR) inherently inherits the cyber-security levels of running JVM and Android SDK;
* **Direct access the JVM from any .NET application**:
* Any Java/Scala class behind Apache Kafka can be directly managed: Consumer, Producer, Administration, Streams, Server-side, and so on;
* Any JVM class behind Android SDK can be directly managed;
* No need to learn new APIs: we try to expose the same APIs in C# style;
* No extra validation cycle on protocol and functionality: bug fix, improvements, new features are immediately available;
* Documentation is shared;
Expand Down
46 changes: 0 additions & 46 deletions src/net/Netdroid/Generated/Android/Net/AllPackageClasses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2552,52 +2552,6 @@ public TrafficStats(params object[] args) : base(args) { }
}
#endregion

#region TransportInfo
/// <summary>
/// <see href="https://developer.android.com/reference/android/net/TransportInfo.html"/>
/// </summary>
public partial class TransportInfo : MASES.JCOBridge.C2JBridge.JVMBridgeBase<TransportInfo>
{
const string _bridgeClassName = "android.net.TransportInfo";
/// <summary>
/// Default constructor: even if the corresponding Java class does not have one, it is mandatory for JCOBridge
/// </summary>
[global::System.Obsolete("TransportInfo class represents, in .NET, an instance of a JVM interface or abstract class. This public initializer is needed for JCOBridge internal use, other uses can produce unidentible behaviors.")]
public TransportInfo() { }
/// <summary>
/// Generic constructor: it is useful for JCOBridge when there is a derived class which needs to pass arguments to the highest JVMBridgeBase class
/// </summary>
[global::System.Obsolete("TransportInfo class represents, in .NET, an instance of a JVM interface or abstract class. This public initializer is needed for JCOBridge internal use, other uses can produce unidentible behaviors.")]
public TransportInfo(params object[] args) : base(args) { }

private static readonly IJavaType LocalBridgeClazz = ClazzOf(_bridgeClassName);

/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_BridgeClassName.htm"/>
/// </summary>
public override string BridgeClassName => _bridgeClassName;
/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_IsBridgeAbstract.htm"/>
/// </summary>
public override bool IsBridgeAbstract => true;
/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_IsBridgeCloseable.htm"/>
/// </summary>
public override bool IsBridgeCloseable => false;
/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_IsBridgeInterface.htm"/>
/// </summary>
public override bool IsBridgeInterface => true;
/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_IsBridgeStatic.htm"/>
/// </summary>
public override bool IsBridgeStatic => false;

// TODO: complete the class

}
#endregion

#region Uri
/// <summary>
/// <see href="https://developer.android.com/reference/android/net/Uri.html"/>
Expand Down
8 changes: 0 additions & 8 deletions src/net/Netdroid/Generated/Android/Net/NetworkCapabilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -332,14 +332,6 @@ public Android.Net.NetworkSpecifier GetNetworkSpecifier()
return IExecuteWithSignature<Android.Net.NetworkSpecifier>("getNetworkSpecifier", "()Landroid/net/NetworkSpecifier;");
}
/// <summary>
/// <see href="https://developer.android.com/reference/android/net/NetworkCapabilities.html#getTransportInfo()"/>
/// </summary>
/// <returns><see cref="Android.Net.TransportInfo"/></returns>
public Android.Net.TransportInfo GetTransportInfo()
{
return IExecuteWithSignature<Android.Net.TransportInfo>("getTransportInfo", "()Landroid/net/TransportInfo;");
}
/// <summary>
/// <see href="https://developer.android.com/reference/android/net/NetworkCapabilities.html#hasCapability(int)"/>
/// </summary>
/// <param name="arg0"><see cref="int"/></param>
Expand Down
76 changes: 0 additions & 76 deletions src/net/Netdroid/Generated/Android/Net/TransportInfo.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,14 @@
namespace Android.Net.Wifi.Aware
{
#region WifiAwareNetworkInfo
public partial class WifiAwareNetworkInfo : Android.Net.ITransportInfo, Android.Os.IParcelable
public partial class WifiAwareNetworkInfo : Android.Os.IParcelable
{
#region Constructors

#endregion

#region Class/Interface conversion operators
/// <summary>
/// Converter from <see cref="Android.Net.Wifi.Aware.WifiAwareNetworkInfo"/> to <see cref="Android.Net.TransportInfo"/>
/// </summary>
public static implicit operator Android.Net.TransportInfo(Android.Net.Wifi.Aware.WifiAwareNetworkInfo t) => t.Cast<Android.Net.TransportInfo>();
/// <summary>
/// Converter from <see cref="Android.Net.Wifi.Aware.WifiAwareNetworkInfo"/> to <see cref="Android.Os.Parcelable"/>
/// </summary>
public static implicit operator Android.Os.Parcelable(Android.Net.Wifi.Aware.WifiAwareNetworkInfo t) => t.Cast<Android.Os.Parcelable>();
Expand Down
15 changes: 1 addition & 14 deletions src/net/Netdroid/Generated/Android/Net/Wifi/WifiInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,14 @@
namespace Android.Net.Wifi
{
#region WifiInfo
public partial class WifiInfo : Android.Net.ITransportInfo, Android.Os.IParcelable
public partial class WifiInfo : Android.Os.IParcelable
{
#region Constructors

#endregion

#region Class/Interface conversion operators
/// <summary>
/// Converter from <see cref="Android.Net.Wifi.WifiInfo"/> to <see cref="Android.Net.TransportInfo"/>
/// </summary>
public static implicit operator Android.Net.TransportInfo(Android.Net.Wifi.WifiInfo t) => t.Cast<Android.Net.TransportInfo>();
/// <summary>
/// Converter from <see cref="Android.Net.Wifi.WifiInfo"/> to <see cref="Android.Os.Parcelable"/>
/// </summary>
public static implicit operator Android.Os.Parcelable(Android.Net.Wifi.WifiInfo t) => t.Cast<Android.Os.Parcelable>();
Expand Down Expand Up @@ -179,15 +175,6 @@ public Android.Net.MacAddress GetApMldMacAddress()
return IExecuteWithSignature<Android.Net.MacAddress>("getApMldMacAddress", "()Landroid/net/MacAddress;");
}
/// <summary>
/// <see href="https://developer.android.com/reference/android/net/wifi/WifiInfo.html#makeCopy(long)"/>
/// </summary>
/// <param name="arg0"><see cref="long"/></param>
/// <returns><see cref="Android.Net.TransportInfo"/></returns>
public Android.Net.TransportInfo MakeCopy(long arg0)
{
return IExecuteWithSignature<Android.Net.TransportInfo>("makeCopy", "(J)Landroid/net/TransportInfo;", arg0);
}
/// <summary>
/// <see href="https://developer.android.com/reference/android/net/wifi/WifiInfo.html#getSupplicantState()"/>
/// </summary>
/// <returns><see cref="Android.Net.Wifi.SupplicantState"/></returns>
Expand Down
10 changes: 0 additions & 10 deletions src/net/Netdroid/Generated/Java/Time/Chrono/AbstractChronology.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,6 @@ public int CompareTo(Java.Time.Chrono.Chronology arg0)
{
return IExecuteWithSignature<int>("compareTo", "(Ljava/time/chrono/Chronology;)I", arg0);
}
/// <summary>
/// <see href="https://developer.android.com/reference/java/time/chrono/AbstractChronology.html#resolveDate(java.util.Map,java.time.format.ResolverStyle)"/>
/// </summary>
/// <param name="arg0"><see cref="Java.Util.Map"/></param>
/// <param name="arg1"><see cref="Java.Time.Format.ResolverStyle"/></param>
/// <returns><see cref="Java.Time.Chrono.ChronoLocalDate"/></returns>
public Java.Time.Chrono.ChronoLocalDate ResolveDate(Java.Util.Map<Java.Time.Temporal.TemporalField, Java.Lang.Long> arg0, Java.Time.Format.ResolverStyle arg1)
{
return IExecute<Java.Time.Chrono.ChronoLocalDate>("resolveDate", arg0, arg1);
}

#endregion

Expand Down
46 changes: 0 additions & 46 deletions src/net/Netdroid/Generated/Java/Time/Chrono/AllPackageClasses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,52 +72,6 @@ public AbstractChronology(params object[] args) : base(args) { }
}
#endregion

#region ChronoLocalDate
/// <summary>
/// <see href="https://developer.android.com/reference/java/time/chrono/ChronoLocalDate.html"/>
/// </summary>
public partial class ChronoLocalDate : MASES.JCOBridge.C2JBridge.JVMBridgeBase<ChronoLocalDate>
{
const string _bridgeClassName = "java.time.chrono.ChronoLocalDate";
/// <summary>
/// Default constructor: even if the corresponding Java class does not have one, it is mandatory for JCOBridge
/// </summary>
[global::System.Obsolete("ChronoLocalDate class represents, in .NET, an instance of a JVM interface or abstract class. This public initializer is needed for JCOBridge internal use, other uses can produce unidentible behaviors.")]
public ChronoLocalDate() { }
/// <summary>
/// Generic constructor: it is useful for JCOBridge when there is a derived class which needs to pass arguments to the highest JVMBridgeBase class
/// </summary>
[global::System.Obsolete("ChronoLocalDate class represents, in .NET, an instance of a JVM interface or abstract class. This public initializer is needed for JCOBridge internal use, other uses can produce unidentible behaviors.")]
public ChronoLocalDate(params object[] args) : base(args) { }

private static readonly IJavaType LocalBridgeClazz = ClazzOf(_bridgeClassName);

/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_BridgeClassName.htm"/>
/// </summary>
public override string BridgeClassName => _bridgeClassName;
/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_IsBridgeAbstract.htm"/>
/// </summary>
public override bool IsBridgeAbstract => true;
/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_IsBridgeCloseable.htm"/>
/// </summary>
public override bool IsBridgeCloseable => false;
/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_IsBridgeInterface.htm"/>
/// </summary>
public override bool IsBridgeInterface => true;
/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_IsBridgeStatic.htm"/>
/// </summary>
public override bool IsBridgeStatic => false;

// TODO: complete the class

}
#endregion

#region ChronoLocalDateTime
/// <summary>
/// <see href="https://developer.android.com/reference/java/time/chrono/ChronoLocalDateTime.html"/>
Expand Down
Loading
Loading