Top Related Projects
🥑 ArangoDB is a native multi-model database with flexible data models for documents, graphs, and key-values. Build high performance applications using a convenient SQL-like query language or JavaScript extensions.
Seamless multi-master syncing database with an intuitive HTTP/JSON API, designed for reliability
The MongoDB Database
Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes, Streams, HyperLogLogs, Bitmaps.
The high-performance database for modern applications
Quick Overview
Nuwa is a cross-platform framework for building native mobile applications using a combination of C# and XAML. It provides a set of tools and libraries that allow developers to create and deploy mobile apps for both iOS and Android platforms using a single codebase.
Pros
- Cross-Platform Development: Nuwa enables developers to write code once and deploy it to multiple platforms, reducing development time and costs.
- Native Performance: The framework generates native UI components and leverages platform-specific APIs, ensuring high-performance and native-like user experiences.
- Familiar Development Experience: Nuwa uses C# and XAML, which are familiar to many .NET developers, making it easier to onboard new team members.
- Extensive Tooling: The project includes a Visual Studio extension, emulators, and other tools to streamline the development and deployment process.
Cons
- Limited Adoption: Nuwa is a relatively niche framework, with a smaller community and ecosystem compared to more popular cross-platform solutions like React Native or Flutter.
- Platform-Specific Customization: While Nuwa aims to provide a unified development experience, there may still be a need for platform-specific customizations, which can add complexity to the codebase.
- Dependency on .NET: Nuwa is tightly coupled with the .NET ecosystem, which may be a drawback for developers who prefer other programming languages or platforms.
- Potential Performance Issues: While Nuwa aims to provide native-like performance, there may be cases where the abstraction layer introduces performance overhead, especially on older or lower-end devices.
Code Examples
Here are a few examples of how to use Nuwa to build a simple mobile app:
Creating a New Project
// Create a new Nuwa project in Visual Studio
File > New > Project > Nuwa > Nuwa App
Defining a Page
<Page x:Class="MyApp.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:MyApp">
<StackPanel>
<TextBlock Text="Hello, Nuwa!" FontSize="24" Margin="16" />
<Button Content="Click me" Clicked="Button_Clicked" />
</StackPanel>
</Page>
Handling User Interaction
public partial class MainPage : Page
{
public MainPage()
{
InitializeComponent();
}
private void Button_Clicked(object sender, RoutedEventArgs e)
{
// Handle button click event
DisplayAlert("Button Clicked", "You clicked the button!", "OK");
}
private void DisplayAlert(string title, string message, string buttonText)
{
// Display an alert dialog
var dialog = new AlertDialog(title, message, buttonText);
dialog.Show();
}
}
Getting Started
To get started with Nuwa, follow these steps:
- Install Visual Studio with the Nuwa extension.
- Create a new Nuwa project in Visual Studio.
- Define your app's user interface using XAML.
- Implement the app's logic in C# code-behind files.
- Use Nuwa's built-in tools and emulators to test your app.
- Deploy your app to the iOS and Android app stores.
Nuwa provides a comprehensive set of documentation and samples to help you get started with cross-platform mobile development. The framework's integration with Visual Studio and other .NET tools makes it a viable option for developers who are already familiar with the Microsoft ecosystem.
Competitor Comparisons
🥑 ArangoDB is a native multi-model database with flexible data models for documents, graphs, and key-values. Build high performance applications using a convenient SQL-like query language or JavaScript extensions.
Pros of ArangoDB
- ArangoDB is a mature and widely-used open-source database, with a large and active community.
- It supports multiple data models (document, key-value, and graph) in a single database, making it a versatile choice for a variety of applications.
- ArangoDB has a robust set of features, including advanced querying capabilities, transactions, and high availability.
Cons of ArangoDB
- ArangoDB has a steeper learning curve compared to Nuwa, as it is a more complex and feature-rich database.
- The installation and configuration process for ArangoDB can be more involved than Nuwa, especially for beginners.
Code Comparison
Nuwa (jasonross/Nuwa):
from nuwa import Nuwa
db = Nuwa('my_database')
db.create_collection('users')
db.users.insert({'name': 'John Doe', 'age': 30})
ArangoDB (arangodb/arangodb):
const arangojs = require('arangojs');
const db = new arangojs.Database();
db.collection('users').save({ name: 'John Doe', age: 30 });
Seamless multi-master syncing database with an intuitive HTTP/JSON API, designed for reliability
Pros of CouchDB
- CouchDB is a mature and well-established NoSQL database with a strong community and extensive documentation.
- It provides a robust replication mechanism, making it suitable for distributed and offline-first applications.
- CouchDB has a powerful query language (Mango) and supports views, which can be used for complex data analysis.
Cons of CouchDB
- CouchDB has a steeper learning curve compared to Nuwa, especially for developers new to NoSQL databases.
- The performance of CouchDB may not be as high as some other NoSQL databases, particularly for write-heavy workloads.
- The development and maintenance of CouchDB is primarily driven by the Apache Software Foundation, which may not be as agile as a smaller, independent project like Nuwa.
Code Comparison
CouchDB (Apache CouchDB):
// Create a new document
const doc = {
_id: 'my_document',
name: 'John Doe',
age: 30
};
// Save the document
db.put(doc, (err, res) => {
if (err) {
console.log('Error saving document:', err);
} else {
console.log('Document saved:', res);
}
});
Nuwa (jasonross/Nuwa):
// Create a new document
const doc = {
name: 'John Doe',
age: 30
};
// Save the document
await db.insert(doc);
The MongoDB Database
Pros of MongoDB
- MongoDB is a widely-used, enterprise-grade NoSQL database with a large and active community.
- It offers a rich set of features, including sharding, replication, and aggregation, making it suitable for a wide range of applications.
- MongoDB has excellent documentation and a vast ecosystem of tools and libraries, facilitating easy integration with various programming languages.
Cons of MongoDB
- MongoDB's complex query language and data model can have a steeper learning curve compared to simpler databases like Nuwa.
- MongoDB's storage engine can be resource-intensive, especially for large datasets, which may impact performance on lower-end hardware.
- MongoDB's licensing model and commercial offerings may be a concern for some users, particularly in open-source or cost-sensitive projects.
Code Comparison
MongoDB (mongo/mongo):
db.users.find({
name: "John Doe"
}, {
name: 1,
email: 1
})
Nuwa (jasonross/Nuwa):
from nuwa import Nuwa
db = Nuwa("users")
users = db.find(name="John Doe", fields=["name", "email"])
Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes, Streams, HyperLogLogs, Bitmaps.
Pros of Redis
- Redis is a widely-used, open-source, in-memory data structure store that is known for its high performance and scalability.
- Redis has a large and active community, with extensive documentation and a wide range of supported data structures and commands.
- Redis is highly configurable and can be used for a variety of use cases, including caching, message queuing, and real-time applications.
Cons of Redis
- Redis is primarily an in-memory database, which means that data is stored in RAM and can be lost if the server crashes or is restarted without proper persistence configuration.
- Redis has a single-threaded architecture, which means that it can only process one command at a time, which can be a limitation for highly concurrent workloads.
- Redis has a relatively complex configuration and setup process compared to some other NoSQL databases.
Code Comparison
Redis:
int main(int argc, char **argv) {
/* ... */
server.port = 6379;
server.tcp_backlog = 511;
server.bindaddr_count = 0;
server.unixsocket = NULL;
server.unixsocketperm = 0;
server.ipfd_count = 0;
server.sofd = -1;
/* ... */
}
Nuwa:
from nuwa import Nuwa
app = Nuwa()
@app.route('/')
def index():
return 'Hello, World!'
if __name__ == '__main__':
app.run()
The high-performance database for modern applications
Pros of Dgraph
- Dgraph is a highly scalable, distributed, and fast graph database, making it suitable for large-scale applications.
- It provides a powerful query language (GraphQL) and supports a wide range of data types, including geospatial data.
- Dgraph has a strong focus on performance and reliability, with features like ACID transactions and built-in caching.
Cons of Dgraph
- Dgraph has a steeper learning curve compared to Nuwa, as it is a more complex and feature-rich database.
- The setup and configuration of Dgraph can be more involved, especially for large-scale deployments.
Code Comparison
Nuwa:
from nuwa import Nuwa
db = Nuwa()
db.create_node("Person", name="John Doe")
db.create_node("Person", name="Jane Smith")
db.create_edge("knows", "Person", "Person")
Dgraph:
client, err := dgo.NewClient(dgo.FromConfig(&dgo.Config{
Addr: "localhost:9080",
}))
txn := client.NewTxn()
_, err = txn.Mutate(ctx, &api.Mutation{
SetJson: []byte(`{"name": "John Doe"}`),
})
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Nuwa
Nuwa is a goddess in ancient Chinese mythology best known for repairing the pillar of heaven.
With this Nuwa projectï¼you can also have the repairing power, fix your android applicaiton without have to publish a new APK to the appstore.
Features
- Support both dalvik and art runtime.
- Support productFlavor and buildType.
- Support proguard and multidex.
- Pure java implementation.
Run the Sample
-
in
master
branch, run and install the app.it showsãhello worldã.
-
copy sample/build/outputs/nuwa dir to somewhere for later use.
for example: /Users/jason/Documents/nuwa
-
change to
bugfix
branch, run the following command in terminal to generate patch.jar../gradlew clean nuwaQihooDebugPatch -P NuwaDir=/Users/jason/Documents/nuwa
java verison must be same using android studio and terminal
-
run following command to push patch.jar to sdcard.
adb push sample/build/outputs/nuwa/qihoo/debug/patch.jar /sdcard/
-
restart your application (kill the process).
it showsãpatch successã.
Integration
Get Gradle Plugin
- add following to the build.gradle of your root project.
classpath 'cn.jiajixin.nuwa:gradle:1.2.2'
build.gradle maybe look like this:
```
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'cn.jiajixin.nuwa:gradle:1.2.2'
}
}
```
2. add following to your build.gradle:
>apply plugin: "cn.jiajixin.nuwa"
Get Nuwa SDK
-
gradle dependency:
dependencies { compile 'cn.jiajixin.nuwa:nuwa:1.0.0' }
Use Nuwa SDK
-
add following to your application class:
@Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); Nuwa.init(this); }
-
load the patch file according to your needs:
Nuwa.loadPatch(this,patchFile)
I plan to provide the management of patch file later.
ProGuard
-
add follwing to you proguardFile if you are using proguard:
-keep class cn.jiajixin.nuwa.** { *; }
Nuwa DSL
-
You can add
nuwa
extension to your build.gradle. Generally, you don't need this.nuwa{ }
-
Nuwa extension support following DSL object.
-
includePackage:HashSet<String>
The internal name of a class is its fully qualified name, where '.' are replaced by '/'. For example:
cn/jiajixin/nuwasample/MainActivity.class
Using includePackageï¼you can only fix those classes whose internal name starts with includePackage.For example:
includePackage = ['cn/jiajixin/nuwasample']
Default, Nuwa can fix classes which not from the android support library.
-
excludeClass:HashSet<String>
All Application subclasses should not be injected by Nuwa.
Default, Nuwa will automatically exclude the application declared in your manifest file. You need to exclude others using excludeClass
Using excludeClass, you can not fix those classes whose internal name ends with excludeClass.For example:
excludeClass = ['BaseApplication.class']
-
debugOn:boolean
whether use Nuwa in debug mode, default to
true
.
-
Generate Patch
For how to generate patch file, please reference the first three steps of Run the Sample.
There are two types of gradle task to generate patch fileï¼
-
nuwaPatches
this task will generate multi patch.jar for all variant.
-
nuwa${variant.name.capitalize()}Patch
this task will generate one patch.jar for specific variant.
How it Works
Inspired by QZone hotfix solution from this article.
Nuwa Gradle
- inject into all classes one java bytecode referring the Hack.class from a different dex, which can avoid CLASS_ISPREVERIFIED error when replacing class.
- generate patch.jar according to mapping.txt and classes hash of last published APK.
Nuwa
- inject the Hack.class.
- inject the patch.jar into head of BaseDexClassLoader's pathList.
Later Plan
- provide patch file management
- improve security of Nuwa
License
Copyright (c) 2015, jiajixin.cn
Top Related Projects
🥑 ArangoDB is a native multi-model database with flexible data models for documents, graphs, and key-values. Build high performance applications using a convenient SQL-like query language or JavaScript extensions.
Seamless multi-master syncing database with an intuitive HTTP/JSON API, designed for reliability
The MongoDB Database
Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes, Streams, HyperLogLogs, Bitmaps.
The high-performance database for modern applications
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot