Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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