Comments (2)
This example plugin only demonstrates primitive types such as int
and string
.
I'm unsure if the Android JNI supports passing of complex types but that is beyond the scope of this simple example.
For iOS it's easier as you only have to map the stringified Javascript structure passed via the Cordova plugin interface to C types in your Objective C plugin implementation.
I'd suggest Googling how to pass complex types using the Android JNI as this is not something I've had need to do so have no experience with.
from cordova-plugin-hello-c.
Android is over for this project. iOS is the main.
My problem is when Objective try to read a Struct from JS.
- (void) calc_example:(CDVInvokedUrlCommand *)command
{
// option 1 - NSString* a = [[command arguments] objectAtIndex:0];
// option 2 - NSArray* a = [[command arguments] objectAtIndex:0];
// option 3 - NSDictionary* a = [[command arguments] objectAtIndex:0];
// More options?
float output = calc_example(a);
CDVPluginResult* result = [CDVPluginResult
resultWithStatus:CDVCommandStatus_OK
messageAsDouble:output];
[self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
}
from cordova-plugin-hello-c.
Related Issues (14)
- Failed to restore plugin HOT 5
- Error initializing Cordova: Class not found HOT 9
- Class Not Found HOT 1
- iOS 10 is the maximum deployment target for 32-bit targets HOT 2
- Help Needed
- Dlib Library HOT 1
- compile-android.cmd error
- Android.mk not found HOT 9
- Help C++ HOT 1
- Processing Raw Data in C HOT 7
- cordova platform 7.x problems HOT 2
- Problems when run on cordova-android@7 HOT 13
- compile-android problem HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-plugin-hello-c.