Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shannah/ios-native-apis
Codename One Native wrappers for selected iOS foundation classes
https://github.com/shannah/ios-native-apis
Last synced: 9 days ago
JSON representation
Codename One Native wrappers for selected iOS foundation classes
- Host: GitHub
- URL: https://github.com/shannah/ios-native-apis
- Owner: shannah
- License: apache-2.0
- Created: 2022-02-23T21:20:52.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-02-23T21:35:38.000Z (almost 3 years ago)
- Last Synced: 2024-12-24T05:04:47.624Z (18 days ago)
- Language: Java
- Size: 32.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
= iOS Native APIs for Codename One
This library is aimed at providing access to selected native iOS APIs in https://www.codenameone.com[Codename One] apps. Classes in this library will also provide emulation on other platforms so that they can be used in a cross-platform manner. APIs will closely map to the underlying iOS API when running on iOS. When running on other platforms, it will use cross-platform APIs under the hood.
== Status
This project is at an early stage, and only supports one class. More will be added.
== Classes Supported
. NSURLSession
== Example Code
[source,java]
----
NSURLSession.getSharedSession().downloadTaskWithURL(urlField.getText()).ready(task-> {
File location = task.getLocation();
try {
String contents = Util.readToString(location);
callSerially(()->{
textArea.setText(contents);
textArea.getParent().revalidateWithAnimationSafety();
});
} catch (Exception ex) {
callSerially(()->{
textArea.setText(ex.getMessage());
textArea.getParent().revalidateWithAnimationSafety();
});
}
}).except(ex->{
callSerially(()->{
textArea.setText(ex.getMessage());
textArea.getParent();
});
});
----== Installation
Clone and install the project:
[source,listing]
----
git clone https://github.com/shannah/ios-native-apis
cd ios-native-apis
mvn install
----Then add maven dependency to your common/pom.xml file:
[source,xml]
----com.codenameone
ios-native-apis-lib
1.0-SNAPSHOT
pom----
== Test App
https://github.com/shannah/ios-native-apis-test