General
- see issue tracker, RoboVM specific issues are marked with [RoboVM]
- OGG is currently not supported by ObjectAL
+ - Update: Vibration is not really supported on iOS
- IOSApplication.java
- getClipboard() not implemented properly, should at least support strings
- add compass
- add useGL2, requires implementation of GL10/GL11 for ios, and fixes in IOSGraphics
-- IOSAudo
- - newAudioDevice(), new AudioRecorder() not implemented
- - OGG not supported, see if we can add that to ObjectAL
-
- IOSGraphics
- need to store current device orientation for Input#getOrienation and consorts
- Add support for GL10/GL11
- IOSInput
- getAzimuth(), getPitch(), getRoll(), getRotationMatrix() need to be implemented and output the same as android
- - vibrate(), cancelVibrate() needs to be implemented
- see if we can programmatically show the keyboard and receive key events, if so map to gdx keycodes
- getPlaceholderTextInput() needs to be implemented
- add compass support, fix up isPeripheralAvailable(), including onscreen keyboard stuff
-
-- IOSMusic
- - OGG support
-
-- IOSNet
- - check if that actually works as intended
+
+- IOSAudo
+ - newAudioDevice(), new AudioRecorder() not implemented
- IOSSound
- add support for manipulating an already playing sound instance, seems to work through ALSource
import com.badlogic.gdx.backends.iosrobovm.IOSApplication;
import com.badlogic.gdx.backends.iosrobovm.IOSApplicationConfiguration;
+import com.badlogic.gdx.tests.net.PingPongSocketExample;
public class IOSRobovmTests extends IOSApplication.Delegate {
class InnerClass {
@Override
protected IOSApplication createApplication() {
IOSApplicationConfiguration config = new IOSApplicationConfiguration();
- return new IOSApplication(new BulletTestCollection(), config);
+ return new IOSApplication(new PingPongSocketExample(), config);
}
public static void main(String[] argv) {
import com.badlogic.gdx.tests.g3d.ModelTest;\r
import com.badlogic.gdx.tests.g3d.ShaderCollectionTest;\r
import com.badlogic.gdx.tests.g3d.voxel.VoxelTest;\r
+import com.badlogic.gdx.tests.net.NetAPITest;\r
import com.badlogic.gdx.tests.utils.GdxTest;\r
\r
public class LwjglDebugStarter {\r
// new SharedLibraryLoader("../../extensions/gdx-controllers/gdx-controllers-desktop/libs/gdx-controllers-desktop-natives.jar").load("gdx-controllers-desktop");\r
// new SharedLibraryLoader("../../gdx/libs/gdx-natives.jar").load("gdx");\r
\r
- GdxTest test = new ShaderCollectionTest();\r
+ GdxTest test = new NetAPITest();\r
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();\r
config.useGL20 = test.needsGL20();\r
config.width = 1024;\r
--- /dev/null
+package com.badlogic.gdx.tests.net;
+
+import com.badlogic.gdx.ApplicationAdapter;
+import com.badlogic.gdx.Gdx;
+import com.badlogic.gdx.Net.HttpMethods;
+import com.badlogic.gdx.Net.HttpRequest;
+import com.badlogic.gdx.Net.HttpResponse;
+import com.badlogic.gdx.Net.HttpResponseListener;
+import com.badlogic.gdx.tests.utils.GdxTest;
+
+/**
+ * Demonstrates how to perform a simple HTTP request.
+ * Need to add internet permission to AndroidManifest.xml.
+ * @author badlogic
+ *
+ */
+public class HttpRequestExample extends GdxTest {
+ @Override
+ public void create() {
+ HttpRequest request = new HttpRequest(HttpMethods.GET);
+ request.setUrl("http://libgdx.badlogicgames.com/nightlies/dist/AUTHORS");
+ Gdx.net.sendHttpRequest(request, new HttpResponseListener() {
+ @Override
+ public void handleHttpResponse(HttpResponse httpResponse) {
+ Gdx.app.log("HttpRequestExample", "response: " + httpResponse.getResultAsString());
+ }
+
+ @Override
+ public void failed(Throwable t) {
+ Gdx.app.error("HttpRequestExample", "something went wrong", t);
+ }
+ });
+ }
+}
--- /dev/null
+package com.badlogic.gdx.tests.net;
+
+import com.badlogic.gdx.ApplicationAdapter;
+import com.badlogic.gdx.Gdx;
+import com.badlogic.gdx.tests.utils.GdxTest;
+
+/**
+ * Demonstrates how to open a browser and load
+ * a specific URL.
+ * @author badlogic
+ *
+ */
+public class OpenBrowserExample extends GdxTest {
+ @Override
+ public void create() {
+ Gdx.net.openURI("http://libgdx.badlogicgames.com");
+ }
+}
--- /dev/null
+package com.badlogic.gdx.tests.net;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+import com.badlogic.gdx.ApplicationAdapter;
+import com.badlogic.gdx.Gdx;
+import com.badlogic.gdx.Net.Protocol;
+import com.badlogic.gdx.net.ServerSocket;
+import com.badlogic.gdx.net.ServerSocketHints;
+import com.badlogic.gdx.net.Socket;
+import com.badlogic.gdx.net.SocketHints;
+import com.badlogic.gdx.tests.utils.GdxTest;
+
+/**
+ * Demonstrates how to do very simple socket programming. Implements
+ * a classic PING-PONG sequence, client connects to server, sends
+ * message, server sends message back to client. Both client
+ * and server run locally. We quit as soon as the client
+ * received the PONG message from the server. This example
+ * won't work in HTML. Messages are delimited by the new line character,
+ * so we can use a {@link BufferedReader}.
+ * @author badlogic
+ *
+ */
+public class PingPongSocketExample extends GdxTest {
+ @Override
+ public void create() {
+ // setup a server thread where we wait for incoming connections
+ // to the server
+ new Thread(new Runnable() {
+ @Override
+ public void run() {
+ ServerSocketHints hints = new ServerSocketHints();
+ ServerSocket server = Gdx.net.newServerSocket(Protocol.TCP, 9999, hints);
+ // wait for the next client connection
+ Socket client = server.accept(null);
+ // read message and send it back
+ try {
+ String message = new BufferedReader(new InputStreamReader(client.getInputStream())).readLine();
+ Gdx.app.log("PingPongSocketExample", "got client message: " + message);
+ client.getOutputStream().write("PONG\n".getBytes());
+ } catch (IOException e) {
+ Gdx.app.log("PingPongSocketExample", "an error occured", e);
+ }
+ }
+ }).start();
+
+ // create the client send a message, then wait for the
+ // server to reply
+ SocketHints hints = new SocketHints();
+ Socket client = Gdx.net.newClientSocket(Protocol.TCP, "localhost", 9999, hints);
+ try {
+ client.getOutputStream().write("PING\n".getBytes());
+ String response = new BufferedReader(new InputStreamReader(client.getInputStream())).readLine();
+ Gdx.app.log("PingPongSocketExample", "got server message: " + response);
+ } catch (IOException e) {
+ Gdx.app.log("PingPongSocketExample", "an error occured", e);
+ }
+ }
+}
\ No newline at end of file