<commit_before>RoboVM iOS Bindings
===================

A collection of third party bindings for RoboVM iOS.

## How do I use these bindings?

1. Fetch this repository or download it as a zip.

2. Import the project of the binding you want into Eclipse.

3. Add that project to the build path of your main RoboVM project.

4. Open the `robovm.xml` file of the binding and your main RoboVM project.

5. Copy the `<libs>`, `<frameworks>`, `<weakFrameworks>` and `<resources>` section to your project’s `robovm.xml` file and update the paths to correctly point to the linked files.

6. To find out how to use the binding take a look at its Sample class for basic usage and take a look at the original documentation of the framework or SDK.

## How do I create a binding?

When you want to create a binding, you should have a basic knowledge of the syntax of Objective-C. Also it wouldn’t hurt if you know how to use Xcode and how static libraries work.  
This tutorial will guide you in creating a fully working binding of the Google Mobile Ads iOS SDK.

### Analyzing the framework or SDK

First of all, let’s get the AdMob iOS SDK from here: https://developers.google.com/mobile-ads-sdk/download#downloadios.  
Unpack the zip file and check it’s contents. You will see lots of .h files and one .a file.  
The .h files are header files, which expose all accessible interfaces, methods and properties. We will use these files to create our bindings.  
The .a file is comparable to an archive file. It contains multiple versions of the static library for the Ads SDK.  
There is also an additional add-ons folder with more header and library files that we can create bindings for.  
Also check the readme file, which gives you a clue on the required iOS version and where you can find more info on using the library.

### Creating a binding project

Now that you have the necessary files and information, you can start creating the binding project.  
In Eclipse create a new RoboVM iOS project called „admob-ios“. You can now specify the main class, app name and app id for the project. We will create a sample class to test the binding, so let’s specify `org.robovm.bindings.admob.sample.Sample` under main class.

Please always adopt the RoboVM bindings namespace for consistency:

> org.robovm.bindings.*bindingname*

The *app name* becomes „Admob Sample“ and the *app id* just „admob“.  
Leave the other settings as they are and finish the setup.

Open up the newly created project and add the missing packages and the Sample class.

```Java
package org.robovm.bindings.admob.sample;

import org.robovm.cocoatouch.foundation.NSAutoreleasePool;
import org.robovm.cocoatouch.uikit.UIApplication;
import org.robovm.cocoatouch.uikit.UIApplicationDelegate;

public class Sample extends UIApplicationDelegate.Adapter {
	@Override
	public void didFinishLaunching (UIApplication application) {
	}

	public static void main (String[] argv) {
		NSAutoreleasePool pool = new NSAutoreleasePool();
		UIApplication.main(argv, null, Sample.class);
		pool.drain();
	}
}
```

Now we are ready to create the bindings!

### Binding classes

First of all we will create a Java class for every Objective-C interface. Typically this is one class per header file.  
To be sure, open up each header (.h) file and check if it contains a line starting with `@interface`. The name after `@interface` will become the class name, the name after the colon will become the extended class and the name(s) between the angle brackets (if any) will become implemented interfaces.  
The syntax would look like this:

> @interface **ClassName** : **ExtendedClassName**<*ImplementedInterfaceName*>
<commit_msg>Updated Readme.<commit_after>RoboVM iOS Bindings
===================

A collection of third party bindings for RoboVM iOS.

## How do I use these bindings?

1. Fetch this repository or download it as a zip.

2. Import the project of the binding you want into Eclipse.

3. Add that project to the build path of your main RoboVM project.

4. Open the `robovm.xml` file of the binding and your main RoboVM project.

5. Copy the `<libs>`, `<frameworks>`, `<weakFrameworks>` and `<resources>` section to your project’s `robovm.xml` file and update the paths to correctly point to the linked files.

6. To find out how to use the binding take a look at its Sample class for basic usage and take a look at the original documentation of the framework or SDK.

## How do I create a binding?

When you want to create a binding, you should have a basic knowledge of the syntax of Objective-C. Also it wouldn’t hurt if you know how to use Xcode and how static libraries work.  
This tutorial will guide you in creating a fully working binding of the Google Mobile Ads iOS SDK.

### Analyzing the framework or SDK

First of all, let’s get the AdMob iOS SDK from here: https://developers.google.com/mobile-ads-sdk/download#downloadios.  
Unpack the zip file and check it’s contents. You will see lots of .h files and one .a file.  
The .h files are header files, which expose all accessible interfaces, methods and properties. We will use these files to create our bindings.  
The .a file is comparable to an archive file. It contains multiple versions of the static library for the Ads SDK.  
There is also an additional add-ons folder with more header and library files that we can create bindings for.  
Also check the readme file, which gives you a clue on the required iOS version and where you can find more info on using the library.

### Creating a binding project

Now that you have the necessary files and information, you can start creating the binding project.  
In Eclipse create a new RoboVM iOS project called „admob-ios“. You can now specify the main class, app name and app id for the project. We will create a sample class to test the binding, so let’s specify `org.robovm.bindings.admob.sample.Sample` under main class.

Please always adopt the RoboVM bindings namespace for consistency:

> org.robovm.bindings.*bindingname*

The *app name* becomes „Admob Sample“ and the *app id* just „admob“.  
Leave the other settings as they are and finish the setup.

Open up the newly created project and add the missing packages and the Sample class.

```Java
package org.robovm.bindings.admob.sample;

import org.robovm.cocoatouch.foundation.NSAutoreleasePool;
import org.robovm.cocoatouch.uikit.UIApplication;
import org.robovm.cocoatouch.uikit.UIApplicationDelegate;

public class Sample extends UIApplicationDelegate.Adapter {
	@Override
	public void didFinishLaunching (UIApplication application) {
	}

	public static void main (String[] argv) {
		NSAutoreleasePool pool = new NSAutoreleasePool();
		UIApplication.main(argv, null, Sample.class);
		pool.drain();
	}
}
```

Copy the library archive file (*.a) into the libs folder of your binding project.



Now we are ready to create the bindings!

### Binding classes

First of all we will create a Java class for every Objective-C interface. Typically this is one class per header file.  
To be sure, open up each header (.h) file and check if it contains a line starting with `@interface`. The name after `@interface` will become the class name, the name after `:` will become the extended class and the name(s) between the angle brackets `<>` (if any) will become implemented interfaces.  
The syntax would look like this:

> @interface **ClassName** : **ExtendedClassName**<*ImplementedInterfaceName*>

{'fraction_non_alphanumeric': 0.06635262449528936, 'fraction_numerical': 0.0016150740242261105, 'mean_word_length': 4.247881355932203, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 18, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1608480', 'n_tokens_mistral': 2043, 'n_tokens_neox': 1968, 'n_words': 1093}