I read the following guides for native interface.
https://www.codenameone.com/how-do-i---access-native-device-functionality-invoke-native-interfaces.html
and
https://www.codenameone.com/manual/advanced-topics.html#_native_interfaces
I do the Hello World test and can't find the call for IOS to the native interface in the codename one file. I did the .h and the .m and the "generate native access". After this, I cannot check out to go on. My intension is to call a "copy from clipboard" and "paste from clipboard" native from IOS.
How do I call the native interface function hello world in codename one for IOS?
What should I import?
Is there anywhere a complete sample for IOS and native interface?
These are the files what I have now from the tutorial.
OK, the content of h file:
#import <Foundation/Foundation.h>
@interface com_mycompany_crtome_native_callsImpl : NSObject {
}
-(NSString*)helloWorld:(NSString*)param;
-(BOOL)isSupported;
@end
Then the m file:
#import "com_mycompany_crtome_native_callsImpl.h"
@implementation com_mycompany_crtome_native_callsImpl
-(NSString*)helloWorld:(NSString*)param{
NSLog(@"MyApp: %@", param);
return @"Tada";
}
-(BOOL)isSupported{
return YES;
}
@end
Then I have an extra java file called native_calls.java:
package com.mycompany.crtome;
import com.codename1.system.NativeInterface;
public interface native_calls extends NativeInterface {
String helloWorld(String hi);
}
So, I don't know how do I call that from my main java file?
And may you explain the function and the calls step by step?